I am pulling data from an API endpoint. My response looks like this:
b'col1;col2;col3;a1;a2;a3\r\nb1;b2;b3\r\n'
I want to format the response to look like this:
col1 col2 col3
a1 a2 a3
b1 b2 b3
To complicate things further, this is the response for one input in my list. I need this to loop through and repeat through multiple inputs.
This is what I've tried so far:
dict = {}
dict[1] = "input1"
dict[2] = "input2"
base_url = "ex.com/?key=abc&input={}"
df = pandas.read_csv('out.csv', Header = None)
for input in dict:
url1=base_url.format(input)
response1 = requests.get(url1)
Now I know the for loop is incomplete - not sure which function to use to append the data and make it in the right format. I'm new to Python - even if you direct me to the right function to research, that would help.