Python Forum
Save data frame to .csv df.to.csv()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save data frame to .csv df.to.csv()
#2
I have found this solution.

Replacing the last line with:

df.to_csv(f'Station_{index+1}.csv')
I will get:

Station_1.csv
Station_2.csv


It is not perfect because I still can´t use the name that is stored in

 location = row['Name']
, but it solves the problem.
Reply


Messages In This Thread
Save data frame to .csv df.to.csv() - by mcva - Feb-03-2022, 11:48 AM
RE: Save data frame to .csv df.to.csv() - by mcva - Feb-03-2022, 07:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to save to multiple locations during save cubangt 1 565 Oct-23-2023, 10:16 PM
Last Post: deanhystad
  how do you style data frame that has empty rows. gsaray101 0 538 Sep-08-2023, 05:20 PM
Last Post: gsaray101
  googletrans library to translate text language for using data frame is not running gcozba2023 0 1,237 Mar-06-2023, 09:50 AM
Last Post: gcozba2023
  Load multiple Jason data in one Data Frame vijays3 6 1,567 Aug-12-2022, 05:17 PM
Last Post: vijays3
  conditionals based on data frame mbrown009 1 906 Aug-12-2022, 08:18 AM
Last Post: Larz60+
  Merging two Data Frame on a special case piku9290dgp 0 1,094 Mar-02-2022, 10:43 AM
Last Post: piku9290dgp
  Move a particular row in pandas data frame to last row klllmmm 0 3,781 Dec-27-2021, 09:11 AM
Last Post: klllmmm
  Iterating Through Data Frame Rows JoeDainton123 2 2,949 Aug-09-2021, 07:01 AM
Last Post: Pedroski55
  SaltStack: MySQL returner save less data into Database table columns xtc14 2 2,183 Jul-02-2021, 02:19 PM
Last Post: xtc14
  Filtering a data frame according to number of occurences of an observation Menthix 1 1,890 May-31-2021, 10:50 PM
Last Post: supuflounder

Forum Jump:

User Panel Messages

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