Tag: python

57 votes
6 answers
1.5K views
binning data in python with scipy/numpy

is there a more efficient way to take an average of an array in prespecified bins? for example, i have an arra

avatar
Bryan
0 1 0 9
asked 07 September, 2021
55 votes
21 answers
791 views
Can't install Scipy through pip

When installing scipy through pip with : pip install scipy Pip fails to build scipy and throws the followin

avatar
Lawanda
0 1 0 9
asked 07 September, 2021
61 votes
13 answers
531 views
ImportError in importing from sklearn: cannot import name check_build

I am getting the following error while trying to import from sklearn: >>> from sklearn import svm T

avatar
Alphonso
0 1 0 9
asked 07 September, 2021
49 votes
5 answers
1.3K views
How to check BLAS/LAPACK linkage in NumPy and SciPy?

I am builing my numpy/scipy environment based on blas and lapack more or less based on this walk through. Wh

avatar
Freida
0 1 0 9
asked 07 September, 2021
56 votes
9 answers
695 views
Numpy Resize/Rescale Image

I would like to take an image and change the scale of the image, while it is a numpy array. For example I hav

avatar
Tuan
0 1 0 9
asked 07 September, 2021
57 votes
6 answers
2.3K views
How to create a density plot in matplotlib?

In R I can create the desired output by doing: data = c(rep(1.5, 7), rep(2.5, 2), rep(3.5, 8), rep(

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
59 votes
3 answers
2.5K views
Confusion between numpy, scipy, matplotlib and pylab

Numpy, scipy, matplotlib, and pylab are common terms among they who use python for scientific computation. I

avatar
Arline
0 1 0 9
asked 07 September, 2021
56 votes
14 answers
1.5K views
Multiple linear regression in Python

I can't seem to find any python libraries that do multiple regression. The only things I find only do sim

avatar
Jeff
0 1 0 9
asked 07 September, 2021
57 votes
6 answers
1.4K views
Numpy: Divide each row by a vector element

Suppose I have a numpy array: data = np.array([[1,1,1],[2,2,2],[3,3,3]]) and I have a corresponding "vector

avatar
Charis
0 1 0 9
asked 07 September, 2021
54 votes
2 answers
1.4K views
Should I use scipy.pi, numpy.pi, or math.pi?

In a project using SciPy and NumPy, should I use scipy.pi, numpy.pi, or math.pi?

avatar
Clarice
0 1 0 9
asked 07 September, 2021
51 votes
5 answers
1K views
Compute a confidence interval from sample data

I have sample data which I would like to compute a confidence interval for, assuming a normal distribution. I

avatar
Charis
0 1 0 9
asked 07 September, 2021
57 votes
16 answers
1.6K views
scipy.misc module has no attribute imread?

I am trying to read an image with scipy. However it does not accept the scipy.misc.imread part. What could be

avatar
Basil
0 1 0 9
asked 07 September, 2021
57 votes
9 answers
1.7K views
Peak-finding algorithm for Python/SciPy

I can write something myself by finding zero-crossings of the first derivative or something, but it seems like

avatar
Xavier
0 1 0 9
asked 07 September, 2021
58 votes
8 answers
1.2K views
Installing SciPy and NumPy using pip

I'm trying to create required libraries in a package I'm distributing. It requires both the SciPy an

avatar
Hilario
0 1 0 9
asked 07 September, 2021
61 votes
10 answers
960 views
Fitting empirical distribution to theoretical ones with Scipy (Python)?

INTRODUCTION: I have a list of more than 30,000 integer values ranging from 0 to 47, inclusive, e.g.[0,0,0,0,.

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
55 votes
8 answers
2.6K views
How to normalize a NumPy array to within a certain range?

After doing some processing on an audio or image array, it needs to be normalized within a range before it can

avatar
Basil
0 1 0 9
asked 07 September, 2021
57 votes
7 answers
2.3K views
Does Python SciPy need BLAS?

numpy.distutils.system_info.BlasNotFoundError: Blas (http://www.netlib.org/blas/) libraries not found.

avatar
Arline
0 1 0 9
asked 07 September, 2021
60 votes
8 answers
2.4K views
Specifying and saving a figure with exact size in pixels

Say I have an image of size 3841 x 7195 pixels. I would like to save the contents of the figure to disk, resul

avatar
Virgil
0 1 0 9
asked 07 September, 2021
56 votes
7 answers
1.2K views
How to add a new row to an empty numpy array

Using standard Python arrays, I can do the following: arr = [] arr.append([1,2,3]) arr.append([4,5,6]) # arr

avatar
Dorinda
0 1 0 9
asked 07 September, 2021
43 votes
7 answers
2.6K views
How to do exponential and logarithmic curve fitting in Python? I found only polynomial fitting

I have a set of data and I want to compare which line describes it best (polynomials of different orders, expo

avatar
Luis
0 1 0 9
asked 07 September, 2021