3 ms·
Not a hindrance but I work with image data a lot. Usually what comes in is any kind of Numpy array and what comes out at the end is either statistics or a Numpy
by randomluck040 4y ago
Not a hindrance but I work with image data a lot. Usually what comes in is any kind of Numpy array and what comes out at the end is either statistics or a Numpy array. I try to type hint everywhere I can but I feel stupid doing so because all I do is work with arrays. Maybe I’m not proficient/knowledgeable enough though so take it with a grain of salt.
- zerodensity 4y agoIf it's truly "any" kind of Numpy array typing won't help much there I agree. But often it can be helpful to know the shape of the input and the shape of the output. Eg are we working with a 2D,3D or ND array. Before 3.11 it was not simple (possible?) To type this. But https://peps.python.org/pep-0646/ https://peps.python.org/pep-0646/ makes it possible. If somewhat clunky on the definition side.