Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python CSV

How to manipulate csv data for specific row using python

I want to manipulate specific data using csv, but I only know how to append a new row.

1 Answer

Hi Jun!

Not knowing the specifics of how you want to manipulate the rows, it's difficult for me to provide an example, but these should help get you started:

https://stackabuse.com/reading-and-writing-csv-files-in-python/

https://www.programiz.com/python-programming/csv

https://www.w3schools.com/python/python_file_handling.asp

https://www.tutorialsteacher.com/python/python-read-write-file

I hope that helps.

Stay safe and happy coding!

Thanks! What exactly I want to do is to allow users to update their phone number using python input. I need to replace the old phone number data in CSV with the input data