In this lesson, you’ll cover how to use pandas to write data to CSV files. Here is a code sample that demonstrates how to add a new employee to a CSV file from the previous lesson:
data_frame.loc['Cookie Cat'] = ['2016-07-04', 20000.0, 0]
data_frame.to_csv('hrdata.csv')
Take the Quiz: Test your knowledge with our interactive “Reading and Writing CSV Files in Python” quiz. You’ll receive a score upon completion to help you track your learning progress:
Interactive Quiz
Reading and Writing CSV Files in PythonThis quiz will check your understanding of what a CSV file is and the different ways to read and write to them in Python.
Congratulations, you made it to the end of the course! Make it stick: Mentor AI will check what you’ve got down, help you build something with it, and find your #1 takeaway to share in the discussion.
Or go straight to the discussion section and share your #1 takeaway and how you’ll put your new skills to use.
sroux53 on May 13, 2020
Excellent !