'Unable to set df index in freq 10 min

I am working with a timeseries with Pandas(Python). I am traying to set the index freq to 10min.

I create the new_index:

new_index = pd.date_range("2022-01-01", periods=7844, freq="10 min")

Update my df with the new__index

data_df['new_Date']=new_index

Set date as index

data_df.set_index('new_Date',inplace=True)

Then I print the new index freq:

print(data_df.index.freq)

Output: None

I can't figure out why, even though I explicitly create an index with the freq option, once in the df it is not recognized.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source