Pandas parser will take into account the timezone information if it's available, and give you a naive Timestamp (naive == no timezone info), but with the timezone offset taken into account.
To keep the timezone information in you DataFrame you should first localize the Timestamps as UTC
and then convert them to their timezone (which in this case is Etc/GMT+4
):
>>> df = pd.read_csv(PeriodC, sep=';', parse_dates=[0], index_col=0)
>>> df.index[0]
>>> Timestamp('2013-08-25 04:00:00', tz=None)
>>> df.index = df.index.tz_localize('UTC').tz_convert('Etc/GMT+4')
>>> df.index[0]
Timestamp('2013-08-25 00:00:00-0400', tz='Etc/GMT+4')
If you want to completely discard the timezone information, then just specify a date_parser
that will split the string and pass only the datetime portion to the parser.
>>> df = pd.read_csv(file, sep=';', parse_dates=[0], index_col=[0]
date_parser=lambda x: pd.to_datetime(x.rpartition('-')[0]))
>>> df.index[0]
Timestamp('2013-08-25 00:00:00', tz=None)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…