Questions tagged [numpy]
NumPy is the fundamental package for scientific computing with the programming language Python.
55 questions with no upvoted or accepted answers
7
votes
0
answers
344
views
Numerical integration in cython
I have a set of nested functions that I need to call multiple times. I know scipy.quad is pretty fast, but I will need to call the integrator recursively and want ...
7
votes
0
answers
5k
views
Cubic spline interpolation in Python from scratch
I implemented the cubic spline interpolation explained in
https://en.wikipedia.org/wiki/Spline_interpolation as a Python class. Of course, such an interpolation should exist already in some Python ...
6
votes
0
answers
120
views
Subtracting elements of datasets of an HDF5 file
I am trying to solve the following problem:
Input: Input is two arrays (Nx4, sorted in column-2) stored in datasets-1 and 2 in HDF5 file (input.h5). N is huge (...
5
votes
0
answers
758
views
Calculating complex exponential numbers using OpenMP in Cython
I am trying to create a function that can either beat numexpr or perform comparably for the vectorized mathematical operation ...
4
votes
0
answers
88
views
Generating basic Fractals
Trying to generate fractals image with given IFS equations. I have two classes:
Shape - Gives co-ordinate to form a shape.
Ifs -...
4
votes
0
answers
1k
views
Slow copying of memmap array to numpy array
I have multiple binary (structured) file, each of 2GB, which I am currently reading in pair, using memmap to cross-correlate the same. I want to minimise the time required by this IO process, in the ...
4
votes
0
answers
86
views
Importer for binary datafile of PI88 Nanoindenter
As an exercise, I want to rewrite a C++ program to import measurement files (and later create excelsheets, reports ...). The measurement files split in 2 files, a binary file, and a xml-file. Because ...
4
votes
0
answers
3k
views
Distance transform on image using NumPy
I would like to find the find the distance transform of a binary image in the fastest way possible without using the scipy function distance_transform_edt(). The ...
4
votes
0
answers
5k
views
Applying hysteresis to a signal
Using python 3.6. I have written this code (below) to apply hysteresis to a signal (a numpy array).
My aim was to create a function that didn't require any loop to remember the previous state of the ...
4
votes
0
answers
714
views
Color image classification and labeling algorithm
I have some code I've been using to de-noise some images and then label all unique and contiguous elements. The function zoneMap() de-noises the image by picking a ...
4
votes
0
answers
233
views
Finding where column slices of elements in multi-dimensional array are equal
Skippable Intro:
I have a dataset that corresponds to an observed time-series. The dataset is organized into a dictionary - which contains an array of years, an array of months, an array of days, an ...
4
votes
0
answers
3k
views
Reducing memory consumption for Numpy array
I'm running the following code using numpy arrays, I get a MemoryError in Ubuntu, while the same code runs on Mac OSX. (Pagination is automatically setup in Mac) This process consumes around 30 GB. ...
4
votes
0
answers
730
views
Find the closest parametric values corresponding to a BSpline's control points
On a curve generated by scipy.interpolate.BSpline I want to find the closest
parameters relative to each control point, so that the given parametric range is ...
4
votes
0
answers
241
views
Simple Stateful LSTM example with arbitrary sequence length
I'm trying to make a simple example showing how to create a RNN with Keras that accepts as input a sequence of arbitrary length. In my example, the LSTM is trying to classify whether a sequence has ...
4
votes
0
answers
456
views
Plant/Residue Detection project, How to structure it?
Introduction
I have wanted to develop this project for more than two years. I just started writing it a couple days ago. I use it to detect plant or residue pixels in crop row images but it provides ...