Python Forum

Full Version: Assigning data read from CSV to class
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello friends . How can I use the data I read from CSV with the help of classes? Can you help?
@faruk61,
Your question is way too generic, do you have a class which you want to use to read the csv ? Why do you want to use classes in the first place ?

import pandas as pd 
df = pd.read_csv(filepath) # where filepath represents the location of your csv file 

You can simply use pandas to read it as shown above
Do you want to instantiate objects using data from the file?