statsmodels-tutorial icon indicating copy to clipboard operation
statsmodels-tutorial copied to clipboard

All notebooks are missing imports

Open cdeil opened this issue 12 years ago • 4 comments

All the ipython notebooks won't run out of the box because imports are missing. Could you please add those?

cdeil avatar Aug 31 '12 08:08 cdeil

See: https://github.com/jseabold/tutorial/blob/master/preliminaries.py#L18 for the import assumptions. If you prefer I can add them to every file, but I just keep them in a config file.

jseabold avatar Aug 31 '12 12:08 jseabold

I guess most users like me just want to try out something, e.g. robust estimation. They don't know that they have to copy & paste imports from preliminaries.py.

So my suggestion would be to copy & paste the imports to each notebook or to make a file common_imports.py that contains them and then in each notebook write from common_imports import *. I like the first method better because then each notebook is really independent and I can e.g. just modify it and sent it to a fried to check out.

cdeil avatar Aug 31 '12 12:08 cdeil

Sure this makes sense. Just seemed cumbersome during the tutorial to have everyone type the imports each time. Easier to just drop the common import assumptions into your IPython config for the notebook profile.

jseabold avatar Aug 31 '12 13:08 jseabold

Is there a way to have an ipython config file in the tutorial directory that is automatically picked up? Another possibility would be to mention the imports / ipython config in a top-level README instead of in preliminaries which user's might miss (I did).

cdeil avatar Aug 31 '12 13:08 cdeil