Python Forum
importing CSV file into a OOP Class table using Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
importing CSV file into a OOP Class table using Python
#1
importing CSV file into a OOP Class table using Python . Help me ??
Reply
#2
(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]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Some help with my first python class and importing ....im making a lidar program jttolleson 7 1,199 Jul-28-2023, 08:34 AM
Last Post: jttolleson
  New2Python: Help with Importing/Mapping Image Src to Image Code in File CluelessITguy 0 720 Nov-17-2022, 04:46 PM
Last Post: CluelessITguy
  python standard way of importing library mg24 1 894 Nov-15-2022, 01:41 AM
Last Post: deanhystad
  My code displays too much output when importing class from a module lil_e 4 1,151 Oct-22-2022, 12:56 AM
Last Post: Larz60+
  Use module docx to get text from a file with a table Pedroski55 8 6,084 Aug-30-2022, 10:52 PM
Last Post: Pedroski55
  Problem with importing Python file in Visual Studio Code DXav 7 5,065 Jun-15-2022, 12:54 PM
Last Post: snippsat
  importing functions from a separate python file in a separate directory Scordomaniac 3 1,365 May-17-2022, 07:49 AM
Last Post: Pedroski55
  Importing a function from another file runs the old lines also dedesssse 6 2,541 Jul-06-2021, 07:04 PM
Last Post: deanhystad
  Importing issues with base class for inheritance riccardoob 5 4,670 May-19-2021, 05:18 PM
Last Post: snippsat
  Importing text file into excel spreadsheet with formatting david_dsmn 1 3,606 Apr-05-2021, 10:21 PM
Last Post: david_dsmn

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020