Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
DatetimeIndex union fails in 0.19rc1 when constructed from differences in DatetimeIndexes #14323
Comments
jorisvandenbossche
added the
Regression
label
Sep 29, 2016
|
@Liam3851 Thanks for the report! I can confirm it is indeed a bug/regression. Seems it has something to do with
vs
|
jorisvandenbossche
added Bug Timeseries
labels
Sep 29, 2016
jorisvandenbossche
modified the milestone: 0.19.0, 0.19.1
Sep 29, 2016
Liam3851
commented
Oct 3, 2016
|
It looks to me like this was introduced with #13514.
Before, this code returned a new DatetimeIndex:
I'm not too familiar with this code, but it looks to me like _shallow_copy is copying all the attributes, including the freq (which is no longer valid after the differencing operation). The |
jreback
added Difficulty Intermediate Effort Low
labels
Oct 3, 2016
|
@Liam3851 I think that is a perfect assessment of the situation. We could use @sinhrks do you think of a generic approach without adding code to specifically invalidate the |
|
you can just pass freq=None to _shallow_copy |
|
Ah, I thought that would not work for PeriodIndex (which wants to keep its @Liam3851 Wants to do a PR for this change? |
Liam3851
commented
Oct 4, 2016
|
I'm doing a PR (sorry, still a newb at Git and pandas building). Just want to get the requirements straight for the unit tests:
That about right? |
Liam3851
referenced
this issue
Oct 4, 2016
Closed
BUG: GH14323 Union of differences from DatetimeIndex incorrect #14346
jreback
closed this
in bee90a7
Oct 24, 2016
jorisvandenbossche
added a commit
to jorisvandenbossche/pandas
that referenced
this issue
Nov 2, 2016
|
|
+ jorisvandenbossche |
6400cdd
|
amolkahat
added a commit
to amolkahat/pandas
that referenced
this issue
Nov 26, 2016
|
|
+ amolkahat |
3b71c0d
|
Liam3851 commentedSep 29, 2016
When constructing a union of 2 DatetimeIndex objects that themselves were constructed from differences from a third DatetimeIndex, the union operator is ignored. This appears to be new behavior in 0.19rc1; the code functioned correctly under 0.18.1.
Output of
pd.show_versions()commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 62 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.19.0rc1+0.g497a3bc.dirty
nose: 1.3.7
pip: 8.1.2
setuptools: 27.2.0
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.1
statsmodels: 0.6.1
xarray: 0.8.2
IPython: 5.1.0
sphinx: 1.4.6
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 1.1.0
tables: 3.2.2
numexpr: 2.6.1
matplotlib: 1.5.3
openpyxl: 2.3.2
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.3
lxml: 3.6.4
bs4: 4.5.1
html5lib: None
httplib2: 0.9.2
apiclient: 1.4.2
sqlalchemy: 1.0.13
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.42.0
pandas_datareader: 0.2.1