from pandas import read_csv code example
Example 1: how to import csv in pandas
import pandas as pd
df = pd.read_csv (r'Path where the CSV file is stored\File name.csv')
print (df)
Example 2: pandas read csv
import pandas as pd
cereal_df = pd.read_csv("/tmp/tmp07wuam09/data/cereal.csv")
cereal_df2 = pd.read_csv("data/cereal.csv")
print(pd.DataFrame.equals(cereal_df, cereal_df2))
Example 3: pandas go through csv file
data = pd.read_csv(
"data/files/complex_data_example.tsv",
sep='\t'
quotechar="'",
dtype={"salary": int},
usecols=['name', 'birth_date', 'salary'].
parse_dates=['birth_date'],
skiprows=10,
na_values=['.', '??']
)
Example 4: pandas read csv python
pd.read_csv('data.csv')
Example 5: pandas how to read csv
pandas.read_csv("file.csv")