Skip to content
Advertisement

Tag: scipy

fitting closed curve to a set of noisy points

This is my set of data, where I would like to fit a closed curve to, just like this post here is the visualized dataset: However, these are the results I got no matter how I sort my array. I pinned a few problems about my dataset but don’t know how to deal with them: Many x and y values

How to use np.unique on big arrays?

I work with geospatial images in tif format. Thanks to the rasterio lib I can exploit these images as numpy arrays of dimension (nb_bands, x, y). Here I manipulate an image that contains patches of unique values that I would like to count. (they were generated with the scipy.ndimage.label function). My idea was to use the unique method of numpy

Problem in linear constraints of scipy. All the elements of population is getting rejected

I am using scipy differential evolution. I have to set the following linear constraints. 0<x1+x2+x3+x4<=1. x2+x3=1. I have set the following matrix A=[0 1 1 0] B=[1]. linear_constraint = LinearConstraint(A,B,B,True). i have also set lower and upper bound to 0 and1. However, during each iteration, the output of the objective function is InF, whereas the differential evolution is not calling

For loops to iterate through columns of a csv

I’m very new to python and programming in general (This is my first programming language, I started about a month ago). I have a CSV file with data ordered like this (CSV file data at the bottom). There are 31 columns of data. The first column (wavelength) must be read in as the independent variable (x) and for the first

Initialize high dimensional sparse matrix

I want to initialize 300,000 x 300,0000 sparse matrix using sklearn, but it requires memory as if it was not sparse: it gives the error: which is the same error as if I initialize using numpy: Even when I go to a very low density, it reproduces the error: Is there a more memory-efficient way to create such a sparse

command line ipython with –pylab + more imports

The –pylab command line arguments makes ipython a quick but powerful calculator in the terminal window which I use quite often. Is there a way to pass other useful imports to ipython via command line, such as which makes it even more convenient to use? Answer If you have installed sympy you get script that starts ipython with sympy imports.

Advertisement