Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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