Skip to content

Instantly share code, notes, and snippets.

View secsilm's full-sized avatar
🚴
Focusing

Alan Lee secsilm

🚴
Focusing
View GitHub Profile
@secsilm
secsilm / children.csv
Created June 16, 2017 02:43
CSDN - 儿童统计
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
no gend age high weight
6 0 10 1.46 38
18 0 11 1.56 48
17 0 11 1.5 40
7 1 10 1.48 39
12 1 10 1.43 43
26 1 12 1.64 60
15 0 10 1.48 39
45 0 10 1.43 35
21 1 11 1.55 46
@secsilm
secsilm / str_count.py
Created March 25, 2017 14:04
使用 Python 统计字符串中英文、空格、数字、标点个数
# coding: utf-8
import string
from collections import namedtuple
def str_count(s):
'''找出字符串中的中英文、空格、数字、标点符号个数'''
count_en = count_dg = count_sp = count_zh = count_pu = 0