jmbejara / comp-econ-sp18

Main Course Repository for Computational Methods in Economics (Econ 21410, Spring 2018)
16 stars 23 forks source link

SQL in Jupyter #58

Closed afgong closed 6 years ago

afgong commented 6 years ago

Is there any code using an import statement that would allow us to run our SQL code from Kaggle directly in the Jupyter notebooks? Since import sqlite3 from our HW 3 doesn't really work in this case, unless we downloaded all of the data onto our computer? Thanks so much!

jmbejara commented 6 years ago

It would be difficult to work on this HW locally (rather than on Kaggle's website directly). You would need to download the data sets. They don't make it easy to download the necessary data sets. Also, they're kinda large. The easiest way is to do the HW in Kaggle "kernels" (which are Jupyter notebooks) and then to download them when you are done.

Just press "Fork Kernel" and you will get what you need.

afgong commented 6 years ago

In the Kaggle join hw, it's taking a long time to run the query, like the CPU is 85% and up. Is that normal for this hw, or am I doing it incorrectly? I think the Kaggle server itself may be running slowly, which is impeding any sort of code running. Thank you!!

jmbejara commented 6 years ago

@afgong Some of the queries do take a while. I don't think any of them should be longer than 30 seconds, though. I haven't timed mine, but I don't think they take longer than a minute or so.

jmbejara commented 6 years ago

@afgong Regarding an earlier question, I set theta_br equal to the results from the paper---the br standing for bresnahan and reiss. I use it to compare to my own MLE results.

afgong commented 6 years ago

I'm still running into a Kaggle server problem - I've written a simple query, but it's returning me this error:

screen shot 2018-05-16 at 18 20 01 screen shot 2018-05-16 at 18 19 45

jmbejara commented 6 years ago

I just ran my code and it appears to run just fine. I'm not sure what would be causing this.

What is the C doing at the end of the FROM line? I assume the image is just cropped and I can't see the end of the line.

afgong commented 6 years ago

Yea, this is interesting, the code sometimes runs and then doesn't run. I'll keep chugging on it now!