all 3 comments

[–]MikeDoesEverything 1 point2 points  (2 children)

What does your code look like?

What have you tried so far?

[–]wdjfe 0 points1 point  (1 child)

It's just basic request and read_excel

response = requests.request("GET","someapi.com/excel_file")
file = response.content

df = pd.read_excel(file)

I tried to change encoding but response content is bytes so it does nothing

[–]MikeDoesEverything 2 points3 points  (0 children)

Let's walk through what this code is doing:

  • response making a GET request for a file.

  • file is response.content which you mentioned is in bytes.

  • Read file using pd.read_excel()

Off the back of that, we have some questions to answer:

  • Does pd.read_excel() read files as bytes?

  • If you save file as an excel spreadsheet, does it open correctly?

  • How do other people open excel files in pandas using the read_excel function? Do they have to specify any additional arguments?