scipy

How to run sicpy.signal freqz in C# / ASP.NET Core?

How to run sicpy.signal freqz in C# / ASP.NET Core? Question: I need to run Python source code (.py) with dependencies on numpy and scipy.signal in the ASP.NET Core context. I’ve found IronPython to be a suitable solution, but it doesn’t support these two dependencies (GitHub issue #355). So, I decided to automatically generate C# …

Total answers: 1

From Mathcad Minimize to SciPy Minimize

From Mathcad Minimize to SciPy Minimize Question: I tryed to convert this Mathcad code into the SciPy Python. My code in Python: from scipy.optimize import minimize from scipy.optimize import LinearConstraint import numpy as np A=[[1,1,0,1],[-1,-1,1,0],[0,0,-1,-1]] V=[[1000, 1000], [0, 0],[-1000, -1000]] linear_constraint = LinearConstraint (A, V[0],V[1],V[2]) x0 = np.array([0.1,0.1,0.1,0.1]) f = [5*10**-9,2*10**-9,6*10**-8,2*10**-8] def func(x): sum=0 for …

Total answers: 1

How to crop an audio file based on the timestamps present in a list

How to crop an audio file based on the timestamps present in a list Question: So, I have an audio file which is very long in duration. I have manual annotations (start and end duration in seconds) of the important parts which I need from the whole audio in a text file. I have converted …

Total answers: 1

ImportError: DLL load failed while importing _fblas

ImportError: DLL load failed while importing _fblas Question: While I was importing statsmodels.api as sm it shows this error, how can I fix it? the same error appeared when I tried to import scipy.stats. And both of them worked well while doing the import statsmodel and import scipy ErrorDescription ErrorDescription I tried to reinstall it …

Total answers: 1

Scipy – Ks2samps statistic location

Scipy – Ks2samps statistic location Question: I follow this official doc to conduct the two-sample Kolmogorov-Smirnov test. I would like to ask how to get the statistic_location (i.e., the location of maximum difference between the two CDFs). In the documentation, it specifies that the ks_2samp function can return the statistic_location but in fact it only …

Total answers: 1

Python print every unique combination of list items

Python print every unique combination of list items Question: What is the cleanest (most "pythonic") way of printing every unique combination of three items in the following list? strats = ["1","2","3","4"] The solution needs to avoid duplicates: 1 and 1 and 1 No (not unique) 1 and 1 and 2 No (not unique) 1 and …

Total answers: 1

Cannot install scipy (1.9.1) on 32-bit Windows 10 using pip (ERROR: ResolutionImpossible)

Cannot install scipy (1.9.1) on 32-bit Windows 10 using pip (ERROR: ResolutionImpossible) Question: I’ve been installing python 3.10 packages on 32-bit Windows 10. I had no problems with numpy or pandas but cannot seem to install scipy. I’ve been researching on the matter and found out scipy version 1.9.1 seems to have 32-bit wheels available. …

Total answers: 1

Multiply scipy sparse matrix with a 3d numpy array

Multiply scipy sparse matrix with a 3d numpy array Question: I have the following matrices a = sp.random(150, 150) x = np.random.normal(0, 1, size=(150, 20)) and I would basically like to implement the following formula I can calculate the inner difference like this diff = (x[:, None, :] – x[None, :, :]) ** 2 diff.shape …

Total answers: 2

Problems with scipy minimize

Problems with scipy minimize Question: I’m trying to use the minimize function to optimize two parameters for a power law fit. I am getting these errors so far. I already obtained variables that I wanted using curve fit, but I specifically wanted to use the minimize function on a chi_square function. Here is the code: …

Total answers: 1

Adapt von Mises KDE to Seaborn

Adapt von Mises KDE to Seaborn Question: I am attempting to use Seaborn to plot a bivariate (joint) KDE on a polar projection. There is no support for this in Seaborn, and no direct support for an angular (von Mises) KDE in Scipy. scipy gaussian_kde and circular data solves a related but different case. Similarities …

Total answers: 2