I have a python blaze data like this
import blaze as bz
bdata = bz.Data([(1, 'Alice', 100.9, 100),
(2, 'Bob', 200.6, 200),
(3, 'Charlie', 300.45, 300),
(5, 'Edith', 400, 400)],
fields=['id', 'name', 'revenue', 'profit'])
I would like to calculate mean for the numeric columns. I tried something like this
print {col: bdata[col].mean() for col in ['revenue', 'profit']}
and I get
{'profit': 250.0, 'revenue': 250.4875}
But I would like to calculate in a single shot like in pandas
, like data.mean()
Any thoughts or suggestions???