我试图在pandas中运行以下SQL语句(显然是在Python代码中),但我无处可去:
select year, contraction, indiv_count, total_words from dataframe
where contraction in ("i'm","we're","we've","it's","they're")
其中contractions
为char
,year
,indiv_count
和total_words
为int
。
答案 0 :(得分:2)
如果您还没有,我建议您阅读Anton评论中列出的文档,但是它缺少public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button_frm2(object sender, EventArgs e)
{
Form1 frm1 = new Form1();
textBox1.Text= frm1.dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
}
}
方法的文档,这是您需要复制的方法SQL .isin()
。
in
然后可以使用df[df['contraction'].isin(["i'm","we're","we've","it's","they're"])]
或者您最喜欢的方法获取列选择(有很多)。