question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Concatenation will no longer sort" wording is very inconsistent

See original GitHub issue

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

https://github.com/pandas-dev/pandas/blob/c4da79b5b322c73d8e61d1cb98ac4ab1e2438b40/pandas/core/indexes/api.py

It needs to be clearer that current default is still sort=True but will revert to sort=False in a future version.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
techvslifecommented, May 23, 2018

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()

3reactions
techvslifecommented, May 21, 2018

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with concatenated data...won't sort - Excel Help Forum
I have two columns of numbers (A and B). Each column is in text format. I inserted another column (C) and, in it,...
Read more >
Why does the concatenation order change with a User ...
The order changes because the order of the tables involved in the cross join has changed. In one plan @ValueTable is the outer...
Read more >
tsql - Concatenating SQL Server VARCHAR(N), results with ...
From your answers it seems that SQL Server string concatenation operator (+) simply does not implicitly convert [n]varchar(n) -> [n]varchar(max) ...
Read more >
Dimensions of matrices being concatenated are not consistent.
g = readmatrix('Data2.txt'); %A much more meaningfull variable name than g would be a very good idea!
Read more >
Breaking change in v4.4: Aggregate with Concatenate and ...
Such behavior was inconsistent and sometimes required additional sorting prior to aggregation. The new version changes the concatenation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found