samedi 27 mars 2021

Mean from a list with a condition in Python

list = [[159.2213, 222.2223, 101.2122]
        [359.2222, 22.2210, 301.2144]]

if list[1][0] < list[0][0]:
    avg = (list[1][0] + list[0][0] - 200)/2
else:
    avg = (list[1][0] + list[0][0] + 200)/2

Hello! I want to do this for every column and output the results in another list.

Aucun commentaire:

Enregistrer un commentaire