Skip to content

Instantly share code, notes, and snippets.

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,
#include "stdafx.h"
#pragma comment(lib, "opencv_core230d.lib")
#pragma comment(lib, "opencv_highgui230d.lib")
#pragma comment(lib, "opencv_imgproc230d.lib")
#pragma comment(lib, "opencv_legacy230d.lib")
#pragma comment(lib, "opencv_video230d.lib")
// opencvのヘッダの前で定義
#pragma warning(disable:4996)
#include <vector>
#include <iostream>
#include <string>
using namespace std;
void Empty(string str, vector<int> v)
{
if( v.empty() ) {
cout << str << " is empty" << endl;