9951 explained code solutions for 126 technologies


python-pandasHow to load data frame from CSV


import pandas as pd

f = open('/var/www/examples/file.csv')
data = pd.read_csv(f)ctrl + c
import pandas as pd

load Pandas module

open(

opens specified file for reading

/var/www/examples/file.csv

path to CSV file to read

pd.read_csv(

loads data frame from specified CSV file

data

will contain loaded DataFrame