Last active
February 2, 2024 16:41
-
-
Save apzentral/6663123689e2ed75a987979b7a4b30ea to your computer and use it in GitHub Desktop.
Python: starting script for Jupyter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Summary: | |
""" | |
from IPython.display import display, HTML | |
import inspect | |
import logging | |
import os | |
import pandas as pd | |
import pathlib | |
import sys | |
logging.basicConfig( | |
format="[%(asctime)s.%(msecs)03d] [%(levelname)s] %(module)s:%(lineno)d - %(message)s", | |
datefmt="%Y-%m-%d %H:%M:%S", | |
) | |
CURRENT_FILE_NAME = inspect.getfile(inspect.currentframe()) | |
CURRENT_DIR = os.path.dirname(os.path.abspath(CURRENT_FILE_NAME)) | |
CURRENT_FILE_DIR = pathlib.Path(os.path.abspath("")).parent.resolve() | |
PARENTDIR = os.path.dirname(CURRENT_DIR) | |
sys.path.insert(0, PARENTDIR) | |
sys.path.insert(0, CURRENT_FILE_DIR) | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.DEBUG) | |
pd.options.display.max_columns = None | |
pd.set_option("display.max_rows", None) | |
logger.info("loaded packages successfully") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you are using VSCode and Jupyter Notebook not working right. Please check this plug in,
Dependency Analytics
if it is enabled. This might cause the issue.https://stackoverflow.com/questions/69791612/vscode-jupyter-notebook-syntax-highlighting-and-autocompletion-stopped-working