Skip to content
New issue

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

BUG: False Timestamp returned #15823

Closed
erms77 opened this issue Mar 28, 2017 · 1 comment
Closed

BUG: False Timestamp returned #15823

erms77 opened this issue Mar 28, 2017 · 1 comment
Labels
Duplicate Report Duplicate issue or pull request Timezones Timezone data dtype

Comments

@erms77
Copy link

erms77 commented Mar 28, 2017

Code Sample, a copy-pastable example if possible

In [3]: pd.Timestamp('2017-03-26 00:00', tz='Europe/Paris')
Out[3]: Timestamp('2017-03-26 00:00:00+0100', tz='Europe/Paris')

In [4]: pd.Timestamp('2017-03-26 01:00', tz='Europe/Paris')
Out[4]: Timestamp('2017-03-26 00:00:00+0100', tz='Europe/Paris')

In [5]: pd.Timestamp('2017-03-26 02:00', tz='Europe/Paris')
Out[5]: Timestamp('2017-03-26 01:00:00+0100', tz='Europe/Paris')

In [6]: pd.Timestamp('2017-03-26 03:00', tz='Europe/Paris')
Out[6]: Timestamp('2017-03-26 03:00:00+0200', tz='Europe/Paris')

Problem description

The timestamp returned are wrong

Expected Output

In [3]: pd.Timestamp('2017-03-26 00:00', tz='Europe/Paris')
Out[3]: Timestamp('2017-03-26 00:00:00+0100', tz='Europe/Paris')

In [4]: pd.Timestamp('2017-03-26 01:00', tz='Europe/Paris')
Out[4]: Timestamp('2017-03-26 01:00:00+0100', tz='Europe/Paris')

In [5]: pd.Timestamp('2017-03-26 02:00', tz='Europe/Paris')
Out[5]: Timestamp('2017-03-26 02:00:00+0100', tz='Europe/Paris')

In [6]: pd.Timestamp('2017-03-26 03:00', tz='Europe/Paris')
Out[6]: Timestamp('2017-03-26 03:00:00+0200', tz='Europe/Paris')

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.0.final.0 python-bits: 64 OS: Linux OS-release: 4.8.0-42-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8

pandas: 0.19.2
nose: 1.3.7
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.25.2
numpy: 1.11.3
scipy: 0.18.1
statsmodels: 0.6.1
xarray: None
IPython: 5.1.0
sphinx: 1.5.1
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.2.0
tables: 3.3.0
numexpr: 2.6.1
matplotlib: 2.0.0
openpyxl: 2.4.1
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: 3.7.2
bs4: 4.5.3
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.1.5
pymysql: None
psycopg2: None
jinja2: 2.9.4
boto: 2.45.0
pandas_datareader: None

@jreback
Copy link
Contributor

jreback commented Mar 28, 2017

this is the same as #15777 and linked issues.

However, you should really localize these times.

In [9]: pd.Timestamp('2017-03-26 01:00').tz_localize('Europe/Paris')
Out[9]: Timestamp('2017-03-26 01:00:00+0100', tz='Europe/Paris')

In [10]: pd.Timestamp('2017-03-26 03:00').tz_localize('Europe/Paris')
Out[10]: Timestamp('2017-03-26 03:00:00+0200', tz='Europe/Paris')

note that [5] is not valid

In [19]: pd.Timestamp('2017-03-26 02:00').tz_localize('Europe/Paris')
NonExistentTimeError: 2017-03-26 02:00:00

@jreback jreback closed this as completed Mar 28, 2017
@jreback jreback added Duplicate Report Duplicate issue or pull request Timezones Timezone data dtype labels Mar 28, 2017
@jreback jreback added this to the No action milestone Mar 28, 2017
jreback added a commit to mroeschke/pandas that referenced this issue Apr 8, 2017
jreback pushed a commit that referenced this issue Apr 8, 2017
* BUG: Timestamp doesn't respect tz DST

closes #11481
closes #15777

* DOC: add doc-strings to tz_convert/tz_localize in tslib.pyx
TST: more tests, xref #15823, xref #11708
gfyoung added a commit to forking-repos/pandas that referenced this issue Jun 8, 2018
gfyoung added a commit to forking-repos/pandas that referenced this issue Jun 11, 2018
jreback pushed a commit that referenced this issue Jun 12, 2018
* MAINT: More useful error msg on Index overflow

Display a more friendly error message when there
is an OverflowError during Index construction.

Partially addresses gh-15832.

* DOC: Clarify how Index.__new__ handles dtype

Partially addresses gh-15823.
david-liu-brattle-1 pushed a commit to david-liu-brattle-1/pandas that referenced this issue Jun 18, 2018
* MAINT: More useful error msg on Index overflow

Display a more friendly error message when there
is an OverflowError during Index construction.

Partially addresses pandas-devgh-15832.

* DOC: Clarify how Index.__new__ handles dtype

Partially addresses pandas-devgh-15823.
jorisvandenbossche pushed a commit that referenced this issue Jun 29, 2018
* MAINT: More useful error msg on Index overflow

Display a more friendly error message when there
is an OverflowError during Index construction.

Partially addresses gh-15832.

* DOC: Clarify how Index.__new__ handles dtype

Partially addresses gh-15823.

(cherry picked from commit defdb34)
jorisvandenbossche pushed a commit that referenced this issue Jul 2, 2018
* MAINT: More useful error msg on Index overflow

Display a more friendly error message when there
is an OverflowError during Index construction.

Partially addresses gh-15832.

* DOC: Clarify how Index.__new__ handles dtype

Partially addresses gh-15823.

(cherry picked from commit defdb34)
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this issue Oct 1, 2018
* MAINT: More useful error msg on Index overflow

Display a more friendly error message when there
is an OverflowError during Index construction.

Partially addresses pandas-devgh-15832.

* DOC: Clarify how Index.__new__ handles dtype

Partially addresses pandas-devgh-15823.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request Timezones Timezone data dtype
Projects
None yet
Development

No branches or pull requests

2 participants