numpy
numpy: syntax/idiom to cast (n,) array to a (n, 1) array?
I\'d like to cast a numpy ndarray object of shape (n,) into one having shape (n, 1).The best I\'ve come up with is to roll my own _to_col function:[详细]
2023-04-10 12:32 分类:问答How to save a mix of strings and numbers into text files in specified format using numpy.savetxt?
with one array of strings and the other array of numbers, like str_arr = np.array([\'object1_short\', \'object2_intermidiate\', \'object3_long\'])[详细]
2023-04-10 10:47 分类:问答How to change the dtype of a ndarray to custom one in numpy?
I made a dtype that is: mytype = np.dtype([(\'a\',np.uint8), (\'b\',np.uint8), (\'c\',np.uint8)]) so the array using this dtype:[详细]
2023-04-10 05:06 分类:问答Sort numpy string array with negative numbers?
I\'m having a problem sorting a numpy array that has numbers as strings.I need to keep these as strings because there are other words after the integers.[详细]
2023-04-10 01:59 分类:问答Floating Point Exception with Numpy and PyTables
I have a rather large HDF5 file generated by PyTables that I a开发者_运维问答m attempting to read on a cluster. I am running into a problem with NumPy as I read in an individual chunk. Let\'s go with[详细]
2023-04-10 01:21 分类:问答Importing csv into Numpy datetime64
I am trying out the latest version of numpy 2.0 dev: np.__version__ Out[44]: \'2.0.0.dev-aded70c\' I am trying to import CSV data that looks like this:[详细]
2023-04-10 00:54 分类:问答Numpy: find first index of value fast
How can I find the index of the first occurrence of a number in a Numpy array? Speed is important to me. I am not interested in the following answers because 开发者_运维问答they scan the whole array a[详细]
2023-04-09 22:21 分类:问答genfromtxt dtype=None returns wrong shape
I\'m a newcomer to numpy, and am having a hard time reading CSVs into a numpy array with genfromtxt. I found a CSV file on t开发者_运维知识库he web that I\'m using as an example. It\'s a mixture of f[详细]
2023-04-09 15:56 分类:问答How to get the fatest way of getting the maximum values element-wised of "n" matrices in Python/Numpy?
I had like to know the best 开发者_JS百科fatest/optimized way of getting the maximum values element-wised of "n" matrices in Python/Numpy.[详细]
2023-04-09 09:52 分类:问答When embedding CPython in Java, why does this hang?
I\'m embedding CPython into a JVM using Jepp, but when I run import numpy; numpy.finfo(float) the process hangs.gdb says something\'s blocking a semaphore/lock acquisition, and the stack trace sugg[详细]
2023-04-09 09:14 分类:问答