The order of columns coming out of .assign
is hard to predict
In [1]: import pandas as pd In [2]: df = pd.DataFrame({'a': [1], 'b': [2]}) In [3]: df Out[3]: a b 0 1 2 In [4]: df.assign(d=df.a*10, a=df.b*10, e=df.a*20) Out[4]: a b e d 0 20 2 20 10
Would it be reasonable to keep all existing keys in their current location and then add the remaining keys in sorted order at the end?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4