Skip to content

.transform not respecting axis=1 in combine stage of group-apply-combine #13103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
erbian opened this issue May 6, 2016 · 1 comment
Closed

Comments

@erbian
Copy link
Contributor

erbian commented May 6, 2016

.transform does not appear to be respecting the axis argument of the groupby in the combine stage. The code below yields:
ValueError: Length mismatch: Expected axis has 4 elements, new values have 5 elements

#### Code Sample, a copy-pastable example if possible
import pandas as pd
df = pd.DataFrame(pd.np.arange(20).reshape(4,5))
df.groupby(lambda x: x <= 3, axis=1).transform(lambda x: x)

#### Expected Output
    0   1   2   3   4
0   0   1   2   3   4
1   5   6   7   8   9
2  10  11  12  13  14
3  15  16  17  18  19

#### output of ``pd.show_versions()``
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-74-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.17.1
nose: 1.3.7
pip: 1.5.4
setuptools: 20.1.1
Cython: None
numpy: 1.11.0
scipy: 0.17.0
statsmodels: 0.6.1
IPython: 4.1.1
sphinx: None
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: 1.0.0
tables: None
numexpr: 2.5
matplotlib: 1.5.1
openpyxl: 2.3.3
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: None
lxml: 3.5.0
bs4: None
html5lib: 0.999
httplib2: 0.9.2
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
Jinja2: None
@jreback
Copy link
Contributor

jreback commented May 6, 2016

this was fixed by #12713 and is in 0.18.1 (just released).

@jreback jreback closed this as completed May 6, 2016
@jreback jreback added this to the No action milestone May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants