May-04-2022, 07:52 AM
Also, I don't think I understand what part of your import is "not working" in your first attempt. Can you make a reproducible example that shows the error? When I do something similar, it seems to import fine. I'm not sure how mine differs from your attempt.
b01_import.py
b01_import.py
import pandas as pd global df if True: df = pd.DataFrame([3, 2, 1])plot.py
from b01_import import df print(df)
Output: 0
0 3
1 2
2 1