Articles → Pandas → Reset_Index Function In Pandas
Reset_Index Function In Pandas
Purpose
Example
import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randn(4,3),['A','B','C','D',],['W','X','Y'])
print(df)
df.reset_index(inplace=True)
print(df)
Output
Click to Enlarge