I'm pretty new to working with Pandas and am trying to figure out why this timestamp won't convert. As an example, one individual timestamp is the string
'2010-10-06 16:38:02'
newdata = pd.DataFrame.from_records(data, columns = ["col1", "col2", "col3", "timestamp"], index = "timestamp")
newdata.index = newdata.index.tz_localize('UTC').tz_convert('US/Eastern')
AttributeError: 'Index' object has no attribute 'tz_localize'
TypeError: index is not a valid DatetimeIndex or PeriodIndex
newdata.index=pd.DatetimeIndex(newdata.index).tz_localize('UTC').tz_convert('US/Eastern')
I've been asked to add a formal answer instead of just editing my question, so here it is. Note it builds off the answer above, but that that one didn't quite work for me.
newdata.index=pd.DatetimeIndex(newdata.index).tz_localize('UTC').tz_convert('US/Eastern')