| | I have two Numpy record arrays that have exactly the same fields. What is the easiest way to combine them into one (i.e. append one table on to the other)?
| I have a conjunctive probability mass function array, with shape, for example (1,2,3,4,5,6) and I want to calculate the probability table, conditional to a value for some of the dimensions (export ... | The following example shows what I want to do:
>>> test
rec.array([(0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0),
(0, 0, ...
| We've got a set of recarrays of data for individual days - the first attribute is a timestamp and the rest are values.
Several of these:
ts ...
| Suppose that I have an array defined by:
data = np.array([('a1v1', 'a2v1', 'a3v1', 'a4v1', 'a5v1'),
('a1v1', 'a2v1', 'a3v1', 'a4v2', 'a5v1'),
...
| I have a recarray with a couple columns that I use for selecting a subset. Something like
>>> x
array([ ('label1',True,3),
...
| I am trying to learn how to use numpy's structured arrays. Specifically, I was trying to add information to more than one field at a time. I tried:
import numpy as np
numrec ...
| | I know there was already a question about this topic (cleanest way to add a field to a structured numpy array), see
Adding a field to a structured numpy array
but ... | I input a file using genfromtxt and some of the values are missing so I generate a masked array. When I try to index some of the values of the ... | The answer will be very obvious I think, but I don't see it at the moment.
How can I convert a record array back to a normal nd array?
Suppose I have ... | I have a Numpy rec array from which I would like to do some quick queries similar to SQL: SELECT * where array['phase'] == "P". I would like to get a ... | What's the best way to convert numpy's recarray to a normal array?
i could do a .tolist() first and then do an array() again, but that seems somewhat inefficient..
Example:
import numpy as np
a ...
|
|