ython return column of pandas dataframe code example
Example 1: get column number in dataframe pandas
# PANDAS: get column number from colomn name
dataframe.columns.get_loc("<col_name>")
Example 2: pandas df by row index
indices = [133, 22, 19, 203, 14, 1]
df_by_indices = df.iloc[indices, :]