Description(functions=None, columns=None)
Source¶
Statistics describing columns of a Table, used by Table.describe.
Added in version 0.1.0
Changed in version 0.2.0
Refuses two statistics giving rows of the same name, such as two Share.
Parameters:
-
functions(list[Statistic] | None, default:None) -
columns(list[str] | None, default:None)The names of the columns to describe, one result column each. Every number column when omitted.
Raises:
-
InvalidTypeErrorWhen a setting is not of the type its annotation names.
-
EmptyListErrorWhen
functionsorcolumnsis an empty list. -
InvalidColumnNameErrorWhen a column name is an empty text.
-
DuplicateColumnErrorWhen a column name appears twice.
-
DuplicateStatisticErrorWhen a statistic appears twice in
functions, or two statistics give rows of the same name, such as twoShare. -
RefusedOperationErrorWhen a statistic is not a statistic of numdaplot.
Examples:
import numdaplot as ndp
cities = ndp.Array.from_list(["Paris", "Lyon", "Paris"])
prices = ndp.Array.from_list([120.0, 80.0, 150.0])
sales = ndp.Table.from_arrays({"city": cities, "price": prices})
sales.describe(ndp.Description(functions=[ndp.Min(), ndp.Mean(), ndp.Max()]))
# statistic price
# TEXT FLOAT64
# 0 min 80.000000
# 1 mean 116.666667
# 2 max 150.000000