pandas: "Concatenation will no longer sort" wording is very inconsistent
The wording in the update docs is (emphasis added):
In a future version of pandas pandas.concat()
will no longer sort the non-concatenation axis when it is not already aligned. (…)
To keep the previous behavior (sorting) and silence the warning, pass sort=True
.
To accept the future behavior (no sorting), pass sort=False
https://pandas-docs.github.io/pandas-docs-travis/whatsnew.html#concatenation-will-no-longer-sort
But the wording in the FutureWarning
messages is (emphasis added):
Sorting because non-concatenation axis is not aligned. A future version of pandas will change to not sort by default.
To accept the future behavior, pass sort=True
.
To retain the current behavior and silence the warning, pass sort=False
It needs to be clearer that current default is still sort=True
but will revert to sort=False
in a future version.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (7 by maintainers)
Commits related to this issue
- default value for sort added to concatenation: https://github.com/pandas-dev/pandas/issues/21112 — committed to b3by/antools by b3by 6 years ago
Ok, I found it. It actually was an append command (not concat or merge). Adding the sort parameter did remove the warning. I added the sort=False parameter to this:
df_B = df_A.append(df_B, verify_integrity=True, sort=False).copy()
also: Currently the warning doesn’t get silenced if you pass “sort=False” (i.e. the true future default behavior)–presumably there should be no warning as long as the sort parameter is explicitly set (passed).
You can make warnings raise. Something like
On Mon, May 21, 2018 at 2:06 PM, techvslife notifications@github.com wrote: