Getting Confused with [] [[ ]] while using loc() #54
Replies: 1 comment 2 replies
-
No bro , in the second case its only one being passed which is max : min(max to min). btw in the first case the argument being passed is a List of index labels or index names and using [[]] returns the dataframe. you can also pass a single label for row and column for example if u have a column named A then df.describe().loc['50%', 'A'] and this will return the specifc value in the row 50% and column A. |
Beta Was this translation helpful? Give feedback.
-
In both cases multiple arguments are being passed, but in scenario one we are using double [[]] and scenario two []; why
How to deal with this confusion
now hot to select rows
df.describe().loc[['min', '25%', '50%', '75%', 'max']]
now hot to select rows method number 2
df.describe().loc['min': 'max']
Beta Was this translation helpful? Give feedback.
All reactions