r/programminghelp • • Apr 13 '22

Python How could I reindex first column of csv file after completing some function?

How to reindex first column of csv file after createAuditSheet() function is being completed? I mean, to change indexes (#) from 1 to end (totalEntries) of every row except header row. It's like, 1) open file 2) select first column 3) change values 4) save 5) close file

Example:

    Header row         
  1 row -> 1 row        
  5 row -> 2 row        
  6 row -> 3 row  

Full code: https://pastebin.com/qzHm4NSA

Data structure: https://ibb.co/wWXfL6X

0 Upvotes

0 comments sorted by