Skip to main content

Questions tagged [numpy]

NumPy is the fundamental package for scientific computing with the programming language Python.

10 votes
3 answers
2k views

I implemented this Rubik's Cube game in Python, using Canvas and Context2d for user interaction. This was mainly an exercise in &...
QuadmasterXLII's user avatar
4 votes
1 answer
367 views

Context & Background Please let me remind you that this project may involve original research; it is important to remember that all content on this site is subject to CC BY-SA 4.0. It is a breach ...
Konchog's user avatar
  • 355
5 votes
1 answer
155 views

Is there a way to significantly speed-up this code? I'm solving a dynamic programming model using a backward induction algorithm. A crucial step is to calculate the current-period value function (VF), ...
manifold's user avatar
  • 151
4 votes
3 answers
388 views

Recently I have been using numpy arrays, which have great utility via their broadcasting methods. I am attempting to write a useful public facing library, and this ...
Konchog's user avatar
  • 355
9 votes
2 answers
516 views

A quick way to try to do this would be to use scipy.ndimage.map_coordinates, mapping radius to one axis of a rectangular array, and angle to the other, then summing along the radius axis. But, I think ...
uhoh's user avatar
  • 605
6 votes
1 answer
460 views

I've written a Python script to solve a system of coupled differential equations and then use the results to solve an eigenvalue problem. The full problem is: \$\frac{d^2}{dr^2} K(r) = \frac{K(r)}{r^2}...
Amirhossein Rezaei's user avatar
5 votes
2 answers
319 views

I was trying to rewrite the Python code in MATLAB. The result is consistent. But, the MATLAB code is so slow. Any help would be appreciated. Ref python code link The MATLAB code written by me is as ...
138 Aspen's user avatar
  • 469
-2 votes
1 answer
106 views

I have two unidimensional numpy arrays in python, gs and ni. I want to intersect them but preserving the order in gs. When they have high cardinality this operation becomes so costly. Is there any ...
phyAlph's user avatar
2 votes
2 answers
303 views

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 ...
coder's user avatar
  • 237
10 votes
3 answers
1k views

I have the following function that returns one of several functions along with their derivative for training neural networks. Can this function be improved and made more pythonic in any way? Are there ...
Atharva's user avatar
  • 185
3 votes
5 answers
2k views

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 ...
Jonathan Wick's user avatar
6 votes
2 answers
748 views

I have a piece of code to calculate price sensitivity based on the product and its rating. Below is the original data set with product type, reported year, customer’s rating, price per unit, and ...
Laura's user avatar
  • 81
2 votes
1 answer
87 views

I'm solving a linear programming problem, made of many small problems with some common shared constraints, meaning that they are all together. Each individual unit has constraints unique to the unit ...
AReubens's user avatar
4 votes
1 answer
214 views

I'm trying to build a function that identifies those who are promoted into a list of jobcodes, or are promoted within that list of jobcodes. Initially I was using ...
Gage's user avatar
  • 41

15 30 50 per page
1
2 3 4 5
51