Reindexing only valid with uniquely valued Index objects using pd.concat()

Viewed 34
fake_a = pd.DataFrame(5, index=range(387), columns=range(299))
fake_b = pd.DataFrame(1, index=range(53), columns=range(299))
sp1 = pd.concat([fake_a,fake_b],axis=0)

fake_e = pd.DataFrame(5, index=range(299), columns=range(88))
fake_f = pd.DataFrame(1, index=range(88), columns=range(88))
fake_g = pd.DataFrame(5, index=range(53), columns=range(88))
sp2 = pd.concat([fake_e,fake_f,fake_g],axis=0)

fake_c = pd.DataFrame(5, index=range(141), columns=range(53))
fake_d = pd.DataFrame(1, index=range(299), columns=range(53))
sp3 = pd.concat([fake_d,fake_c],axis=0)

pd.concat([sp1,sp2,sp3],axis=1) 

I want to create a dataframe out of three big columns(sp1, sp2, sp3) but if i do so I get the error message Reindexing only valid with uniquely valued Index objects. Creating sp1, sp2 and sp3 seem to work fine, only concatenating those tree to one big dataframe is not working. Thanks for any help! Final shape is supposed to be 440x440

0 Answers
Related