【发布时间】:2017-06-12 22:23:02
【问题描述】:
我的问题与这篇文章有关:
How to filter csv data by applying conditions on certain columns in python
我将如何应用另一个条件?例如,假设我只对 Energy_Supply_per_capita > 280 且排放量_of_co2
【问题讨论】:
我的问题与这篇文章有关:
How to filter csv data by applying conditions on certain columns in python
我将如何应用另一个条件?例如,假设我只对 Energy_Supply_per_capita > 280 且排放量_of_co2
【问题讨论】:
试试这个:
q = "Country_Area in ['Albania','Zambia'] "+\
"and Energy_Supply_per_capita > 280 "+\
"and emissions_of_co2 < 30"
df.query(q)
【讨论】: