We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Except when one of the two series is empty; in that case a tz-aware Series is returned
Code to reproduce:
import numpy as np import pandas as pd rng1 = pd.date_range('1/1/2011 01:00', periods=1, freq='H') rng2 = pd.date_range('1/1/2011 02:00', periods=1, freq='H') ts1 = pd.Series(np.random.randn(len(rng1)), index=rng1).tz_localize('UTC') ts2 = pd.Series(np.random.randn(len(rng2)), index=rng2).tz_localize('UTC') ts_result = ts1.append(ts2)
Result in IPython:
In [1]: import numpy as np
In [2]: import pandas as pd
In [3]: rng1 = pd.date_range('1/1/2011 01:00', periods=1, freq='H')
In [4]: rng2 = pd.date_range('1/1/2011 02:00', periods=1, freq='H')
In [5]: ts1 = pd.Series(np.random.randn(len(rng1)), index=rng1).tz_localize('UTC')
In [6]: ts1 Out[6]: 2011-01-01 01:00:00+00:00 1.870471 Freq: H
In [7]: ts2 = pd.Series(np.random.randn(len(rng2)), index=rng2).tz_localize('UTC')
In [8]: ts2 Out[8]: 2011-01-01 02:00:00+00:00 1.266536 Freq: H
In [9]: ts_result = ts1.append(ts2)
In [10]: ts_result Out[10]: 2011-01-01 01:00:00 1.870471 2011-01-01 02:00:00 1.266536
The text was updated successfully, but these errors were encountered:
BUG: DatetimeIndex.append does not preserve timezone #2260
5f51c80
No branches or pull requests
Except when one of the two series is empty; in that case a tz-aware Series is returned
Code to reproduce:
import numpy as np
import pandas as pd
rng1 = pd.date_range('1/1/2011 01:00', periods=1, freq='H')
rng2 = pd.date_range('1/1/2011 02:00', periods=1, freq='H')
ts1 = pd.Series(np.random.randn(len(rng1)), index=rng1).tz_localize('UTC')
ts2 = pd.Series(np.random.randn(len(rng2)), index=rng2).tz_localize('UTC')
ts_result = ts1.append(ts2)
Result in IPython:
In [1]: import numpy as np
In [2]: import pandas as pd
In [3]: rng1 = pd.date_range('1/1/2011 01:00', periods=1, freq='H')
In [4]: rng2 = pd.date_range('1/1/2011 02:00', periods=1, freq='H')
In [5]: ts1 = pd.Series(np.random.randn(len(rng1)), index=rng1).tz_localize('UTC')
In [6]: ts1
Out[6]:
2011-01-01 01:00:00+00:00 1.870471
Freq: H
In [7]: ts2 = pd.Series(np.random.randn(len(rng2)), index=rng2).tz_localize('UTC')
In [8]: ts2
Out[8]:
2011-01-01 02:00:00+00:00 1.266536
Freq: H
In [9]: ts_result = ts1.append(ts2)
In [10]: ts_result
Out[10]:
2011-01-01 01:00:00 1.870471
2011-01-01 02:00:00 1.266536
The text was updated successfully, but these errors were encountered: