All Questions
2,382
questions
-3
votes
0
answers
20
views
how can I compute the striking force of a football player using python [closed]
in a football match between England and Spain Julius Fueke needs a decisive goal, write a Python program that can compute the striking force of each of the players
i tried using the import numpy but ...
0
votes
0
answers
64
views
Why is my function working only when I call it directly in the plot?
I wrote a function which rounds the value of the signal after the first maximum is obtained. However, when I call this function and store the result and plot it, I do not see the expected result.
This ...
1
vote
0
answers
68
views
Faster way to access the value of a huge dictionary from a huge list of arrays in python
I am curious whether I can access the value of a huge dictionary faster from a huge list of arrays.
Here is a simple example:
import numpy as np
my_list = [np.array([ 1, 2, 3, 4, 5, 6, 8, 9, 10]...
1
vote
3
answers
77
views
Most efficient way to keep track of the samples I already selected from an array
I have a moderately large np array (which could however get larger in the future):
import numpy as np
x = np.arange(100_000).reshape((10_000,10))
I need to iteratively choose a random sample (row), ...
0
votes
1
answer
37
views
Joining vectors with common elements from a list
I have a list of vectors and I want to join all the vectors inside the list which have some common components:
For example, I have:
list = [[1, 14], [3, 15], [4, 15], [5, 14], [8, 14], [9, 15], [10, ...
1
vote
0
answers
110
views
Working with 4D data in Python with entries having variable sizes (are not homogeneous)
I am a civil engineer and I need to collect results from a finite element model and work with data having four dimensions.
Load combinations in the building model (can range from 3 to 60 or so)
The ...
1
vote
1
answer
37
views
Taking the square root of multidimensional uncertainties uarray
How do I take the square root of a 2D uarray?
For example,
import numpy as np
from uncertainties import unumpy,umath
array=np.array([[2,3],[6,7],[5,3]])
uncertainties=np.array([[2,2],[4,4],[5,5]])
...
1
vote
1
answer
58
views
Is there a way to make a long for loop to run faster?
Im making a simple montecarlo simulator that takes in a 3*4 matrix of probabilities, and the number of iterations you want to simulate for. And the output is a table with all the results.
Each row of ...
0
votes
1
answer
51
views
Fail to change an element in an numpy.array in Python
import numpy as np
def function(1st_variable,2nd_variable):
ratio = 1st_variable/ 2nd_variable
y = np.power(ratio, 1.1)*0.79
if y >= value*0.89:
y = value*0.89
return y
...
2
votes
3
answers
82
views
how to merge two lists and get names of lists with the highest value for each index?
I am trying to compare two lists of odds from two bookmakers. They look like this:
List1 = ['2.66', '3.79', '1.88', '1.61', '2.51', '1.29', '2.29', '2.56', '3.16', '2.05', '2.95', '2.64', '2.26', '3....
0
votes
0
answers
48
views
Why does the following code detect this matrix as a non-singular matrix?
Here is a fragment of my code:
import numpy as np
from copy import copy
from random import randint
# With this matrix it doesn't give an error
matriz_aux = [
[None, 6, None, 9],
[ 9, None, ...
0
votes
1
answer
31
views
IndexError when I try to fill a list of lists from a multidimensional numpy array with expression statement in Python
Starting from a csv file, I have a multidimensional numpy array (dimensions: 617 x 9) and I need only one column of that n x m array. In that column are stored sequential data like the following:
[0,0,...
-1
votes
2
answers
106
views
Python coding question regarding "stacking arrays to an array" [closed]
I have a simple Python coding question regarding "stacking array inside array". Here, I have several arrays as follows:
a1 = np.array([[1,1,1],[1,1,1],[1,1,1]])
a2 = np.array([[2,2,2],[2,2,...
0
votes
0
answers
49
views
Matching parts from cut sequence to origin sequence, when origin sequence is very long
I have two numeric and huge np.arrays (let's call them S1 and S2, such that len(S1)>>len(S2)>>N where N is a very large number). Let us call S1 the origin sequence, and S2 the cut sequence....
1
vote
3
answers
97
views
Update the first element in a list containing range on integers
In a range of list that contains an interval (1-59/4) i want the first element alone to change for ever 3 rows.
n = 14
lis_num = []
for x in range(n):
lis_num.append('need the logic')
output of ...