How do I declare a numpy array to be 1 dimensional of arbitrary length?
I am working on a python code base and the team has decided to make everything statically typed.
I want to declare a numpy array of floats to be one dimension, with arbitrary length.
I currently have the following:
Understanding the ‘cannot interpret ‘20’ as a data type’ error in np.dtype(20)
I’ve coded in python before for my university course but never really understood it- I’m trying to do that now.
How to type hint numpy arrays that accept any types of numpy floats?
As per question, I want to define a numpy type that accepts any numpy floats (i.e. np.float64
, np.float32
etc. Currently I am doing the below, is there a way to bound the NDArray
such any subclass of np.floating
is allowed?