I want to input language code using Google API. I ran the below code, however all values in the language column input the same. It seems the final line had an error because the values of all rows are being updated with the code value of the last row. How can I correct this code?
for row in row_list:
for column in column_list:
detectText = str(df02.loc[row, column]).strip()
if detectText != 'nan':
print(df02.loc[row, column])
detect_text = detect_language(detectText)
df02.loc[row]['language'] = detect_text
Below is my expected output