I have an initial csv file that contains certian values that I am interested in, and I would like to read it and to filter it at the same time.
The file has the following structure:
A | B |
---|---|
25 | xx |
NaN | yy |
32 | zz |
25 | zz |
What I normally do is read it first and then, apply the filter:
df = pd.read_csv(filename, sep=";")
df = df[df['A']==25]
I would like to know if it is possible to filter it in a chained way such as the following:
df = pd.read_csv(filename, sep=";")\
.where('A'==25)