简体   繁体   English

在Python中使用特定的数据框

[英]Using specific data frame in Python

so I have a huge table with 4 columns, and the thing is I have to use data from 2nd and 3rd columns, but only if the data in 1st column has values between A and B. Can you help me? 所以我有一个包含4列的巨大表,而事情是我必须使用第二列和第三列的数据,但前提是第一列中的数据的值介于A和B之间。您能帮我吗?

Thank you! 谢谢!

我不确定我是否理解正确,但是要为列1中A和B之间的值的行过滤数据框,可以这样做:

filtered_df = df[(df['Col1'] > A) & (df['Col1'] < B)] 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM