NumPy is an extension of the Python language that adds support to large multidimensional arrays and matrixes, along with a large library of high-level mathematical functions for operations with these arrays.
102,999 questions 1
- Bountied 1
- Unanswered
- Frequent
- Score
- Unanswered (my tags)
Function that uses while can't be evaluated on arrays
When using the numpy module on python I'm used to define functions and then apply them on arrays. For example import numpy as np def function(x): return x+1 sample = function(np.random.uniform(0, ... python function numpy while-loop
Esteban Gutiérrez
- 101
Create a new column based on condition from a column in another dataset
I have a weird pandas problem I am not sure how to begin. Here are examples of my two datasets: df1: This dataset has a yearly metric per state. Metric Year State 8 1996 AL 6 ... python pandas numpy loops difference
user2813606
- 513
Why are numpy arrays of zero length useful?
For example: x = np.array([[[1],[2],[3]], [[4],[5],[6]]]) c = x[1:1,:,:] print(c.shape) print(c + 3) which gives (0, 3, 1) [] It seems that an array of zero length is a black hole, which absorbs all ... python arrays numpy
Youjun Hu
- 605
numpy and python header file location
I am trying to use matplotlib.cpp. I have #include <Python/Python.h> in order to access my Python.h header file at the location /Library/Developer/CommandLineTools/Library/Frameworks/Python3.... c++ numpy matplotlib
destroyer806
- 3
Calculate the prorata weight of a list of numbers (including negative) in Python
I am looking for a way to distribute a positive number proportionally to a list of numbers based on their value (higher gets more). Think of it as distributing a fixed bonus amount based on everyone's ... python pandas numpy statistics data-science
DOt dot
- 1
How can I run this 4 processes at the same time in python? I am not very familiar with multiprocessing
p1 = Conv should generate random numbers. p2 = log This process reads the measured values from Conv and writes them to a local file. p3 = stat This process reads the measured values from Conv and ... python python-3.x numpy process multiprocessing
Guts0032
- 1
appending multiple data frame rows into a list or array
I have this loop that gets every combination from every row in a dataset, and create sub datasets. df NAME VALUE1 VALUE2 0 Alpha 100 A1 1 Alpha 100 A1 2 Alpha 200 A2 ... python dataframe numpy dataset
Owen Osagiede
- 51
Replacing elements in ndarray based on condition
I have bi-dimensional array, like that: f_vars = np.array([[0,4], [0,2], [3,-1], [3,4], [1,-1]]) I am trying to replace ... python numpy
Petar Andreev
- 3
more efficient way to cut through 3D matrix along all the plains in numpy
I am trying to cut a 3D array along all it's plains. To capture 2D arrays along all the axes of the 3D array, this will create 13 2D arrays. I was wondering if there is a way to do this with axis and ... python numpy matrix
user2315546
- 1
Looping through a subplot and plotting data [duplicate]
I have tried to create a 4 by 3 scatterplot subplot using a for loop but it only plot some of the axis.my code looks like this so far: import matplotlib.pyplot as plt from sklearn.datasets import ... python numpy matplotlib subplot
Pitso Tladi
- 1
Trying to update Matplotlib annotations every frame
I try to update the Matplotlib annotations (FPS and frametime) of the output in each new frame. To represent the same values, which are used simultaneously by the line of the graph. After many many ... python numpy matplotlib rendering
HerrTiSo
- 1
Why is np.random.multinomial not random with mxnet.np?
import random from mxnet import np, npx npx.set_np() fair_probs = [1.0 / 6] * 6 np.random.multinomial(1, fair_probs) array([0, 0, 0, 0, 0, 1], dtype=int64)#result np.random.multinomial(1, fair_probs)... python numpy mxnet
kaikaix
- 1
Finding common values from different csv [duplicate]
I have two csv files (flat and bias) image. I have to check if the first column data of flat is equal to bias or not. If they are common, I want to subtract the second column value of bias from flat. ... python pandas dataframe numpy csv
Pritam Das
- 1
How do I combine two numpy arrays, one with an extra axis, and use np.apply_along_axis to the combined array?
I have two numpy arrays, A1 with shape (m,n) and A2 with shape (m,n,p). Thus, for i in range(p), A2[...,i] has the same shape as A1. I need to stack each A2[...,i] with A1 and apply a function to ... numpy broadcasting
user5699217
- 89
Pivot values in specific order
I have a dataframe where I would like to pivot my data to fit a specific format, making sure the dates are consecutive. Data ID Q122_c_en Q122con_s Q222_c_en Q222con_s Q322_c_en Q322con_s ... python pandas numpy
Lynn
- 3,358
153050per page