CSV (comma separated values) is a text-only spreadsheet format. Most database and spreadsheet programs can use them or create them.
We can load CSV into a DataFrame in Pandas using
We can display a DataFrame with a
For example: To read the CSV ‘sample.csv’ into a variable called df, we use the following code:
import pandas as pd df = pd.read_csv('sample.csv') print(df)
When we print DataFrame, we can see all rows of DataFrame.
We can also save data to a CSV, using