![]() ![]() |
Pandas (page 4 of 9) |
We can select a single column of data (my_df[‘ColName’]) as a Series or a few columns (my_df[[‘ColName1’, ‘ColName2’]]) as a DataFrame.
We can select rows by position (my_df.iloc[0]) or by the row index label (my_df.loc['index_one']). To select the first element of the first column, we can execute my_df.iloc[0, 0].