Description
(1)
def groupby_func(x):
#computing speedup, relative to first line
return x.iloc[0, :] / x.iloc[0: , :] # (with '0')
sdf_size = odf.loc[:, cols].groupby(by="size").apply(groupby_func)
(2)
def groupby_func(x):
#computing speedup, relative to first line
return x.iloc[0, :] / x.iloc[: , :] # (without '0')
sdf_size = odf.loc[:, cols].groupby(by="size").apply(groupby_func)
Problem description
For the version (1) and (2) I get two different outputs. When I print 'sdf_size' on the console:
Somehow, with '0:' the (printed) result is how I wanted it to be (see screenshots, grouping of size in index). But after deleting the 0, which I expected to be unnecessary, I got a different result, which I didn't expect to be different (I think '0:' and ':' to be same -- correct me if I am wrong on this). An explicit setting of "group_keys=True" didn't change anything.
Just ask if something is unclear.
Thank you.
Output of pd.show_versions()
pandas: 0.19.1
nose: 1.3.7
pip: 9.0.1
setuptools: 0.6
Cython: None
numpy: 1.11.2
scipy: 0.18.0
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.3
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.999
httplib2: 0.9.1
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None