How to merge two pandas time series objects with different date time indices?

pra*_*kar 6 python pandas

I have two disjoint time series objects, for example

-ts1

 Date           Price
 2010-01-01     1800.0
 2010-01-04     1500.0
 2010-01-08     1600.0
 2010-01-09     1400.0
 Name: Price, dtype: float64
Run Code Online (Sandbox Code Playgroud)

-ts2

 Date           Price
 2010-01-02     2000.0
 2010-01-03     2200.0
 2010-01-05     2010.0
 2010-01-07     2100.0
 2010-01-10     2110.0
Run Code Online (Sandbox Code Playgroud)

How I could merge the two into a single time series that should be sorted on date? like

-ts3

 Date           Price
 2010-01-01     1800.0
 2010-01-02     2000.0
 2010-01-03     2200.0
 2010-01-04     1500.0
 2010-01-05     2010.0
 2010-01-07     2100.0
 2010-01-08     1600.0
 2010-01-09     1400.0
 2010-01-10     2110.0
Run Code Online (Sandbox Code Playgroud)

jez*_*ael 5

Use pandas.concat or DataFrame.append for join together and then DataFrame.sort_values by column Date, last for default indices DataFrame.reset_index with parameter drop=True:

df3 = pd.concat([df1, df2]).sort_values('Date').reset_index(drop=True)
Run Code Online (Sandbox Code Playgroud)

Alternative:

df3 = df1.append(df2).sort_values('Date').reset_index(drop=True)
Run Code Online (Sandbox Code Playgroud)
print (df3)
         Date   Price
0  2010-01-01  1800.0
1  2010-01-02  2000.0
2  2010-01-03  2200.0
3  2010-01-04  1500.0
4  2010-01-05  2010.0
5  2010-01-07  2100.0
6  2010-01-08  1600.0
7  2010-01-09  1400.0
8  2010-01-10  2110.0
Run Code Online (Sandbox Code Playgroud)

EDIT:

If TimeSeries then solution is simplify:

s3= pd.concat([s1, s2]).sort_index()
Run Code Online (Sandbox Code Playgroud)