Skip to content

Instantly share code, notes, and snippets.

#-*- coding: utf-8 -*-
from pit import Pit
import requests
import getpass
import json
HTTPUnauthorized = 401
HTTPCreated = 201
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <glut.h>
static void display(void)
{
cv::Mat img = cv::imread("test.jpg");
cv::flip(img, img, 0);
cv::cvtColor(img, img, CV_BGR2RGB);
import matplotlib.pyplot as plt
import numpy as np
from collections import Counter
# hist
m = np.asarray([2058, 2059, 2058, 2100, 2100, 2102, 2101, 2058, 2059, 2100])
print sorted(Counter(m).items())
plt.subplot(211)
<html><head><title>mpld3 plot</title></head><body>
<style>
import numpy as np
import pylab as plt
from sklearn import svm, datasets
import mpld3
iris = datasets.load_iris()
X = iris.data[:, :2]
Y = iris.target
<html><head><title>mpld3 plot</title></head><body>
<style>
import numpy as np
import pylab as plt
from sklearn import svm, datasets
from mpld3 import show_d3, fig_to_d3, plugins
iris = datasets.load_iris()
X = iris.data[:, :2]
Y = iris.target
h = .02
from mpld3.plugins import PluginBase
import jinja2
import json
from mpld3 import show_d3
import matplotlib.pyplot as plt
import numpy as np
class LinkedView(PluginBase):
"""A simple plugin showing how multiple axes can be linked"""
import matplotlib.pyplot as plt
import numpy as np
from mpld3 import show_d3, plugins
import requests as rq
def main():
url = 'http://sochi.kimonolabs.com/api/countries'
payload = {'fields': 'name,medals',
'sort': 'medals.total,-1',
#-*- encoding: utf-8 -*-
import numpy as np
import cv2
if __name__ == '__main__':
img = cv2.imread("Ryo.jpg", 0)
params = {'ksize':(31, 31), 'sigma':1.0, 'theta':0, 'lambd':15.0,