Question on HW2 #15
Replies: 10 comments 1 reply
-
hi, is this when you import my code and then run it in your notebook? or is it a class within your code? |
Beta Was this translation helpful? Give feedback.
-
It's a class in my code.
…On Fri, Sep 30, 2022, 10:52 PM William Gilpin ***@***.***> wrote:
hi, is this when you import my code and then run it in your notebook? or
is it a class within your code?
—
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2U277WZ2EOTD4FYKYWQCU3WA6YQVANCNFSM6AAAAAAQ2IM4K4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Does the following run:
If so, then the problem is probably with the |
Beta Was this translation helpful? Give feedback.
-
The plt.plot function doesn't run, but the eigmax_numpy function does work
in the previous line where I print out the final solution. The
print(model.singular_values_) also works.
…On Fri, Sep 30, 2022, 11:21 PM William Gilpin ***@***.***> wrote:
Does the following run:
plt.plot(model.components_, '.')
If so, then the problem is probably with the eigmax_numpy function rather
than your code
—
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2U277WSJ37ZMRAKO6MUNTLWA634BANCNFSM6AAAAAAQ2IM4K4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
okay that's weird that the eigs print but the plotting isn't working. It sounds like there might be a () somewhere there shouldn't be, since parentheses trigger a variable being treated like a function. Another option would be that matplotlib is struggling. Does |
Beta Was this translation helpful? Give feedback.
-
I guess I just can't tell why Matplotlib wouldn't be working. Substituting
np.ones(100) didn't plot either
…On Fri, Sep 30, 2022, 11:33 PM William Gilpin ***@***.***> wrote:
okay that's weird that the eigs print but the plotting isn't working. It
sounds like there might be a () somewhere there shouldn't be, since
parentheses trigger a variable being treated like a function. Another
option would be that matplotlib is struggling. Does plt.plot(np.ones(100))
work?
—
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2U277W3TARI7R7MFXDTGKDWA65KBANCNFSM6AAAAAAQ2IM4K4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Okay that's a good sign, that just means it's a matplotlib issue. Just out of curiosity, do you have |
Beta Was this translation helpful? Give feedback.
-
That worked. Thank you!
…On Fri, Sep 30, 2022, 11:40 PM William Gilpin ***@***.***> wrote:
Okay that's a good sign, that just means it's a matplotlib issue. Just out
of curiosity, do you have plt.plt anywhere in your code (note that there
is no o in either)? Otherwise, my guess is that plt.plot got reassigned
somehow, re-running import matplotlib.pyplot as plt might fix it (or just
saving and restarting the notebook)
—
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2U277V2JE2HFTIJZY4QUUTWA66ENANCNFSM6AAAAAAQ2IM4K4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
HI Dr. Gilpin! I'm working on problem 2, but Visual Studios isn't recognizing the ipywidgets library. I made sure to install the library using the Anaconda Prompt, but that didn't make a difference. Any advice? |
Beta Was this translation helpful? Give feedback.
-
If you would still like to play with the widgets, I'd recommend just opening the notebook with Jupyter, sometimes there are missing plugins, etc... in vscode. It will work natively in Jupyter |
Beta Was this translation helpful? Give feedback.
-
Hi Dr. Gilpin, when I took the section of code you wrote to test my class definition, I'm getting a "module object is not callable" error that occurs at the plt.figure() for the model.stored_eigenvalues object. Do you have any tips for how to get rid of this? I looked up the error and apparently it occurs when you try to import a module and then try to call it as a function.
Beta Was this translation helpful? Give feedback.
All reactions