remove default index from pandas dataframe
pythonCopyimport pandas as pd
my_df = pd.DataFrame({
'Person': ['Alice', 'Steven', 'Neesham', 'Chris', 'Alice'],
'City': ['Berlin', 'Montreal', 'Toronto', 'Rome', 'Munich'],
'Mother Tongue': ['German', 'French', 'English', 'Italian', 'German'],
'Age': [37, 20, 38, 23, 35],
},index=["A","B","C","D","E"])
df_reset=my_df.set_index('Person')
print("Initial DataFrame:")
print(my_df,"\n")
print("After setting Person column as Index:")
print(df_reset)