0

So i got 2 pandas.core.frame.DataFrame like this:

anomalies:

             Sales  outlet
Date                     
2006-07-01    700       2

and this (anomalies2):

            Sales  outlet
Date                     
2011-03-01    206       1
2012-03-01    900       1

i tried combining them using :

anomalies3 = []
anomalies3.append(anomalies)
anomalies3.append(anomalies2)
print(anomalies3)

but the result are like this:

[            Sales  outlet
Date                     
2006-07-01    700       2,             Sales  outlet
Date                     
2011-03-01    206       1
2012-03-01    900       1]

how do i make it so the result were like

[            Sales  outlet
Date                     
2006-07-01    700       2                    
2011-03-01    206       1
2012-03-01    900       1]

Thanks in advance! and remember both are pandas.core.frame.DataFrame (type(anomalies) and type(anomalies2) give back pandas.core.frame.DataFrame)

Srome
  • 23
  • 4
  • I have some difficulties to "see" the list structure in both anomalies(2). Are they the outout of pandas.DataFrame? – cards Apr 29 '22 at 08:22
  • sorry @cards, after i restart the kernel and try running all again, now it shows as pandas.core.frame.DataFrame and not list again – Srome Apr 29 '22 at 08:30
  • You can use `concat` https://pandas.pydata.org/docs/reference/api/pandas.concat.html – Michał Apr 29 '22 at 08:31

1 Answers1

0

just use

anomalies3 = pd.concat([anomalies, anomalies2])

Srome
  • 23
  • 4