Skip to content

BUG: Multiplication of two serieses changes the the timezone from the given serieses #33671

Closed
@eyjay-ok

Description

@eyjay-ok

(since this is my first bug report I am happy for any feedback :) )

import pandas as pd

cet_idx = pd.date_range(start=pd.to_datetime('today').normalize(), periods=10, freq='15min', tz='CET')
utc_idx = cet_idx.tz_convert('utc')

cet_series = pd.Series(data=2, index=cet_idx)
utc_series = pd.Series(data=2, index=utc_idx)

print(cet_series.index.tz)
>> <DstTzInfo 'CET' CET+1:00:00 STD>

out_series = utc_series * cet_series   # The output is irrelevant 

print(cet_series.index.tz)
>> <UTC>

Problem description

The timezone of the series 'cet_series' changes by the multiplication. Since it is only an input series the timezone should stay the same.

Expected Output

... # the same initialization as above

print(cet_series.index.tz)
>> <DstTzInfo 'CET' CET+1:00:00 STD>

utc_series * cet_series   # The output is irrelevant 

print(cet_series.index.tz)
>> <DstTzInfo 'CET' CET+1:00:00 STD>

Output of pd.show_versions()

INSTALLED VERSIONS

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

pandas : 1.0.1
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.1
pip : 19.2.3
setuptools : 41.2.0
Cython : None
pytest : None
hypothesis : None
sphinx : 2.4.4
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.1
IPython : 7.13.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : 3.0.3
pandas_gbq : None
pyarrow : None
pytables : None
pytest : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : 1.3.13
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : None

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDatetimeDatetime data dtypeNumeric OperationsArithmetic, Comparison, and Logical operationsTimezonesTimezone data dtype

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions