Hello
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import numpy | |
import scipy.spatial | |
# データ読み込み | |
f = open('nihonseiji.txt') | |
head = f.readline() | |
parties = head.strip().split('\t')[1:] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
# Viterbi algorithm | |
# http://en.wikipedia.org/wiki/Viterbi_algorithm | |
# | |
# > python viterbi.py | |
# 0 1 2 | |
# Rainy: 0.06000 0.03840 0.01344 | |
# Sunny: 0.24000 0.04320 0.00259 | |
# (0.01344, ['Sunny', 'Rainy', 'Rainy']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
''' | |
try some parameters. | |
$ python params_test.py | |
[0, -1] | |
False | |
[0, 0] | |
False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
''' | |
まとめサイトなどURLに含まれるYouTubeをプレイリストに保存する | |
$ python youtube_gdata_playlist.py http://... | |
''' | |
# 以下要設定 | |
# cf. YouTubeクライアント |
Visulalize authors relationships based upon not-hiragana-kanji rubis on Aozorabunko.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Amateur | |
Anal | |
Anime | |
Asian Woman | |
Ass | |
Ass to Mouths | |
BDSM | |
Big Ass | |
Big Cock | |
Big Tits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def sort_test(): | |
a = [random.random() for i in range(100)] | |
b = [random.random() for i in range(100)] | |
c = dict(zip(a, b)) | |
sorted(c, key=c.get) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
('blowjob', 'hardcore') 594241 | |
('blowjob', 'brunette') 336485 | |
('blowjob', 'teen') 334746 | |
('amateur', 'teen') 322670 | |
('brunette', 'hardcore') 320892 | |
('hardcore', 'teen') 302974 | |
('blonde', 'brunette') 282348 | |
('blonde', 'blowjob') 272567 | |
('blowjob', 'oral') 269461 | |
('blonde', 'hardcore') 252474 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
from pymongo import MongoClient | |
client = MongoClient() | |
db = client.xvideos | |
def create_db(): | |
f = open('xvideos.com-db.csv') | |
for line in f: |