-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
BugReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, ExplodeTimezonesTimezone data dtypeTimezone data dtype
Milestone
Description
Issue:
import pandas as pd from datetime import datetime ### Concat'ing two UTC times works first = pd.DataFrame([[datetime(2016, 1, 1)]]) first[0] = first[0].dt.tz_localize('UTC') second = pd.DataFrame([[datetime(2016, 1, 2)]]) second[0] = second[0].dt.tz_localize('UTC') print pd.concat([first, second]) # Works ### Concat'ing two London times doesn't work first = pd.DataFrame([[datetime(2016, 1, 1)]]) first[0] = first[0].dt.tz_localize('Europe/London') second = pd.DataFrame([[datetime(2016, 1, 2)]]) second[0] = second[0].dt.tz_localize('Europe/London') print pd.concat([first, second]) # Doesn't work - returns a DF full of NaTs ### Concat'ing 2+1 London times works first = pd.DataFrame([[datetime(2016, 1, 1)], [datetime(2016, 1, 2)]]) first[0] = first[0].dt.tz_localize('Europe/London') second = pd.DataFrame([[datetime(2016, 1, 3)]]) second[0] = second[0].dt.tz_localize('Europe/London') print pd.concat([first, second]) # Works ### Concat'ing 1+2 London times doesn't work first = pd.DataFrame([[datetime(2016, 1, 1)]]) first[0] = first[0].dt.tz_localize('Europe/London') second = pd.DataFrame([[datetime(2016, 1, 2)], [datetime(2016, 1, 3)]]) second[0] = second[0].dt.tz_localize('Europe/London') print pd.concat([first, second]) # Doesn't work - first row is NaTDependencies:
INSTALLED VERSIONS ------------------ commit: None python: 2.7.11.final.0 python-bits: 64 OS: Linux OS-release: 3.17.7-300.fc21.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_GB.UTF-8 pandas: 0.17.1 nose: None pip: 8.0.2 setuptools: 19.4 Cython: None numpy: 1.10.2 scipy: 0.16.0 statsmodels: None IPython: 4.0.1 sphinx: 1.3.1 patsy: None dateutil: 2.4.2 pytz: 2015.7 blosc: None bottleneck: None tables: None numexpr: 2.4.4 matplotlib: 1.5.0 openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: 3.5.0 bs4: 4.4.1 html5lib: None httplib2: None apiclient: None sqlalchemy: None pymysql: None psycopg2: None Jinja2: None Metadata
Metadata
Assignees
Labels
BugReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, ExplodeTimezonesTimezone data dtypeTimezone data dtype