Python Forum
Pandas .to_excel() Dropping First Row of Data When Run from Anaconda Prompt
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pandas .to_excel() Dropping First Row of Data When Run from Anaconda Prompt
#1
I have a pandas dataframe that I'm trying to output as an excel file. The dataframe is called "output". The following command runs without issue for me directly in Pycharm.

output.to_excel("myfilepath",index=False)
I then have a windows batch file running this .py file via the Anaconda command prompt.
Batch File Command
start C:\ProgramData\Anaconda3\python.exe -i mypythonfilepath %1

Now when this python file is run via this batch file, the resulting excel output drops the first row of my dataframe. Any ideas as to why this might be happening? The first row always gets dropped in this second scenario, even if I set my to_excel startrow = 0 or even change it up to output as a csv using the to_csv() function.

Any insight is much appreciated.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Grouping in pandas/multi-index data frame Aleqsie 3 607 Jan-06-2024, 03:55 PM
Last Post: deanhystad
  Reading large crapy text file in anaconda to profile data syamatunuguntla 0 811 Nov-18-2022, 06:15 PM
Last Post: syamatunuguntla
Smile How to further boost the data read write speed using pandas tjk9501 1 1,231 Nov-14-2022, 01:46 PM
Last Post: jefsummers
Thumbs Up can't access data from URL in pandas/jupyter notebook aaanoushka 1 1,831 Feb-13-2022, 01:19 PM
Last Post: jefsummers
Question Sorting data with pandas TheZaind 4 2,296 Nov-22-2021, 07:33 PM
Last Post: aserian
  Please, prompt open data repositories AlekseyPython 4 2,013 Sep-29-2021, 01:04 PM
Last Post: AlekseyPython
  Pandas Data frame column condition check based on length of the value aditi06 1 2,655 Jul-28-2021, 11:08 AM
Last Post: jefsummers
  [Solved] df.to_excel: certain rows ju21878436312 2 3,192 Jun-15-2021, 09:32 AM
Last Post: ju21878436312
  [Pandas] Write data to Excel with dot decimals manonB 1 5,775 May-05-2021, 05:28 PM
Last Post: ibreeden
  pandas.to_datetime: Combine data from 2 columns ju21878436312 1 2,421 Feb-20-2021, 08:25 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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