# dip.gof

**URL:** <https://mne.discourse.group/t/dip-gof/2227>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [June 22, 2020, 9:23pm UTC](https://mne.discourse.group/t/dip-gof/2227 "2020-06-22T21:23:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 22, 2020, 9:23pm UTC](https://mne.discourse.group/t/dip-gof/2227/1 "2020-06-22T21:23:41Z")

</div>

External Email - Use Caution

Dear experts:

I am trying to run mne.fit\_dipole

but I come across this error

359 time points fitted  
Traceback (most recent call last):  
&nbsp;&nbsp;File "Rene.py", line 44, in \<module\>  
&nbsp;&nbsp;&nbsp;&nbsp;best\_idx = np.argmax(dip.gof)  
AttributeError: 'tuple' object has no attribute 'gof'

I assume there has to be some problem with Dipole class.

Best,  
Andrade.  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200622/6eda07aa/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200622/6eda07aa/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 22, 2020, 9:33pm UTC](https://mne.discourse.group/t/dip-gof/2227/2 "2020-06-22T21:33:55Z")

</div>

External Email - Use Caution

The output of `fit_dipole` is a tuple with two elements, the dipole and the  
residual (see docs here  
\<[https://mne.tools/dev/generated/mne.fit\_dipole.html#mne.fit\_dipole](https://mne.tools/dev/generated/mne.fit_dipole.html#mne.fit_dipole)\>).  
Maybe you need to do `dip, ev = fit_dipole(...)` or `dip =  
fit\_dipole(...)[0]`?

Eric

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 22, 2020, 9:39pm UTC](https://mne.discourse.group/t/dip-gof/2227/3 "2020-06-22T21:39:20Z")

</div>

External Email - Use Caution

Although Eric has already guessed the probable reason for your error, I will take this opportunity to remind you (and all readers of this list) that in general we want to see more of your code to be able to help you debug. In particular, in this case we would want \*at least\* to see the line(s) where you define the variable `dip`. Better yet would be to post a pared-down version of the whole script (e.g., on [gist.github.com](http://gist.github.com)) and include the link to it in your request for help.

Ideally the pared-down script should be a [minimal, complete, and verifiable example]([https://stackoverflow.com/help/mcve](https://stackoverflow.com/help/mcve)) that demonstrates the problem you are experiencing. If at all possible, your example should use [MNE-Python's "sample" dataset]([https://mne.tools/dev/overview/datasets\_index.html#sample](https://mne.tools/dev/overview/datasets_index.html#sample)) or one of the other built-in datasets so that we can quickly and easily replicate your error on our own computers.

-- dan  
Daniel McCloy  
[https://dan.mccloy.info](https://dan.mccloy.info)  
Research Scientist  
Institute for Learning and Brain Sciences  
University of Washington

??? Original Message ???
