python - df.to_csv() giving *** TypeError: slice indices must be integers or None or have an __index__ method -
i above error when try df2.to_csv('abc.csv').
more details:
(pdb) type(df2) <class 'pandas.core.frame.dataframe'> (pdb) df2 0x01 0x03 0x07 0x0f 0x1f 0x3f 0x7f 0 2 nan nan nan nan nan nan 1 10 2 5 2 4 4 nan 2 26 4 17 16 25 10 1 3 12 11 25 13 31 21 7 4 10 37 24 22 18 37 33 5 10 39 23 21 13 15 27 6 22 7 5 11 5 3 23 7 8 nan nan 4 3 3 6 8 nan nan 1 11 1 7 3 [9 rows x 7 columns] (pdb) df2.to_csv('abc.csv') *** typeerror: slice indices must integers or none or have __index__ method (pdb)
i not slicing ... error makes no sense.
Comments
Post a Comment