Skip to main content

All Questions

Tagged with
4 votes
1 answer
63 views

Array Math to Calculate Ice Thickness -- Need Help Simplifying

I posted this on Stack but since it's working code, it was suggested I post it here. I wrote this code to calculate ice thickness using the following equation from Stephenson, 2011. It's a daily ...
emmahaggerty's user avatar
1 vote
1 answer
52 views

Optimizing the Dig Pow function

I have written a Python function to solve the Dig Pow problem, where the goal is to find a number k such that the sum of each digit of n raised to a specific and ...
XMehdi01's user avatar
  • 523
2 votes
2 answers
775 views

Finding distance between vectors of matrices

So here is the problem: Given 2D numpy arrays 'a' and 'b' of sizes n×m and k×m respectively and one natural number 'p'. You need to find the distance(Euclidean) of the rows of the matrices 'a' and ...
Levon Avetisyan's user avatar
4 votes
1 answer
312 views

Simulated annealing for magic square-of-squares puzzle

I'm working on a function that takes in a NumPy array containing only mutually distinct positive square numbers. I want the function to pick an element at random, find if there is a lower positive ...
Galen's user avatar
  • 157
5 votes
0 answers
297 views

Summing 2D NumPy array by multiple labels [closed]

Each element of the array is a coordinate (x, y). Each coordinate has two labels. Goal: sum the elements that have the same two labels. How can ...
Bystander's user avatar