Code
################################################################################
# autoreload all modules every time before executing the Python code
%reload_ext autoreload
%autoreload 2
################################################################################
from IPython.core.interactiveshell import InteractiveShell
# `ast_node_interactivity` is a setting that determines how the return value of the last line in a cell is displayed
# with `last_expr_or_assign`, the return value of the last expression is displayed unless it is assigned to a variable
= "last_expr_or_assign"
InteractiveShell.ast_node_interactivity
################################################################################
import pandas as pd
# `copy_on_write` is a performance improvement
# This will be the default in a future version of pandas
# Refer to https://pandas.pydata.org/pandas-docs/stable/user_guide/copy_on_write.html
= True
pd.options.mode.copy_on_write = True
pd.options.future.no_silent_downcasting
################################################################################
%matplotlib inline
import matplotlib as mpl
"agg")
mpl.use(
# `constrained_layout` helps avoid overlapping elements
# Refer to https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html
'figure.constrained_layout.use'] = True mpl.pyplot.rcParams[