Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas index to datetime

import pandas as pd
df = pd.Dataframe(data)
df.index = pd.DatetimeIndex(data=df.index, tz='US/Eastern') # naive--> aware
df.index = pd.DatetimeIndex(df.index.tz_convert('US/Pacific')) # aware--> aware
df
Source by www.statology.org #
 
PREVIOUS NEXT
Tagged: #pandas #index #datetime
ADD COMMENT
Topic
Name
4+3 =