-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: dataframe constructor should preserve order with standard Python dicts #38033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
would doing dict(orderedDict()) work? |
Is the current behavior correct and this just needs tests, or is there a bug when using dict instead of OrderedDict? |
I think the current behavior is correct so just need tests. I didn't find open issues in the tracker since the OrderedDict ticket was closed four years ago.
I was thinking of parametrizing the tests on @pytest.mark.parametrize("dictionary, (dict, OrderedDict)")
def test_foo(dictionary):
... |
wouldnt @parametrized("dictionary, (dict, OrderedDict)") do the same thing |
However you wanna do it yeah |
…with standard Python dicts (pandas-dev#38033)
I don't know where to start contributing, can anyone guide me on how to contribute |
We have a couple of dataframe tests (xref #13304) related to column ordering when constructed from an
OrderedDict
:pandas/pandas/tests/frame/test_constructors.py
Lines 1250 to 1288 in e4cf3ab
As of PEP 468 standard dictionaries are ordered so these tests should also work with
OrderedDict
replaced bydict
The text was updated successfully, but these errors were encountered: