You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Pandas 0.24 the DateOffset objects are immutable. Previously it was possible to change the normalize property after receiving an object from to_offset(), but now there doesn't seem to be any mechanism for doing this. While it seems possible to create a new instance of DateOffset with normalize = True, the type of the object changes and doesn't work correctly.
What is the best way of getting an object from to_offset() with normalize set to True? From an end-user perspective, the best solution would probably be to add a normalize attribute to the function, like so:
defto_offset(freq, normalize=False):
Output of pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.3.final.0
python-bits : 64
OS : Darwin
OS-release : 18.6.0
machine : x86_64
processor : i386
byteorder : little
LC_ALL : en_US.UTF-8
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
Code Sample, a copy-pastable example if possible
Yields
Problem description
Since Pandas
0.24
theDateOffset
objects are immutable. Previously it was possible to change thenormalize
property after receiving an object fromto_offset()
, but now there doesn't seem to be any mechanism for doing this. While it seems possible to create a new instance ofDateOffset
withnormalize = True
, the type of the object changes and doesn't work correctly.What is the best way of getting an object from
to_offset()
withnormalize
set toTrue
? From an end-user perspective, the best solution would probably be to add a normalize attribute to the function, like so:Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.3.final.0
python-bits : 64
OS : Darwin
OS-release : 18.6.0
machine : x86_64
processor : i386
byteorder : little
LC_ALL : en_US.UTF-8
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 0.25.0
numpy : 1.17.0
pytz : 2019.2
dateutil : 2.8.0
pip : 19.2.1
setuptools : 41.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: