I have a problem regarding how to filter xlsx and csv data points with pandas.
import pandas as pd
df = pd.read_excel("Wind.xlsx")
df.head()
filter = df[["WindSpeed"] > 2]
ew=df[filter]
print(ew)
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>
How come it will not return the value greater than 2?
The result is an error which is the following: TypeError: '>' not supported between instances of 'list' and 'int'
CodePudding user response:
Use
filter = df["WindSpeed"] > 2
CodePudding user response:
Try this
filter = df[df['WindSpeed'] > 2]