Python. Finding thresholds for rows of data

Look into the python package pandas. Here’s a tutorial: https://pandas.pydata.org/pandas-docs/stable/tutorials.html import pandas as pd list1 = [-50, -40, -30, -20, -10, 0, 1, 2] list2 = [-300, -200, -100, 0, 100, 200, 300, 400] df = pd.DataFrame({‘List 1’: list1, ‘List 2’: list2}) newdf = df.copy() newdf[df > df.median()] = 1 newdf[df < df.median()] = -1 … Read more