(Apr-15-2020, 09:11 AM)faruk61 Wrote: importing CSV file into a OOP Class table using Python . Help me ??
import pandas as pd
class Ogrenciler():
def __init__(self , OgrNo=None , Ad =None , Soyad =None , Vize1 =None , Vize2 =None , Final =None ):
self.OgrNo=OgrNo
self.Ad=Ad
self.Soyad = Soyad
self.Vize1 = Vize1
self.Vize2 = Vize2
self.Final = Final
csvVeri = pd.read_csv("Ogrenciler.csv")
for satir in csvVeri:
Ogrenci=Ogrenciler()
sutun=satir.split(',')
Ogrenci.OgrNo=sutun[0]
Ogrenci.OgrNo=sutun[1]
Ogrenci.OgrNo=sutun[2]
Ogrenci.OgrNo=sutun[3]
Ogrenci.OgrNo=sutun[4]
Ogrenci.OgrNo=sutun[5]