-
Notifications
You must be signed in to change notification settings - Fork 0
/
imports.py
49 lines (46 loc) · 1.6 KB
/
imports.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import sklearn
import tqdm
import os
import re
import zipfile
import glob
import requests
import json
import io
import tempfile
import itertools
import plotly.offline as py
import plotly.graph_objs as go
import urllib.request
from bs4 import BeautifulSoup
from subprocess import check_output
from tqdm import tqdm_notebook
if __name__ == '__main__':
# Use Plotly offline.
py.init_notebook_mode(connected=False)
# Render all variables on a single line with display.
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = 'all'
# Interactive plots.
from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'notebook')
# Retina quality plots (only for `%matplotlib inline`).
get_ipython().run_line_magic(
'config', "InlineBackend.figure_format = 'retina'")
# Better default figure size.
plt.rcParams['figure.figsize'] = 9.5, 9.5 / (16 / 9)
# Better default figure margins.
plt.rcParams['figure.autolayout'] = True
# Better default font families (falls back to defaults if missing).
# Run `matplotlib.font_manager._rebuild()` to rebuild the font cache.
plt.rcParams['font.sans-serif'].insert(0, 'Roboto')
plt.rcParams['font.monospace'].insert(0, 'Roboto Mono')
# Auto-reload modified packages.
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
# change default number of colums to display
pd.options.display.max_columns = 100