I have the following pandas data frame loaded from a csv file, with the first column (yearly quarter) as displayed.
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 44 entries, 0 to 43
Data columns (total 2 columns):
Quarter 44 non-null object
Earnings 44 non-null float64
dtypes: float64(1), object(1)
memory usage: 784.0+ bytes
None
Quarter Earnings
0 2007Q1 -0.36
1 2007Q2 -0.38
2 2007Q3 0.07
3 2007Q4 1.85
4 2008Q1 -0.34
I would like the first column transformed into this (below). Is there some type of python or pandas datetime function to do this
In [1]: print(HRB)
Earnings
Quarter
2007-01-01 -0.36
2007-04-01 -0.38
2007-07-01 0.07
2007-10-01 1.85
2008-01-01 -0.34
2008-04-01 -0.42
2008-07-01 0.02
Here is the raw csv data
Quarter,Earnings
2007Q1,-0.36
2007Q2,-0.38
2007Q3,0.07
2007Q4,1.85
2008Q1,-0.34
2008Q2,-0.42
2008Q3,0.02