I overwrote by mistake pyplot.title function with a string, and don't seem to be able to recover it without restarting the kernel (using Spyder IDE). Is there a way to reload the module?
> import matplotlib.pyplot as plt
> plt.title # plt.title is a function, as expected
<function matplotlib.pyplot.title(label, fontdict=None, loc=None, pad=None, *, y=None, **kwargs)>
My mistake (happens often to me, as I am used to a different language):
> plt.title = 'test'
> plt.title # due to my mistake plt.title is now a string:
'test'
Attempt to reload the module didn't result in a change in plt.title:
> import matplotlib.pyplot as plt
> plt.title
'test'
Deleting plt seems to remove the package, but after reloading pyplot, the plt.title is still a string:
> del plt
> plt
NameError: name 'plt' is not defined
> plt.title
NameError: name 'plt' is not defined
> import matplotlib.pyplot as plt
> plt.title
'test'
Can I recover the plt.title function without restarting the kernel?