Bug using fillna after resample. #16566
Labels
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
Duplicate Report
Duplicate issue or pull request
Resample
resample method
Milestone
Code Sample, a copy-pastable example if possible
Problem description
fillna
doesn't work as expected for some strange reason here. Multiplying by1
seems "fix"things:but using
astype
does notunless using a mapping
isnull
gives the expected output:Constructing a the data frame directly gives the expected output:
Expected Output
df = pd.DataFrame([[1], [2]], DatetimeIndex(['20170101', '20170103']))
df.resample('D').last().fillna(0)
0
2017-01-01 1.0
2017-01-02 0.0
2017-01-03 2.0
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 3.10.0-327.el7.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: en_GB.UTF-8
pandas: 0.20.1
pytest: 3.0.3
pip: 8.1.2
setuptools: 27.2.0
Cython: None
numpy: 1.12.1
scipy: 0.19.0
xarray: None
IPython: 5.1.0
sphinx: None
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: None
tables: 3.3.0
numexpr: 2.6.2
feather: None
matplotlib: 2.0.0
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: 1.0.13
pymysql: 0.7.6.None
psycopg2: None
jinja2: 2.8
s3fs: None
pandas_gbq: None
pandas_datareader: 0.2.1
The text was updated successfully, but these errors were encountered: