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
According to the 0.23.0 What's New, we should be using the sort parameter to specify sorting behavior for pandas.concat. The documentation says:
To keep the previous behavior (sorting) and silence the warning, pass sort=True
As you can see from this example, passing sort=True does not always maintain the current behavior of pandas.concat. Intuitively, what's returned when sort=True is passed makes sense (the columns are sorted), but this is not the behavior in v0.23.0 without sort nor the behavior in v0.22.0.
Expected Output
In v0.23.0 the output of pandas.concat should not be different from calls with sort=None and sort=True.
The warning message only shows when the old implementation would have triggered a sort, i.e. when the non-concatenation axis is not already aligned. The warning message and the whatsnew should all be read in that context.
The old behavior of sorting if and only if the non-concatenation axis is not already aligned isn't very useful IMO. Do you have a use case where it was useful?
Ah okay. We started to see the warning in our logs, so I added sort everywhere because I misinterpreted the What's New.
I agree that the sorting behavior is not useful, I was just taking the approach of trying to silence the warnings without changing any behavior of our code. Thanks for the clarification!
Code Sample, a copy-pastable example if possible
Problem description
According to the 0.23.0 What's New, we should be using the
sort
parameter to specify sorting behavior forpandas.concat
. The documentation says:As you can see from this example, passing
sort=True
does not always maintain the current behavior ofpandas.concat
. Intuitively, what's returned whensort=True
is passed makes sense (the columns are sorted), but this is not the behavior in v0.23.0 withoutsort
nor the behavior in v0.22.0.Expected Output
In v0.23.0 the output of
pandas.concat
should not be different from calls withsort=None
andsort=True
.Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Darwin
OS-release: 17.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.23.0
pytest: 3.5.1
pip: 9.0.1
setuptools: 39.2.0
Cython: None
numpy: 1.14.3
scipy: 0.19.1
pyarrow: None
xarray: None
IPython: 6.4.0
sphinx: None
patsy: None
dateutil: 2.7.3
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.2.2
openpyxl: None
xlrd: 1.1.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.6.0
html5lib: 1.0.1
sqlalchemy: 1.2.7
pymysql: 0.8.1
psycopg2: 2.7.3 (dt dec pq3 ext lo64)
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: