python - Pandas row in df.iterrows() returns pandas series where as string was expected -
i iterating on 2 pandas dataframes in following way
for index1, row_ds1 in ds1.iterrows(): index2, row_ds2 in ds2.iterrows(): print([type(row_ds1['cola']), type(row_ds1['colb']),type( row_ds2['colx']), type(row_ds2['coly'])])
output
[<class 'str'>, <class 'pandas.core.series.series'>, <class 'pandas.core.series.series'>, <class 'pandas.core.series.series'>]
the first element of list string expected others pandas series , don't understand why returns pandas series. have studied , tried myself manually returns normal string when run on original dataset returns pandas series.
Comments
Post a Comment