0
rolling_window = 120
df = df.rolling(rolling_window, min_periods=1).agg(['mean','std'])
df.columns = df.columns.map('_'.join)
# df = df.reset_index()
df = df.iloc[(rolling_window-1):,]
df = df.rename_axis('timestamps').reset_index()
df = df.set_index('timestamps')

the dataframe get index position start from 119 but I want to start from 0. how to reset?

petezurich
  • 9,280
  • 9
  • 43
  • 57
Sushil Kokil
  • 137
  • 1
  • 1
  • 11

1 Answers1

2
df.reset_index(drop=True)

The drop attribute specifies whether the previously used index column should be removed.

Hidi Eric
  • 344
  • 1
  • 8