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
When print is used within the groupby.apply, it seems that the function is applied to the first index twice. I am not sure if this behaviour is due to print function, or it actually occurs for any given function. The issue may not seem to be a big deal at first; however, when groupby.apply is combined with multiprocessing framework, it hampers the efficiency and speedup of the code.
Output:
0 1
10 1 2
0 1
10 1 2
0 1
20 3 4
0 1
30 5 6
Expected Output
0 1
10 1 2
0 1
20 3 4
0 1
30 5 6
Output of pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.6.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: en
LOCALE: None.None
Code Sample, a copy-pastable example if possible
Problem description
When
print
is used within thegroupby.apply
, it seems that the function is applied to the first index twice. I am not sure if this behaviour is due toprint
function, or it actually occurs for any given function. The issue may not seem to be a big deal at first; however, whengroupby.apply
is combined with multiprocessing framework, it hampers the efficiency and speedup of the code.Output:
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.6.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: en
LOCALE: None.None
pandas: 0.23.4
pytest: 3.8.2
pip: 19.0.2
setuptools: 40.4.3
Cython: 0.28.5
numpy: 1.14.2
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 7.0.1
sphinx: 1.8.1
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.8
feather: None
matplotlib: 3.0.0
openpyxl: 2.5.8
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.1.1
lxml: 4.2.5
bs4: 4.6.3
html5lib: 1.0.1
sqlalchemy: 1.2.12
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: