Tuesday, November 24, 2015

Excel color scheme css

body
{
font-family:Verdana;
font-size:small;
}
table,td,th
{
border-color:#95B3D7 white;
border-collapse:collapse;
font-size:small;
}
th
{
background-color:#DBE5F1;
color:black;
padding:5px;
}
td
{
text-align:right;
padding:5px;
}
td.left
{
text-align:left;
padding:5px;
}

Tuesday, November 17, 2015

python pandas groupby agg percentiles?

use the ways as described in stackoverflow from google search 

or 

simply use describe:

df.groupby([col1, col2]).describe(percentiles=[.75, .95])


Optionally, you may wanna have the aggregated value display horizontally and round the numbers by appending:

df.groupby([col1, col2]).describe(percentiles=[.75, .95]).unstack().apply(lambda x:np.round(x,0))