UDST / choicemodels

Python library for discrete choice modeling
https://udst.github.io/choicemodels
BSD 3-Clause "New" or "Revised" License
74 stars 33 forks source link

Test failing due to unsorted list of values #33

Closed gboeing closed 6 years ago

gboeing commented 6 years ago

One of the test_interaction.py tests is failing due to assert equivalence between unsorted lists of values that do not appear in the same order. PR forthcoming.

gboeing commented 6 years ago

Fixed by PR #34

smmaurer commented 6 years ago

Nice. It looks like this came up because now that dictionary keys are ordered in Python 3.6, Pandas is retaining the key order (rather than sorting columns alphabetically) when DataFrames are created from a dictionary. Hopefully this won't cause any actual errors, but we should keep an eye out..

Pandas documentation:

Note: When the data is a dict, and columns is not specified, the DataFrame columns will be ordered by the dict’s insertion order, if you are using Python version >= 3.6 and Pandas >= 0.23.

If you are using Python < 3.6 or Pandas < 0.23, and columns is not specified, the DataFrame columns will be the lexically ordered list of dict keys.

https://pandas.pydata.org/pandas-docs/stable/dsintro.html