8.2 KiB
8.2 KiB
In [ ]:
# add directory above current directory to path
import sys
sys.path.insert(0, '..')In [ ]:
# now we can import modules from parent directory
import train
import pipeline_modulesIn [ ]:
showlen = lambda data: print(f"{len(data):,}")
showlen([0 for i in range(2395940)])In [ ]:
from tqdm import tqdm
import time
for i in tqdm(range(10)):
time.sleep(1)In [ ]:
from tqdm.auto import tqdm
for i in tqdm(range(10)):
time.sleep(1)In [ ]:
some_list = [x**2 for x in tqdm(10*[0])]In [ ]:
# generator expressions are surrounded by parenthesis ()
generator = (x**2 for x in [1, 2, 3, 4])
# print(next(generator))
some_list = [x for x in tqdm(generator, total=4)]In [ ]:
from IPython.display import IFrame, HTML, YouTubeVideo
# YouTubeVideo("ZbrRrXiWBKc")In [ ]:
from ipywidgets import FloatSlider, interactive, IntSliderIn [ ]:
def simple_ex(amplitude=2.0, phase=0.0):
x = np.linspace(-2*np.pi, 2*np.pi, 1000)
y = amplitude * np.sin(x + phase)
plt.rcParams['figure.figsize'] = 8,6
plt.figure()
plt.plot(x, y)
plt.xlim(-3, 3)
plt.ylim(-2*np.pi, 2*np.pi)
In [ ]:
amplitude_slider = FloatSlider(value=2.0, min=-10, max=10.0, step=.05)
phase_slider = FloatSlider(value=0.0, min=-np.pi, max=np.pi, step=.05)
w = interactive(simple_ex,
amplitude=amplitude_slider,
phase=phase_slider
)In [ ]:
import pandas as pd
data = pd.read_csv('loan_train.csv')
import pandas_profiling
report = pandas_profiling.ProfileReport(data)
reportIn [ ]:
# print many outputs in the same cell!
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
In [ ]:
%history -tIn [ ]: