Я пытаюсь перебрать кадр данных размером 4x3 со следующим кодом:
R = []
Ratio = pd.DataFrame(R)
for column in Three_Distances:
column_location = Three_Distances.columns.get_loc(column)
for rows, row in Three_Distances.iterrows():
if column == 'post_one':
Ratio[column_location,rows] =
1/Three_Distances[column].divide(D1_theoretical)
if column == 'post_two':
Ratio[column_location,rows] =
1/Three_Distances[column].divide(D2_theoretical)
if column == 'post_three':
Ratio[column_location,rows] =
1/Three_Distances[column].divide(D3_theoretical)
Мой вывод для переменной Ratio - 4x12 вместо 4x3.Мне интересно, правильно ли я понимаю инструменты или циклы, которые я использую?
Спасибо