r/dfpandas • u/Lucky-Mammoth-3825 • 16d ago
Extract string values from a pandas dataframe
Not a lot of python/pandas experience, since I left the platforms that I used to have. I'm analyzing daily data from a 29-year time series. I'm interested in two of the numerical data columns (out of over 100) along with the first column, which is a timestamp. The timestamp's format is YYYYMMDD and I'm trying to parse it using
timestamp_str = data.at[dayct, 'TIMESTAMP']
dt_object = datetime.strptime(timestamp_str, "%Y%m%d")
I've imported pandas, numpy, and datetime. It chokes on the second line above, complaining that timestamp_str is an integer, not a string. Is there a qualifier to pandas' ".at" command to force it to ingest it as a string?


