- When using an arbitrary index through set_index function,
- df.loc[number, :], number will need to be part of the arbitrary index set
- df.iloc[0, :] will return the first row regardless of the index set
- the catch here is that you cannot specify the column by the column name, but only by the column number
- [not preferred] df.ix[number, :], number will need to be part of the arbitrary index set
- For more details:
http://www.shanelynn.ie/select-pandas-dataframe-rows-and-columns-using-iloc-loc-and-ix/
- When two dataframes share the same index (one is the subset of another), we can just assign columns to one another like below and the corresponding subset rows will be filled and the remaining will be NaN