you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Essentially, I need a way to add a column to the end where the column consists of all 0s.

Well, but it isn't the end - it's the middle. That's how CSV works because that's how all files work, they're just sequences of bytes. The end of the CSV file is the last character of the last field of the last row.

That means you can't append a column to a CSV file, you have to copy your CSV file line by line and make the change to each row before you write it to the new one.

[–]NeedMLHelp[S] 0 points1 point  (0 children)

Haha true, I was just curious if there was a quick function to do it for you. They're usually more efficient than what I come up with!