0
print(f"df_shape {df.shape}")
 (3497, 39)

But, I see row above 30 thousand getting imported in to database.

for index, row in df.iterrows():
    cursor.execute('INSERT INTO tbl_A(Sno,A,B) \
     values(?,?,?,)', \
         row.Sno, row.A, row.B)
cnxn.commit()
cursor.close()
vinsent paramanantham
  • 953
  • 3
  • 15
  • 34

1 Answers1

0

Similar approached solved the issue, df = df.loc[~df.index.duplicated()]

Pandas `groupby.aggregate` on `df.index.duplicated()` duplicate removal Pandas concat: ValueError: Shape of passed values is blah, indices imply blah2

vinsent paramanantham
  • 953
  • 3
  • 15
  • 34