Skip to content
Advertisement

Tag: arrays

Is there a way to fix value-error problem

Hello guys i am trying to implement an algortihm to remove water from underwater images and make image more noticable , but i got an errror ValueError: max() arg is an empty sequence , at the function homomorpic on this line r = max(np.ravel(result[:,:i])) , the error is caused because the result array is empty but i filled it above

Numpy Mean element wise over 3D arrays

I want to take the mean of 9 arrays element wise so to have one I need something fast. The first bit of code takes forever. And with numpy mean without specifying an axis I get one value. I dont want to specify an axis. I want to take the mean element by element. with output: juneMean[‘wind’][:,:,:] how do I

Iterating through multiple rows using multiple values from nested dictionary to update data frame in python

I created nested dictionary to keep multiple values for each combination, example rows in the dictionary is as follows:- dict = {‘A’: {B: array([1,2,3,4,5,6,7,8,9,10]), C: array([array([1,2,3,4,5,6,7,8,9,10],…}} There are multiple As and in that multiple arrays for each array. Now I want to updated the data frame which has following rows: Col 1 Col 2 Col 3 Col 4 A B

Overwriting an array in Numpy function Python

I am trying to write a numpy function that iterates with itself to update the values of its function. If for example Random_numb was equal to [50, 74, 5, 69, 50]. So the calculations would go like, 10* 50 = 500 for the first calculation, with the equation Starting_val = Starting_val * Random_numb. The Starting_Val would equal to 500 so

Advertisement