python - append two data frame with pandas -
when try merge 2 dataframes rows doing:
bigdata = data1.append(data2)
i following error:
exception: index cannot contain duplicate values!
the index of first data frame starts 0 38 , second 1 0 48. didn't understand have modify index of 1 of data frame before merging, don't know how to.
thank you.
these 2 dataframes:
data1
:
meta particle ratio area type 0 2 part10 1.348 0.8365 touching 1 2 part18 1.558 0.8244 single 2 2 part2 1.893 0.894 single 3 2 part37 0.6695 1.005 single ....clip... 36 2 part23 1.051 0.8781 single 37 2 part3 80.54 0.9714 nuclei 38 2 part34 1.071 0.9337 single
data2
:
meta particle ratio area type 0 3 part10 0.4756 1.025 single 1 3 part18 0.04387 1.232 dusts 2 3 part2 1.132 0.8927 single ...clip... 46 3 part46 13.71 1.001 nuclei 47 3 part3 0.7439 0.9038 single 48 3 part34 0.4349 0.9956 single
the first column index
the append
function has optional argument ignore_index
should use here join records together, since index isn't meaningful application.
Comments
Post a Comment