AttributeError

14 views
Skip to first unread message

boilerup

unread,
Oct 2, 2018, 4:58:12 PM10/2/18
to hyperspy-users
Hello All,

First of all, I really appreciate the HyperSpy team developing and sharing this powerful software with everyone for free :) I recently got a problem on my HysperSpy package and I can't use it anymore...

My problem is that I can import hyperspy.api and load my spectrum image but plotting, PCA, and all kinds of syntax stopped working with an error. For example when I type in s=hs.load("data") and run s.plot(), it gives an error - 'list' object has no attribute 'plot'.

I've already deleted python, anaconda and re-installed those and HyperSpy. I also tried to install HyperSpy Bundle for Windows but still have this problem.

Could you please comment if you have an idea what is going on?

Thank you.

Magnus Nord

unread,
Oct 4, 2018, 1:48:18 AM10/4/18
to hyperspy-users
This is (probably) due to hs.load("data") returning a list of signals, instead of a single signal.

Try:
s[0].plot()

If this works, you can see the signals in the list by running:
s

You can then assign the signals in the list to their own variables:
s0 = s[0]
s1 = s[1]
Reply all
Reply to author
Forward
0 new messages