jmbejara / comp-econ-sp19

Main Course Repository for Computational Methods in Economics (Econ 21410, Spring 2019)
48 stars 26 forks source link

Monte Carlo graphing error #15

Closed rhuselid closed 5 years ago

rhuselid commented 5 years ago

Hey, I have been trying to debug this for a bit and am confused as to why it is throwing an error. Unless I am missing something, this is the same code as with the lecture notebooks for running/displaying results at different sizes of N. Yet when I try to display it with the seaborn library it gives:

ValueError: color kwarg must have one color per data set. 1000 data sets and 1 colors were provided

The type of results.x1 is a series, which seems right. Any ideas?

sim
jmbejara commented 5 years ago

Hmm. I'm not sure why this is happening. My first thought was that it maybe had something to do with the fact that you're running this on Colab. However, I just tried to run the Monte Carlo lecture on GitHub and it seems to work fine.

Yeah, results.x1 should be a Series.

I think it would help to see your import statements at the beginning. It would also be helpful if you could produce a "minimal working example" that reproduces the bug.

rhuselid commented 5 years ago

Here are my imports:

imports
jmbejara commented 5 years ago

Hmm. Ok. Yeah, that's weird. I can't see any issues. Try creating a minimal working example that replicates the bug. Then post that example. If you aren't able to do that, email me your code (or come to Ari's office hours on Monday morning).

rhuselid commented 5 years ago

Turns out I made a small typo: results instead of results1, which caused the error