Why matplotlib does not plot?

It could be a problem with the backend. What is the output of python -c ‘import matplotlib; import matplotlib.pyplot; print(matplotlib.backends.backend)’? If it is the ‘agg’ backend, what you see is the expected behaviour as it is a non-interactive backend that does not show anything to the screen, but work with plt.savefig(…). You should switch to, e.g., … Read more

How to deep copy a list?

E0_copy is not a deep copy. You don’t make a deep copy using list(). (Both list(…) and testList[:] are shallow copies.) You use copy.deepcopy(…) for deep copying a list. See the following snippet – Now see the deepcopy operation

Most efficient way to reverse a numpy array

When you create reversed_arr you are creating a view into the original array. You can then change the original array, and the view will update to reflect the changes. Are you re-creating the view more often than you need to? You should be able to do something like this: I’m not a numpy expert, but this seems … Read more