Questions tagged [numba]
Numba is an open source NumPy-aware optimizing compiler for Python.
29 questions
2 votes
1 answer
103 views
Numba implementation of AA Tree with rank and select operations
I've implemented an AA Tree (a type of self-balancing binary search tree) using Numba, a just-in-time compiler for Python. This implementation includes rank and select operations, which are useful for ...
2 votes
0 answers
83 views
GUI Tic-Tac-Toe game with six AI players - part 2: the styling
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 ...
0 votes
1 answer
261 views
Find the first value bigger than a threshold
This function takes two inputs: A is 2D (N,5) while B is 1D (N). It tries to find the smallest ...
6 votes
2 answers
513 views
Optimizing a node search method given a 2-D spatial point
I have a tree-like structure called grid. I have designed it as a structured numpy array. Each element of grid is a tree-node. ...
2 votes
1 answer
166 views
Further optimizing the ISING model
I've implemented the 2D ISING model in Python, using NumPy and Numba's JIT: ...
3 votes
2 answers
222 views
Intercolumn statistics between columns in a dataframe
I have a df and need to count how many adjacent columns have the same sign as other columns based on the sign of the first column, and multiply by the sign of the ...
3 votes
1 answer
772 views
Implementing histogram in python
I was trying to implement my own version of matplotlib's hist function and I came up with this: ...
2 votes
1 answer
432 views
Monte Carlo using Numba
I'm having trouble with the slow computation of my Monte Carlo simulation code. Based on the pycallgraph, the bottleneck seems to be the module named ...
3 votes
1 answer
858 views
Using Numba works slower than not using it for my Python code
I thought this community is better place to ask my question so I ask here rather than at StackOverflow. Recently, I learned that Numba can make Python function ...
10 votes
1 answer
373 views
From Hummingbirds to Ornithopters: Simulating the Aerodynamics of Flapping Wings
Ptera Software A Flapping Wing Aerodynamics Simulator Written in Python Motivation About a year ago, I became fascinated by how animals fly. As an aerospace engineering student, it surprised me that ...
9 votes
5 answers
2k views
Fast Risk Battle Simulator
I have written some code in python to determine the outcome(including the remaining troops of both sides) of a Risk battle fought until one side is defeated. When using the Numba's njit decorator the ...
2 votes
3 answers
375 views
Iterative uniform recombination of integer lists in python with numba
I have a list of N integers and I iteratively take two integers at random, which are not at the same position in the list and uniformly recombine their binary ...
6 votes
3 answers
388 views
Random changes in a list of binary numbers
I have a list of N integers, e.g. intList=[1,7,3,1,5] with N=5 and all integers have a ...
4 votes
2 answers
640 views
List of binary numbers: How many positions have a one and zero
I have a list of integers, e.g. i=[1,7,3,1,5] which I first transform to a list of the respective binary representations of length ...
3 votes
0 answers
365 views
Improving Performance of Numba For-Loop and Matrix Multiplication for Time Integration Solver
I am writing some code that performs a simple time-history integration solver (Newmark method for structural dynamics) and I looking for some suggestions in how I can improve the performance of my ...