start new:
tmux
start new with session name:
tmux new -s myname
import matplotlib.pyplot as plt | |
import numpy as np | |
column_labels = list('ABCD') | |
row_labels = list('WXYZ') | |
data = np.random.rand(4,4) | |
fig, ax = plt.subplots() | |
heatmap = ax.pcolor(data, cmap=plt.cm.Blues) | |
# put the major ticks at the middle of each cell | |
ax.set_xticks(np.arange(data.shape[0])+0.5, minor=False) |
# -*- coding: utf-8 -*- | |
""" Small script that shows hot to do one hot encoding | |
of categorical columns in a pandas DataFrame. | |
See: | |
http://scikit-learn.org/dev/modules/generated/sklearn.preprocessing.OneHotEncoder.html#sklearn.preprocessing.OneHotEncoder | |
http://scikit-learn.org/dev/modules/generated/sklearn.feature_extraction.DictVectorizer.html | |
""" | |
import pandas | |
import random |
license: apache-2.0 |
# (C) Mathieu Blondel, November 2013 | |
# License: BSD 3 clause | |
import numpy as np | |
def ranking_precision_score(y_true, y_score, k=10): | |
"""Precision at rank k | |
Parameters |
# standard library | |
import sys | |
import random | |
import time | |
# need to pip install selenium | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.common.exceptions import NoSuchElementException |
# Slopegraphs in matplotlib | |
# Trey Causey (@treycausey) | |
# Problems arise when equal values occur | |
# within the same time unit | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
units = ['A', 'B', 'C', 'D'] |
-- Gets all queries for a given date range | |
select starttime, endtime, trim(querytxt) as query | |
from stl_query | |
where starttime between '2014-11-04' and '2014-11-05' | |
order by starttime desc; | |
-- Gets all queries that have been aborted for a given date range | |
select starttime, endtime, trim(querytxt) as query, aborted | |
from stl_query | |
where aborted=1 |