From this post I understand that the log10() evaluates before the where is evaluated. Put simply I dont understand the answer provided in that question. Also why would the log10() be evaluated first, surely that just results in unnecessary computations?
merge_y = np.where(n <= 1, 1, n * np.log10(n))
import matplotlib.pyplot as plt
import numpy as np
n = np.arange(0, 10, 0.0001)
merge_y = np.where(n <= 1, 1, n * np.log10(n))
insertion_y = n*n
plt.plot(n, merge_y,'g')
plt.plot(n,insertion_y,'r')
plt.grid(True)
plt.xlabel('n')
plt.ylabel('T(n)')
plt.title('Time complexities of merge and insertion sort w/ input size n')
plt.show()