Skip to content

Instantly share code, notes, and snippets.

import turtle as t
t.speed(0)
t.pensize(5)
t.up()
t.goto(0,-20)
t.left(11.25)
t.down()
#t.begin_fill()
for i in range(16):
t.forward(80)
@CuGBabyBeaR
CuGBabyBeaR / mean_of_longest_segment.py
Last active August 29, 2015 14:16
假设我有一个单位长度的线段,我往上随机丢n-1个点,分成n段。应该怎么计算【最长的】那一段的期望长度?
"""
CuGBabyBeaR @ 2015-2-25
result:
2 0.751132
3 0.611519
4 0.520260
5 0.457999
6 0.407207
@CuGBabyBeaR
CuGBabyBeaR / analyze.py
Last active September 6, 2018 09:38
A data grab and analyze project about Chinese fans of member in AKB48
# -*- coding: utf-8 -*-
import codecs, datetime, math, re
import pandas as pd
import numpy as np
from numpy import nan as NA
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
COLNAMES = [u'用户ID',u'用户名',u'性别',u'生日',u'一推',u'二推',u'发帖',u'回复',u'注册时间',u'最后登陆时间',u'积分',u'通货']