import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rc('figure', figsize=(10, 6))
PREVIOUS_MAX_ROWS = pd.options.display.max_rows
pd.options.display.max_columns = 20
pd.options.display.max_rows = 20
pd.options.display.max_colwidth = 80
np.set_printoptions(precision=4, suppress=True)
import matplotlib.pyplot as plt
# Matplotlib 한글 폰트 설정 (macOS용)
plt.rc('font', family='AppleGothic')
plt.rc('axes', unicode_minus=False)14 부록 B: IPython 시스템에 대하여
효율적인 분석 환경인 IPython에 대해 더 자세히 알아봅니다.
# a very large list of strings
strings = ['foo', 'foobar', 'baz', 'qux',
'python', 'Guido Van Rossum'] * 100000
method1 = [x for x in strings if x.startswith('foo')]
method2 = [x for x in strings if x[:3] == 'foo']%time method1 = [x for x in strings if x.startswith('foo')]
%time method2 = [x for x in strings if x[:3] == 'foo']CPU times: user 24.9 ms, sys: 333 μs, total: 25.2 ms
Wall time: 25.2 ms
CPU times: user 20.6 ms, sys: 270 μs, total: 20.9 ms
Wall time: 20.9 ms
pd.options.display.max_rows = PREVIOUS_MAX_ROWS