# dtype (156)

Identifying numeric and array types in numpy

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…

python - How do I find out if a numpy array contains integers?

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…

How to use numpy with 'None' value in Python?

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…

python - numpy:How to convert an array type quickly

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…

python - How to make a checkerboard in numpy?

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…

python - Custom data types in numpy arrays

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,…

Hibernate Subclass which has multiple discriminator values

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…

java - How to get the DiscriminatorValue at run time

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

python - numpy convert categorical string arrays to an integer array

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…

Retrieving Polymorphic Hibernate Objects Using a Criteria Query

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:…