0

I have installed Anaconda 2 in Linux, presumably it has all the needed packges and more. I want to use the Spherical Harmonics function but I get

import scipy
Y = scipy.special.sph_harm(-M, L, theta, phi)
AttributeError: 'module' object has no attribute 'special'

I have ran also conda install scipy and I still get the same error. I am using the standard online manual.

user2820579
  • 3,261
  • 7
  • 30
  • 45

1 Answers1

1

Use the following to run sph_harm() and avoid the AttributeError:

from scipy.special import sph_harm
M, L, theta, phi = 10, 20, 30, 80
Y = sph_harm(-M, L, theta, phi)
SuperKogito
  • 2,998
  • 3
  • 16
  • 37