Skip to content

Instantly share code, notes, and snippets.

View whbzju's full-sized avatar

wujia whbzju

  • Zhejiang University
View GitHub Profile
cumsum
select
a.id,
a.sum_all,
sum(a.sum_all) over (order by a.sum_all, a.id
rows between unbounded preceding
and current row)
as csum
from
To remove the line and print the output to standard out:
sed '/pattern to match/d' ./infile
To directly modify the file (and create a backup):
sed -i.bak '/pattern to match/d' ./infile
sed 's/\*/t/g' test.txt > test2.txt
## 异常点去除
for i in COLUMNS_c:
df[i] = df[np.abs(df[i]-df[i].mean())<=(3*df[i].std())][i] #keep only the ones that are within +3 to -3 standard deviations in the column 'Data'.
## 设置格式,显示多一些
pd.set_option('display.height', 1000)
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
@whbzju
whbzju / install_tensorflow_centos7.sh
Created May 24, 2017 02:57 — forked from thoolihan/install_tensorflow_centos7.sh
Install TensorFlow on CentOS7
sudo yum -y install epel-release
sudo yum -y install gcc gcc-c++ python-pip python-devel atlas atlas-devel gcc-gfortran openssl-devel libffi-devel
# use pip or pip3 as you prefer for python or python3
pip install --upgrade virtualenv
virtualenv --system-site-packages ~/venvs/tensorflow
source ~/venvs/tensorflow/bin/activate
pip install --upgrade numpy scipy wheel cryptography #optional
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
# or below if you want gpu, support, but cuda and cudnn are required, see docs for more install instructions
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
@whbzju
whbzju / gist:ff06fce9fd738dcf8096
Created April 9, 2015 11:40
kaggle bike demand
{
"metadata": {
"name": "",
"signature": "sha256:0d5d67fed48737a4ccf557ce3d29560c93921267789dc59251f724c776170828"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [