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
In [17]: df = pd.DataFrame({'A': [1, 2, 3]})
In [18]: df
Out[18]:
A
0 1
1 2
2 3
In [19]: df.sort_values('A', ascending=False)
Out[19]:
A
2 3
1 2
0 1
In [20]: df.sort_values('A', ascending=False).reset_index(drop=True)
Out[20]:
A
0 3
1 2
2 1
might be nice from an API / consistency perspective to add a ignore_index=False|True keyword to .sort_values(), and .drop_duplicates() that does the reset in-line; this would give consistency similar to a pd.concat([......], ignore_index=True) operation which users are very familiar
The text was updated successfully, but these errors were encountered:
I see lots of code that goes like this
might be nice from an API / consistency perspective to add a
ignore_index=False|True
keyword to.sort_values()
, and.drop_duplicates()
that does the reset in-line; this would give consistency similar to apd.concat([......], ignore_index=True)
operation which users are very familiarThe text was updated successfully, but these errors were encountered: