Skip to content

Instantly share code, notes, and snippets.

View tengpeng's full-sized avatar

Teng Peng tengpeng

View GitHub Profile
@tengpeng
tengpeng / gist:f6d2c91317d2ca0b4173
Created February 21, 2016 18:57
replace space with comma
awk '{$1=$1}1' OFS=","
@tengpeng
tengpeng / new_gist_file_0
Created February 21, 2016 05:51
copy to dict
lst.head().to_dict('list')
@tengpeng
tengpeng / a.rb
Created February 21, 2016 02:22
untar
tar -xzvf data/logs.tar.gz
@tengpeng
tengpeng / new_gist_file_0
Created February 20, 2016 20:37
drop by col
train.drop(train.columns[0] , axis=1)
@tengpeng
tengpeng / new_gist_file_0
Created February 20, 2016 20:24
split replace
with open('train.csv', 'r') as f:f = f.read()
f = f.replace(' ', ',')
f = f.split(',')
!echo "$(tail -n +2 train.csv)" > train.csv
@tengpeng
tengpeng / gist:a3fcd26842071ba93a83
Created February 20, 2016 06:23
replace whitespace to comma
with open('train.csv', 'r') as f:
f = data.read()
f = f.replace(' ', ',')
@tengpeng
tengpeng / a.rb
Created February 19, 2016 18:59
mount new disk
sudo mkfs -t ext4 /dev/xvdc
sudo mkdir -m 000 /mnt2
sudo mount /dev/xvdc /mnt2
@tengpeng
tengpeng / a.rb
Created February 19, 2016 04:43
make file system
sudo mkfs -t ext4 /dev/xvdc