02: Global Shark Attacks

03: RegEx E-Mail-Address matching

The third door is a common regex for emails:email = re.compile(u"([a-z0-9!#$%&'*+\/=?^_`{|.}~-]+@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)", re.IGNORECASE)
print(email.match("test@mail.com"))
Source: The common regex library

04: Fill NA Values

The fourth door shows how to fill missing values with the average in a bitcoin trend analysis:btc = btc.replace(0, np.nan).fillna(method='ffill')It basically replace all zeros with np.NotaNumber and then fills them with the average.
Link to the Jupyter NotebookFurther reading:
Pandas Documentation

11: Correlation heatmap

The eleventh door shows how to do a simple correlation heatmap.
I like the immediate visual experencie of formal data.
import seaborn as sns
corr = dataframe.corr()
sns.heatmap(corr,
xticklabels=corr.columns.values,
yticklabels=corr.columns.values)

16: Short PCAs

The sixteenth door shows how to do a PCA in one line:
from sklearn.decomposition import PCAPCA(n_components = 4).fit_transform(data)It basically replace all zeros with np.NotaNumber and then fills them with the average.
Join the discussion