MissingValueError(chart_name, column_name)
Source¶
Bases: NumdaplotError
Raised when a column drawn by a chart that needs every value, such as a PieChart, has a missing value.
Added in version 0.1.0
Parameters:
-
chart_name(str)Name of the chart class, such as
PieChart. -
column_name(str)The column holding the missing value.
Attributes:
-
chart_nameName of the chart class, such as
PieChart. -
column_nameThe column holding the missing value.
Examples:
import numdaplot as ndp
cities = ndp.Array.from_list(["Paris", "Lyon"])
sales = ndp.Array.from_list([120.0, None])
shares = ndp.Table.from_arrays({"city": cities, "sales": sales})
chart = ndp.PieChart(labels="city", values="sales")
try:
ndp.Plot.pie(shares, chart)
except ndp.MissingValueError as error:
print(error)
# PieChart cannot draw a missing value, found one in 'sales'.