# dtype (156)

Is there an existing function in numpy that will tell me if a value is either a numeric type or a numpy array? I'm writing some data-processing code which needs to handle numbers in several different…

I know there is a simple solution to this but can't seem to find it at the moment. Given a numpy array, I need to know if the array contains integers. Checking the dtype per-se is not enough, as there…

I'd like to calculate the mean of an array in Python in this form: Matrice=[1, 2, None] I'd just like to have my None value ignored by the numpy.mean calculation but I can't figure out how to do it…

I find the astype() method of numpy arrays not very efficient. I have an array containing 3 million of Uint8 point. Multiplying it by a 3x3 matrix takes 2 second, but converting the result from uint16…

I'm using numpy to initialize a pixel array to a gray checkerboard(the classic representation for "no pixels", or transparent). It seems like there ought to be a whizzy way to do it with numpy's ama…

I'm creating a numpy array which is to be filled with objects of a particular class I've made. I'd like to initialize the array such that it will only ever contain objects of that class. For example,…

Hello I have a Subclass which needs to cover multiple Discriminator Values. something like: @DiscriminatorValue(value="ACT","DNR","ATT")would do me perfect. we have existing data where several di…

We have the following classes @Entity @Inheritance(strategy=InheritanceType.SINGLE_TABLE)// optional annotation as this is default @DiscriminatorColumn(name="apType", discriminatorType=Discrimi…

I'm trying to convert a string array of categorical variables to an integer array of categorical variables. Ex. import numpy as np a=np.array(['a', 'b', 'c', 'a', 'b', 'c']) print a.dtype>>> |S1…

In my model I have an abstract "User" class, and multiple subclasses such as Applicant, HiringManager, and Interviewer. They are in a single table, and I have a single DAO to manage them all. User:…