Back Navigation Next Navigation Pandas (page 4 of 9)

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

Pandas Selecting