statitic: make numpy module optional required

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
statistic: reformat code sections

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>