This file contains 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
{ | |
"created_at" : "Thu Jun 19 04:17:56 +0000 2014", | |
"id" : 479478159050420200, | |
"id_str" : "479478159050420224", | |
"text" : "RT @FIFAWorldCup: A dramatic #WorldCup matchday 7 reviewed @onsoranje @SeFutbol @anfpchile @Socceroos @HNS_CFF - http://t.co/rJqOLG0cvE htt…", | |
"source" : "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>", | |
"truncated" : false, | |
"in_reply_to_status_id" : null, | |
"in_reply_to_status_id_str" : null, | |
"in_reply_to_user_id" : null, |
This file contains 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 multiprocessing | |
import pandas as pd | |
import numpy as np | |
def _apply_df(args): | |
df, func, kwargs = args | |
return df.apply(func, **kwargs) | |
def apply_by_multiprocessing(df, func, **kwargs): | |
workers = kwargs.pop('workers') |
This file contains 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
#Print row with coloumb missing value | |
#https://stackoverflow.com/questions/37366717/pandas-print-column-name-with-missing-values | |
train_df[train_df['cat_1'].isnull().tolist() ] | |
# |
This file contains 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
#NVidia Cuda | |
export PATH="/usr/local/cuda/bin:~/bin/:$PATH" | |
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64::/usr/local/cuda/extras/CUPTI/lib64" | |
export CUDA_HOME=/usr/local/cuda | |
#Anaconda | |
export PATH=/home/x/.local/bin/intelpython3/bin:$PATH | |
export PATH="$PATH:$HOME/bin" | |
#powerline |
This file contains 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
# https://bbengfort.github.io/tutorials/2016/05/19/text-classification-nltk-sckit-learn.html | |
import string | |
from nltk.corpus import stopwords as sw | |
from nltk.corpus import wordnet as wn | |
from nltk import wordpunct_tokenize | |
from nltk import WordNetLemmatizer | |
from nltk import sent_tokenize | |
from nltk import pos_tag |
This file contains 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
#https://stackoverflow.com/questions/10622179/how-to-find-identify-large-files-commits-in-git-history | |
git rev-list --objects --all \ | |
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \ | |
| awk '/^blob/ {print substr($0,6)}' \ | |
| sort --numeric-sort --key=2 \ | |
| cut --complement --characters=13-40 \ | |
| numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest |