I am new to python. Can someone explain what happened when I try to get index information after reading the csv file?
import pandas as pd
df = pd.read_csv('olympics.csv', index_col=0, skiprows=1)
for col in df.columns:
if col[:2]=='01':
df.rename(columns={col:'Gold'+col[4:]}, inplace=True)
if col[:2]=='02':
df.rename(columns={col:'Silver'+col[4:]}, inplace=True)
if col[:2]=='03':
df.rename(columns={col:'Bronze'+col[4:]}, inplace=True)
if col[:1]=='№':
df.rename(columns={col:'#'+col[1:]}, inplace=True)
names_ids = df.index.str.split('\s\(') # split the index by '('
df.index = names_ids.str[0]
df['ID'] = names_ids.str[1].str[:3]
df = df.drop('Totals')
df.head()
Then I get this dataframe.

But when I try to get the index information using df.index(), I got an error, saying Index object is not callable.
df.index.str.split(...)