Activity 2.01 – Working with pandas data structures
In this activity, you will read a DataFrame from the US_GDP.csv
file, which contains information about the GDP of the US, from the first financial quarter of 2017 to the last financial quarter of 2019. The data is stored in two columns, date
and GDP
, and the date is read in (by default) as the object
type. The goal of this activity is to first convert the date
column into a timestamp and then set this column as the index. Finally, you'll save the updated dataset to a new file:
You can download the file from
- Import the
pandas
library. - Read the
US_GDP.csv
file from theDatasets
directory into a DataFrame namedGDP_data
. The data is stored as dates and values, and you wish to use the dates as the index, so that in future work you may apply pandas time series methods to this data. - Display the head of
GDP_data
so that you can see the formats of the data in the file. - Inspect the object types of...