Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import codecs
import numpy as np
import MeCab
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans, MiniBatchKMeans
import cv2
import numpy as np
def unique(a):
""" remove duplicate columns and rows
from http://stackoverflow.com/questions/8560440 """
order = np.lexsort(a.T)
a = a[order]
diff = np.diff(a, axis=0)
ui = np.ones(len(a), 'bool')
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import urllib2
import urllib
import os
import glob
import PIL
import leargist