Skip to content

BUG: Setting Timestamp with timezone with .at raises TypeError #25506

Closed
@int8

Description

@int8

Code Sample, a copy-pastable example if possible

import pytz 
import pandas 

series = pd.Series(pd.Timestamp('2017-08-05 00:00:00+0100', tz=pytz.FixedOffset(60)))
series.at[1] = pd.Timestamp('2017-08-05 00:00:00+0100', tz=pytz.FixedOffset(60))

# this produces 
TypeError: Argument 'arr' has incorrect type (expected numpy.ndarray, got DatetimeArray)

Problem description

I would expect to be able to operate on a series of timestamps

Expected Output

no error

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.6.7.final.0
python-bits: 64
OS: Linux
OS-release: 4.15.0-45-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.23.4
pytest: 4.1.1
pip: 18.1
setuptools: 40.6.3
Cython: None
numpy: 1.16.0
scipy: 1.2.0
pyarrow: None
xarray: 0.11.3
IPython: 7.2.0
sphinx: None
patsy: None
dateutil: 2.7.5
pytz: 2018.9
blosc: None
bottleneck: None
tables: 3.4.4
numexpr: 2.6.9
feather: None
matplotlib: 3.0.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: 1.2.16
pymysql: None
psycopg2: 2.7.6.1 (dt dec pq3 ext lo64)
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: 0.9.0
pandas_datareader: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    IndexingRelated to indexing on series/frames, not to indexes themselvesTimezonesTimezone data dtype

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions