1import pandas as pd
2df = pd.DataFrame({"pear": [1,2,3], "apple": [2,3,4], "orange": [3,4,5]})
3
4len(df.columns)
53
1# PANDAS: get column number from colomn name
2dataframe.columns.get_loc("<col_name>")
3
1import pandas as pd
2df = pd.DataFrame({"pear": [1,2,3], "apple": [2,3,4], "orange": [3,4,5]})
3
4len(df.columns)