Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion source/week-4/csv-files-jupyter/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# CSV Files and Jupyter Notebooks

CSV files are comma separated variable file. CSV files are frequently used to store data. In order to access the data in a CSV file from a Jupyter Notebook you must upload the file.
The so-called **CSV** (Comma Separated Values) format is the most common import and export format for spreadsheets and databases. The CSV format was used for many years prior to attempts to describe the format in a standardized way.

Python has an in-built csv module which implements classes to read and write tabular data in CSV format.

```python
# format example
>>> import csv
>>> with open('./airports.csv') as file:
... data = csv.reader(file)
... for row in data:
... print(*row) # * is used to unpack lists
Name City Country
Seattle-Tacoma Seattle USA
Dulles Washington USA
Heathrow London United Kingdom
Schiphol Amsterdam Netherlands
Changi Singapore Singapore
Pearson Toronto Canada
Narita Tokyo Japan
```

A this module has a lot more features, checkout [more details](https://docs.python.org/3/library/csv.html).

## Microsoft Learn Resources

Expand Down
Loading