I have a CSV file that I'm downloading online. I'm trying to get it into a Pandas DataFrame. The source is the Federal Reserve Bank and using inflation data (CPI). I'm missing something to make this work.
Here's the URL to download:
s_url = https://fred.stlouisfed.org/graph/fredgraph.csv?cosd=1990-01-01&coed=2040-01-01&id=CPIAUCSL
I'm taking that URL and reading it with this:
response = urlopen(s_url).read()
That gives me something that looks like this:
b'DATE,CPIAUCSL\n1990-01-01,127.5\n1990-02-01,128.0\n1990-03-01,128.6\n1990-04-01,128.9\n1990-05-01,129.1\n1990-06-01,129.9\n1990-07-01,130.5\n1990-08-01,131.6\n1990-09-01,132.5\n1990-10-01,133.4\n1990-11-01,133.7\n1990-12-01,134.2\n1991-01-01,134.7\n1991-02-01,134.8\n1991-03-01,134.8\n1991-04-01,135.1\n1991-05-01,135.6\n1991-06-01,136.0\n'
I tried to then take that response and read it into Pandas:
df = pd.read_csv(response)
That doesn't work. What steps am I missing in this process?