Use executed code in a previous file #656
Unanswered
yangli-stat
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I assume you're executing the notebooks when you build the book, and believe they're executed in different kernels. So you just have to import pandas in each notebook. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One of my chapters (chapter 2) has several sections. They are saved in separate files. The _toc.yml file looks like this.
In chap2sec1.ipynb, there is a command
import pandas as pd
to load pandas. All codes withpd.read_csv
in this section work fine.In chap2sec2.ipynb, I am trying to read another file using
mydata = pd.read_csv("...")
. Something is wrong because there is an error message in the book.It seems the command executed in an earlier file doesn't follow through to subsequent files. How do I fix this? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions