All Questions
Tagged with numpy python-3.x
177 questions
2
votes
2
answers
250
views
Infinite 2d block world (2d minecraft) with chunk system, physics and slower loading
Follow up from this question. I have added a slower loading system that allows the main game to run faster but I still get under 30 fps with caves even if I allow the player to outrun the loading. I ...
3
votes
5
answers
2k
views
How do I speed up this simulation program
This is a program to solve a differential equation numerically using Euler method. As of now, it is very slow, and I need to run 10000 Monte Carlo simulations.
The differential equation is called ...
3
votes
1
answer
101
views
"Flattening" a 2D STM image by subtracting an Nth order polynomial without typing out all the terms for each N?
I have some scanning tunneling microscopy (STM) topography images that I need to flatten. I have found that for some data I need a 4th order polynomial, but in other cases a lower order works better.
...
5
votes
2
answers
527
views
3
votes
1
answer
103
views
3ph 2l inverter simulation with SPWM
Here is a code for a simple model of three phase two level inverter with constant DC voltage source and three phase RL load.
...
4
votes
2
answers
174
views
NumPy script to convert BGR to HSL and back
This is a NumPy script that converts BGR arrays to HSL arrays and back, without using OpenCV. Input and output values are arrays of 3 dimensions with values ranging from 0 to 1, the shape of the ...
3
votes
3
answers
150
views
Calculate length of continuous gaps
I have a list with some nan values, out of which some are continuous, e.g.:
list = [1, 2, 3, np.nan, np.nan, 6, 7, np.nan, 9, np.nan,np.nan,np.nan, 12]
For some ...
3
votes
0
answers
164
views
Image generator using prime numbers in polar coordinates
Related
This is a Python script that generates images using prime numbers up to a given positive integer, it generates prime numbers using the Sieve of Eratosthenes with some rudimentary Wheel ...
2
votes
0
answers
95
views
Python script that generates images using Thue-Morse sequence
In mathematics, the Thue–Morse sequence, or Prouhet–Thue–Morse sequence, is the binary sequence (an infinite sequence of 0s and 1s) obtained by starting with 0 and successively appending the Boolean ...
3
votes
1
answer
162
views
Solve an option pricing PDE in Python - Part 1 [closed]
The Github repository NM-Heston solves call option prices under the Heston 2-factor model using ADI splitting schemes. I am adapting the code to price options under the 3-factor Heston-Hull-White ...
1
vote
1
answer
141
views
Further optimizing the ISING model
I've implemented the 2D ISING model in Python, using NumPy and Numba's JIT:
...
2
votes
1
answer
105
views
Optimize python computation of transition matrix
I have an array of integers labels, for instance array([0, 1, 1, 2, 2, 2, 3, 3, 1, 4, 4, 1, 1, 0, 0, -1, -1]). The array can be ...
9
votes
1
answer
4k
views
3
votes
1
answer
136
views
Create a forecast matrix from time series samples
I would like to create a matrix of delay from a time series.
For example, given
y = [y_0, y_1, y_2, ..., y_N] and W = 5
I need to create this matrix:
...
1
vote
0
answers
51
views
BoundingBox dataclass implementation with cupy, cudf, and nvector
The dataset I'm working with is rather large so I've been experimenting with cudf and cupy. Here you can find instructions for ...