Closed
Description
There's a problem in the way .set_precision
currently works as it is being applied to all table cells indiscriminately. For instance a dataframe with means and standard errors cross validated across some parameter values the set_precision
will easily hide a lot of detail in the results.
The second parameter (2nd index) is not all zeros, they're just values in the range [1e-4, 1e-3]
. Also while for the mean
columns a precision of 2 is fine, for the standard error 4 might be more appropriate. So having a subset=
keyword argument also for .set_precision
would be great.
code for making the df
import itertools
import pandas as pd
import numpy as np
jobs = itertools.product(['a', 'b', 'c', 'd'], np.arange(1e-4, 1e-3, .0003), range(10))
rows = []
for v, v2, itr in jobs:
rows.append({'param_1': v, 'param_2': v2, 'iter': itr,
'score_1': np.random.randint(0, 100, size=(1,))[0],
'score_2': np.random.rand(1, )[0]})
df_multi = pd.DataFrame(rows)
agg = df_multi.groupby(by=['param_1', 'param_2'])[['score_1', 'score_2']].agg(['mean', 'sem'])