Python Forum
Exporting data from python into excel
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exporting data from python into excel
#1
Dear Sir,
I have interpolated data in python and I want to export the data into excel. The code for the interpolation is pasted below.
The output has been produced by thus code but I tried to export it into excel using
interpolated = upsampled.interpolate(method='linear')
interpolated.head(159)
interpolated.to_excel('test.xlsx')
This code did not produce an error message indicating that the instruction might be successful. However, there is no indication anywhere in the file explorer where the data file in excel could be located. Can anyone offer an idea on how to locate the data file anywhere on the computer in excel, or whether this code is correct.
Thank you
Reply
#2
the excel should be in the current working directory. You can always supply full path to excel file, so that you be certain where to expect the file.
Note that interpolated.head(159) is doing nothing visible - you don't print it or anything else
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
Thank you for the reply. How do I supply a full path to the excel file? You also indicated that the excel should be in the current working directory but it doesn't show anywhere in the directory. Can you give any guidance on this as well please?
Thank you
Reply
#4
Just create a full path name instead of the final component. Instead of "test.xlsx", try r"C:\test.xlsx". or r"C:\Users\my_username\test.xlsx".
Reply
#5
Thank you for the reply. I have tried one of the options you suggested to create a full path as
interpolated.to_excel(r"C:\test.xlsx") but I am still getting error messages. I am not sure if there is something that I am not doing right.
Thank you
Reply
#6
(Jun-01-2020, 09:58 PM)Zankawah Wrote: but I am still getting error messages
You were not getting error messages before, right? What is it? Post full traceback in error tags also post the full code that produce it
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Copy data from Excel and paste into Discord (Midjourney) Joe_Wright 4 2,023 Jun-06-2023, 05:49 PM
Last Post: rajeshgk
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,088 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  How to properly format rows and columns in excel data from parsed .txt blocks jh67 7 1,872 Dec-12-2022, 08:22 PM
Last Post: jh67
  Trying to Get Arduino sensor data over to excel using Python. eh5713 1 1,695 Dec-01-2022, 01:52 PM
Last Post: deanhystad
  Appending a row of data in an MS Excel file azizrasul 3 1,171 Nov-06-2022, 05:17 PM
Last Post: azizrasul
  Moving data from one Excel to another and finding maximum profit azizrasul 7 1,459 Oct-06-2022, 06:13 PM
Last Post: azizrasul
  Exporting Stock Fundamental Data to a CSV file with yahoo_fin DustinKlent 2 4,710 Aug-01-2022, 06:08 PM
Last Post: paulyan
  get data from excel and find max/min Timmy94 1 1,107 Jul-27-2022, 08:23 AM
Last Post: Larz60+
  How to keep columns header on excel without change after export data to excel file? ahmedbarbary 0 1,159 May-03-2022, 05:46 PM
Last Post: ahmedbarbary
  Need Help writing data into Excel format ajitnayak87 8 2,503 Feb-04-2022, 03:00 AM
Last Post: Jeff_t

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020