whie codding plotting two datasets or columns in the case you coded legend(loc=0) whats mean that ?
loc shows the location of the legend. loc=0 places the legend with the minimum overlap with other drawn figures.
Refer this more information: https://matplotlib.org/3.1.0/api/_as_gen/matplotlib.pyplot.legend.html