DataFrame.from_dict(OrderedDict(items),...) not a proper replacement for from_items(items,...) #22705
Labels
Constructors
Series/DataFrame/Index/pd.array Constructors
Error Reporting
Incorrect or improved errors from pandas
Uh oh!
There was an error while loading. Please reload this page.
Code Sample
Problem description
The deprecation warning in 0.23.4 indicates that
from_items(items,...)
should be changed tofrom_dict(OrderedDict(items)...
. But that doesn't work in cases where there would be duplicates in the index. The above is a test that would fail.This would make it burdensome for developers to test all the scenarios in which they have used
from_items()
to change them tofrom_dict
.It might be worth noting that the
columns
parameter was not allowed onfrom_dict()
prior to 0.23, and that would further complicate adapting code away fromfrom_items()
.I recommend against this deprecation.
Expected Output
The above test would be expected to succeed.
Output of
pd.show_versions()
pandas: 0.23.4
pytest: 3.8.0
pip: 18.0
setuptools: 40.2.0
Cython: 0.28.5
numpy: 1.14.5
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.5.0
sphinx: None
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: None
tables: 3.4.4
numexpr: 2.6.8
feather: None
matplotlib: 2.2.3
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 1.0.1
sqlalchemy: 1.2.11
pymysql: 0.9.2
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: