Can someone please explain the error in the code (Reference Week 10 pandas - topic - Querying from dataframe)
This will not work.
df['method'] in ['Radial Velocity', 'Transit']
is it beacuse it just returns a single value true or false and not the indices of the rows as to where it is true and where it is false, for the df command to print the respective rows?
Yes, I think so after you add ‘any’ or ‘all’ to it.
For similar reason ‘&’ and ‘|’ was used (instead of ‘and’ and ‘or’).
Check this thread.
Understood, Thank you
The expression you used for checking ‘method’ looks very logical. I wish it was valid
I wished that too