Open davidmcnamee opened 4 years ago
@uWaterloo I will say second code snippet can't be df.iloc['Apples':'Potatoes']. Because iloc uses only integer type indexed value. If you want to use string value as index for accessing data from pandas dataframe then you have to use Pandas Dataframe loc method.
Now the second issue about df.loc['Apples', 'Potatoet']:
I will say typo mistake is about not mentioning apostrophe mark after Potatoet
Basically it will include Potatoet if there is any in the given dataframe.
Moreover they have mentioned to use df.loc['Apples', 'Potatoes'] over df.loc['Apples', 'Potatoet'].
Hey, I was just going through the pandas tutorial and wasn't sure whether this is a typo or if I'm misunderstanding.
https://github.com/Kaggle/learntools/blob/886f5c215de079287f21e2d3a92bd852fb95d105/notebooks/pandas/raw/tut_1.ipynb#L279
Should the second code snippet be
df.iloc['Apples':'Potatoes']
? It was just explained thatdf.iloc[0:10]
gives you indices0,...,9
butdf.loc[0:10]
gives you indices0,...,10
; and then I wasn't sure how they gotdf.loc['Apples', 'Potatoet]
.