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
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
importpandasaspd# this example works correctly, showing that the bug is not on all dtypesdf=pd.DataFrame([[1,2], [3, 4]], index=list('ab'), columns=list('qw'), dtype='int64')
df.reindex(index=list('abcd'), columns=list('qwer'), fill_value=10)
# this example has the bugdf=pd.DataFrame([[1,2], [3, 4]], index=list('ab'), columns=list('qw'), dtype='uint8')
df.reindex(index=list('abcd'), columns=list('qwer'), fill_value=10)
# this example works correctly, showing that it is only a bug when both index and columns are specifieddf=pd.DataFrame([[1,2], [3, 4]], index=list('ab'), columns=list('qw'), dtype='uint8')
df.reindex(index=list('abcd'), fill_value=10).reindex(columns=list('qwer'), fill_value=10)
Issue Description
When using the fill_value option in the reindex method, when both index and columns are specified and the dtype is uint8 (note I did not try to find all dtypes that have this error), the NaNs are not being replaced by the fill_value, instead they are broadcasting the last item in the dataframe.
Default case that works as expected when using dtype='int64'
The bug when using dtype='uint8' and how the bug goes away when not passing in the index and columns at the same time.
phofl
added
Indexing
Related to indexing on series/frames, not to indexes themselves
and removed
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
Aug 20, 2022
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When using the fill_value option in the reindex method, when both index and columns are specified and the dtype is
uint8
(note I did not try to find all dtypes that have this error), the NaNs are not being replaced by the fill_value, instead they are broadcasting the last item in the dataframe.Default case that works as expected when using

dtype='int64'
The bug when using

dtype='uint8'
and how the bug goes away when not passing in the index and columns at the same time.Expected Behavior
Installed Versions
INSTALLED VERSIONS
commit : e8093ba
python : 3.9.12.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19044
machine : AMD64
processor : Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_Canada.1252
pandas : 1.4.3
numpy : 1.23.1
pytz : 2022.1
dateutil : 2.8.2
setuptools : 61.2.0
pip : 22.1.2
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 : 1.3.5
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
markupsafe : None
matplotlib : None
numba : None
numexpr : 2.8.3
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
The text was updated successfully, but these errors were encountered: