Tag: scipy

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
964 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
54 votes
11 answers
1.5K views
Is there a library function for Root mean square error (RMSE) in python?

I know I could implement a root mean squared error function like this: def rmse(predictions, targets): re

avatar
Carmelina
0 1 0 9
asked 07 September, 2021
62 votes
15 answers
1.6K views
Installing SciPy with pip

It is possible to install NumPy with pip using pip install numpy. Is there a similar possibility with SciPy?

avatar
Jeff
0 1 0 9
asked 07 September, 2021
54 votes
17 answers
3.1K views
Calculating Pearson correlation and significance in Python

I am looking for a function that takes as input two lists, and returns the Pearson correlation, and the signif

avatar
Percy
0 1 0 9
asked 07 September, 2021
56 votes
28 answers
1.7K views
Moving average or running mean

Is there a SciPy function or NumPy function or module for Python that calculates the running mean of a 1D arra

avatar
Yolando
0 1 0 9
asked 07 September, 2021
62 votes
10 answers
2.7K views
How to smooth a curve in the right way?

Lets assume we have a dataset which might be given approximately by import numpy as np x = np.linspace(0,2*np

avatar
Bryan
0 1 0 9
asked 07 September, 2021