Skip to main content

All Questions

Tagged with
3 votes
0 answers
55 views

Python: Iterating through 2 lists

I am trying to implement the following equation: Where zc is an equally spaced range of values e.g. t_array = np.arange(z_[0],z_[-1],0.01) In this case z_[0] = -15.336 z_[-1] = 15.336 I'm struggling ...
Justincomp's user avatar
0 votes
1 answer
73 views

iterate through a csv file using numpy

I have a CSV file with 4 columns with x, y positions for tracks. The 1st column is the ID of the track. The 2nd column is time. 3rd and 4th are X & Y co-ordinates. Now the X & Y positions ...
kamlesh bornani's user avatar
0 votes
0 answers
85 views

Iterating for a specific array element in Python

I'm using in my Python something like this: for i in range(333333): array1[i,1]=numpy.where(array1[i,1]!=-1,array[i,1],function(array1[i,0],array1,array2)) Obviously, this is not really ...
Exi0022's user avatar
0 votes
1 answer
105 views

How to efficiently standardize data in relation to preceding entries

I am trying to write a python script to standardize a big set of data (>10000 entries) in range of -1 to 1 in relation to preceding entries. What I'm currently doing is iterating through the set ...
Simon Spasskiy's user avatar
1 vote
0 answers
111 views

What is the best way to iterate over rows of a pandas dataframe whose elements are arrays of different length?

I have a weird dataframe, where each row contains numpy arrays of different length from row to row. Below an example (actual df has more columns and waaaay more rows): import pandas as pd import numpy ...
DeltaIV's user avatar
  • 5,539
0 votes
0 answers
65 views

how to work with for loop and if in NumPy lib in python

good evening. i wanted to iterate an array and delete its indexes every other. or maybe put those indexes i want in a new array. I tried Processed_Data=np.array([i for i in Engleashed_Serch_Results if ...
user avatar
0 votes
1 answer
233 views

How to iterate through a dataframe and add values based on previous condition, including the previous value added

I have a 2 columns dataframe. The first column indicates a timestamp. The second column has values calculated (the first few rows have no value on purpose). df = pd.DataFrame({'timestamp': [123, 456, ...
chouchou's user avatar
0 votes
1 answer
75 views

Use np.nditer as zip

I have tried to apply the function np.nditer() like zip() with arrays of different dimensions, where the iterator should use only the first dimensions. Minimal example a_all = np.arange(6).reshape(2,3)...
domist07's user avatar
-2 votes
1 answer
48 views

How to make calculations and checks on array elements/pixels manually and fast?

To be more clear, I produced a 2-D occupancy map, where obstacles marked with white pixels, from 3-D depth data using Python (NumPy) as given in the following figure. Occupancy Map However, ...
Yavuz Selim's user avatar
0 votes
1 answer
87 views

How can I easily Iterate NumPy arrays using approaches other than #nditer?

I would like to Iterate each cell value of arrays. I tried it using np.nditer methods (for i in np.nditer(bar_st_1). However, even with 64 GB RAM laptop it tooks alot of computational time and runs ...
Endalkachew Kebede's user avatar
3 votes
1 answer
67 views

Delete row if next row has the same first value, python

I have an array that looks like this: data([0.000, 1], [0.0025, 2], [0.0025, 3], [0.005, 5]) I need to delete [0.0025, 3], because it has the same first value as the one before. I have tried: for i in ...
vinc00's user avatar
  • 55
1 vote
1 answer
37 views

Numpy Array Iteration, starting with third value

I need to iterate through an numpy array, but I need to start with the third value. My exact problem is the following. I get an array like this: data([0.0000, 1], [0.0011, 2], [0.0036, 3], ....) I ...
vinc00's user avatar
  • 55
-1 votes
1 answer
31 views

Changing values with conditional and function in pandas/python

I have a dataframe, as per the table below A. I want to create a table with the values ​​of table B. I would like to compare the next value in the row with the previous value in table A. If the next ...
gveronese's user avatar
-2 votes
1 answer
341 views

Calculation involving iterations over all combinations of values in two lists in Python [duplicate]

I need to make calculations using two lists each with 36 elements in them. The calculation must use one value in each list using all combinations. Example: listx = [x1 , x2 , x3 , ... , x36] listy = [...
Renan Madruga's user avatar
0 votes
2 answers
40 views

Iterating over 3D numpy array, creating a copy and set new values

Hello python community, I am new to python and playing around with numpy arrays and have a question. E.g. I have this 3D array (in reality the array is much much bigger) input = np.array([[[0,0,1,1,2,...
einwahlfisch's user avatar

15 30 50 per page
1
2 3 4 5
16