A CSV (Comma Separated Values) file is a file with values seperated by a comma. Its often used to import and export with databases and spreadsheets.
Values are mostly seperated by comma. Sometimes another character is used like a semicolon, the seperation character is called a delimiter.
Data Analysis with Pandas and Python
Pandas is a data analysis library. If you work with data a lot, using pandas is way better.
Lets say you have a csv file containing nation statistics:
We can read a csv with the lines:
Pandas works with dataframes which hold all data. Thats why we can use the rows like df[‘name’].
If you don’t want to use pandas, you can use the csv module to read csv files.
This is as simple as:
We can access individual cells like so: