Python Forum
Rename first row in a CSV file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rename first row in a CSV file
#3
Your first column name is " AA", not "AA". You need to tell pandas that there may be extra whitespace
df = pd.read_csv('my_data.csv', skipinitialspace=True)
Reply


Messages In This Thread
Rename first row in a CSV file - by James_S - Dec-17-2023, 12:59 AM
RE: Rename first row in a CSV file - by James_S - Dec-17-2023, 02:33 AM
RE: Rename first row in a CSV file - by deanhystad - Dec-17-2023, 04:59 AM
RE: Rename first row in a CSV file - by James_S - Dec-17-2023, 05:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  rename same file names in different directories elnk 5 2,399 Jul-12-2024, 01:43 PM
Last Post: snippsat
  Extract and rename a file from an Archive tester_V 4 3,650 Jul-08-2024, 07:54 AM
Last Post: tester_V
  rename file RolanRoll 0 1,073 May-18-2023, 02:17 PM
Last Post: RolanRoll
  '' FTP '' File upload with a specified string and rename midomarc 1 2,206 Apr-17-2023, 03:04 AM
Last Post: bowlofred
  rename and add desire "_date" to end of file name before extention RolanRoll 1 1,947 Jun-13-2022, 11:16 AM
Last Post: gruntfutuk
  Rename Files based on XML file klturi421 3 3,443 Oct-22-2021, 07:37 PM
Last Post: klturi421
  How to rename a CSV file by adding MODIFIED in the filename? Python_User 25 13,116 Dec-13-2020, 12:35 PM
Last Post: Larz60+
  Rename docx file from tuple gjack 2 2,938 Oct-20-2020, 05:33 PM
Last Post: gjack
  Copy mp3 file multiple times and rename Mar10 4 5,013 Sep-23-2020, 01:09 AM
Last Post: Mar10
  Rename file from value in text file Nuge93 1 3,042 Jan-20-2020, 03:50 PM
Last Post: gruntfutuk

Forum Jump:

User Panel Messages

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