python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Expand 2-D Numpy integer Array as binary but in parallel
I want to convert arrays of integers to 0 or 1s, padding with 0s if the other array possesses the larger value.
Examples:
ex1 = np.array([[0],[3]])
=> array([[0,0,0],[1,1,1]])
ex2 = np.array([[2,...
Shun
Votes: 0
Answers: 1
Convert a vector into a numpy array; discritize them into bins
I have a vector, say v=[0.001, 0.13, 0.2, ..., .9] with length 365. All values between 0 and 1. I want to turn it into a 2D numpy array of size 365-by-100, i.e. create bins of size 0.01 and see to whi...
amir koorani
Votes: 0
Answers: 2
numpy - insert a tuple or a list into numpy array items -
import tables, h5py
import math, sys, time
import numpy as np
import numpy.lib.recfunctions as rf
v_dt = np.dtype([ ('EID','i8'), ('CID','i8'), ('CTYPE','S4'), ('NODEF','i8'), ('f1', '<i8', (5,) ) ...
Lutz_P
Votes: 0
Answers: 1
combining non-uniform size 2D arrays into a 3D array in python?
I've searched on stackoverflow but could not find an answer to this specific question. Sorry if it is a naive question, I am a newbie to python. I have three 2d arrays of shapes
Shape of arr_X = (1,8...
Alan22
Votes: 0
Answers: 0