I am trying to convert a csv file data into a sql table and to do that i am taking input of the file from the user.
fileinput = input("Which file do you want:")
data=pd.read_csv(fileinput)
df=pd.DataFrame(data)
for row in df.itertuples():
cursor.execute('''INSERT INTO xiib(Rollno,Name,Physics,Chemistry,Maths,Computer_Sci,English,Physical_edu)
VALUES (?,?,?,?,?,?,?,?)
''',
row.Rollno,
row.Name,
row.Physics,
row.Chemistry,
row.Maths,
row.Computer_Sci,
row.English,
row.Physical_edu
)
mycon.commit()
the error: OSError: [Errno 22] Invalid argument:
the output is showing invalid argument and i have tried using r: for string but isn't helping either the other error is AttributeError: 'Pandas' object has no attribute 'Physics', I don't understand thsi one either as the values before this don't raise any error