Skip to main content

Questions tagged [numpy]

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

18 votes
1 answer
7k views

When writing Code Review answers, it becomes often necessary to measure how long the modified code takes vs how long the OP's code takes. I needed a nice way to visualize this as a function of the ...
Graipher's user avatar
  • 41.7k
11 votes
1 answer
14k views

I have implemented the K-Mean clustering Algorithm in Numpy: ...
Frames Catherine White's user avatar
15 votes
1 answer
1k views

My Racetrack is just that. A Racetrack. You can't race it (yet) because I had trouble with collision detection, but I wanted to share it anyway. It creates a base polygon by using ...
Mast's user avatar
  • 13.9k
14 votes
1 answer
10k views

I'm just starting to understand the Python syntax and I created a module that does what I wanted, but really slow. Here are the stats of cProfile, top 10 ordered by ...
adrienlucca.net's user avatar
11 votes
1 answer
6k views

I started this exercise with NumPy with a goal to find neighbors and return the new matrix. I want to get your feedback. Here's an example from this website. It looks like it's \$O(N^2)\$, and I'm ...
gogasca's user avatar
  • 609
6 votes
2 answers
6k views

Here is some code I wrote in Python / Numpy that I pretty much directly translated from MATLAB code. When I run the code in MATLAB on my machine, it takes roughly 17 seconds. When I run the code in ...
user1493692's user avatar
4 votes
1 answer
122 views

I've seen a few TTT related posts recently, and thought I might learn something or be reminded of certain techniques from attempting my own rendition. Here is that attempt! Hopefully any new coders ...
T145's user avatar
  • 3,159
2 votes
0 answers
83 views

This question is part of a series of posts about my massive Tic Tac Toe game with AI players, the previous question is: GUI Tic-Tac-Toe game with six AI players - part 1: the UI. This question ...
Ξένη Γήινος's user avatar
-1 votes
1 answer
137 views

...
Rahul's user avatar
  • 5
52 votes
3 answers
172k views

I'm trying to find the closest point (Euclidean distance) from a user-inputted point to a list of 50,000 points that I have. Note that the list of points changes all the time. and the closest distance ...
dassouki's user avatar
  • 1,101
17 votes
1 answer
616 views

Me and a couple of mates sometimes play a game called Warhammer. When playing the game you have options of what each model attacks. This can lead to situations where you know if you shoot with 100% of ...
Peilonrayz's user avatar
  • 44.6k
14 votes
2 answers
18k views

I'm trying to produce a 3D point cloud from a depth image and some camera intrinsics. The image is 640x480, and is a NumPy array of bytes. The output is a (rows * columns) x 3 array of points. I've ...
dorfy's user avatar
  • 141
13 votes
1 answer
370 views

This question is the follow-up to this previous question. Background Using this simulation I investigate a system in which enzymes proliferate in cells. During the replications of enzymes, ...
rokamama's user avatar
  • 325
13 votes
1 answer
1k views

Our quest: Create a big simulation for Conway's Game of Life, and record the entire simulation history. Current Approach: Cython is used for an iterate method. The ...
Paul's user avatar
  • 475
13 votes
3 answers
1k views

The code run perfectly fine, with no errors. However, the entirety of the code is in 1 function and is kind of hard to read. As well as that I'm not sure if and how the code could be more optimised/...
SpedEdRokay's user avatar

15 30 50 per page