# I can't make a repeat Receive one row each in a data frame, perform an operation, and assign one to a new list

Asked 1 weeks ago, Updated 1 weeks ago, 2 views

I'm going to take one line from the data frame, calculate it, and assign it to the new list one by one.

If you look at it, only the number of rows 0 and 12 changes, but I don't know how to make it into a repeating sentence. There are up to 600 lines.

``````df1.iloc.to_list() ##Part to be modified
row0 = list(df1.iloc)
row0

row_sum = 0
for i in row0:
row_sum += 10**(i/10)
row_sum = 10*np.log10(row_sum)
row_sum = round(row_sum, 2)
print(row_sum)

arr = []
arr.append(row_sum)

print(arr)
#----------------------------------------------------------
df1.iloc.to_list()
row1 = list(df1.iloc)
row1

for i in row1:
row_sum += 10**(i/10)
row_sum = 10*np.log10(row_sum)
row_sum = round(row_sum, 2)
print(row_sum)

arr.append(row_sum)

print(arr)
#----------------------------------------------------------
df1.iloc.to_list()
row2 = list(df1.iloc)
row2

for i in row2:
row_sum += 10**(i/10)
row_sum = 10*np.log10(row_sum)
row_sum = round(row_sum, 2)
print(row_sum)

arr.append(row_sum)

print(arr)
``````

dataframe for

2022-09-20 08:58

I think we can do it mechanically. Check it out.

``````arr = []

for i in range(600):
#df1.iloc[i].to_list()
row = list(df1.iloc[i])
#row1

for e in row:
row_sum += 10**(e/10)
row_sum = 10*np.log10(row_sum)
row_sum = round(row_sum, 2)
print(row_sum)

arr.append(row_sum)
``````

2022-09-20 08:58

Popular Tags
python x 1175
android x 247
c x 235
java x 192
javascript x 106
mysql x 30
html x 27
node.js x 24
php x 21
list x 19