Why does from scipy import spatial work, while scipy.spatial doesn't work after import scipy?
Use scipy version 1.2.1 to solve this issue......
I would like to use scipy.spatial.distance.cosine in my code. I can import the spatial submodule if I do something like import scipy.spatial or from scipy import spatial, but if I simply import scipy calling scipy.spatial.distance.cosine(...) results in the following error: AttributeError: 'module' object has no attribute 'spatial'.
What is wrong with the second approach?