origin array is like:
array([nan, nan, 'hello', ..., nan, 'N', 61.0], dtype=object)
How can I remove all string from this array and get a new array with dtype float?
I know I can do this using python list:
[i for i in x if type(i) == float]
but this way will change numpy.ndarray
to list
, is there a way to do this in numpy?
没有评论:
发表评论