"order of operation" is why you need extra parentheses with the & and | operator. So called 'bit-wise' operators are always executed 'greedily', which means they try to execute before the >= operator, messing up what you mean. I recommend looking into "order of operation" if you're confused (it *is* a pretty complex, but also important, topic).
Hi , thank you , i am new in programming , can i ask you how can i get if the last value in one column is the greatest one in comparing with last 10 values in the same column ?!
Thank you for this, I am watching the entire series. I have a question, if I want to search for cereal with high protein or low fat but only want to display their name I can do something like this: df[(df['protein'] >= 4) | (df['fat'] < 2)].loc[0:,'name'] This command returns a series. I could not see how I can display it as a dataframe, any idea?
Hey man, thanks a lot for watching. The easiest way would just be to transform the series into a data frame. define the series -> series = df[(df['protein'] >= 4) | (df['fat'] < 2)].loc[0:,'name'] Then series = pd.DataFrame(series)
@@Algovibes Or you could just put brackets as see on previous videos : df[(df['protein'] >= 4) | (df['fat'] < 2)].loc[0:,['name']] Brackets makes it DataFrame, whithout it makes it Series. Am I right ?
Keep on making these videos, i can't stop watching videos of your channel. lol
Thanks for your support mate
Excellent video
Thank you mate
"order of operation" is why you need extra parentheses with the & and | operator.
So called 'bit-wise' operators are always executed 'greedily', which means they try to execute before the >= operator, messing up what you mean.
I recommend looking into "order of operation" if you're confused (it *is* a pretty complex, but also important, topic).
Thank you very much!
thank you for this!
You are very welcome :-) Thank you for watching.
It's very clear and helpful. Thanks a lot.
Thanks for watching mate :-)
Hi , thank you , i am new in programming , can i ask you how can i get if the last value in one column is the greatest one in comparing with last 10 values in the same column ?!
If I try do filte the data by df[(boolean-mask)] the table gives me only NaN as values, why is that?
Depends on what are you filtering for?
'>' not supported between instances of 'list' and 'int'
this error found
What is the problem if the mean() function returns the value "inf"?:
my values werent integers / floats :D
Nice that you solved it on your own 😛
I tried this and the code is correct but Im constantly getting a keyerror. Pls help
Can you elaborate when you are getting an error? Happy to help!
Thank you for this, I am watching the entire series.
I have a question, if I want to search for cereal with high protein or low fat but only want to display their name I can do something like this: df[(df['protein'] >= 4) | (df['fat'] < 2)].loc[0:,'name']
This command returns a series. I could not see how I can display it as a dataframe, any idea?
Hey man, thanks a lot for watching. The easiest way would just be to transform the series into a data frame.
define the series -> series = df[(df['protein'] >= 4) | (df['fat'] < 2)].loc[0:,'name']
Then
series = pd.DataFrame(series)
@@Algovibes Or you could just put brackets as see on previous videos :
df[(df['protein'] >= 4) | (df['fat'] < 2)].loc[0:,['name']]
Brackets makes it DataFrame, whithout it makes it Series. Am I right ?