Skip to content

Instantly share code, notes, and snippets.

View hendra-herviawan's full-sized avatar

M Hendra Herviawan hendra-herviawan

View GitHub Profile
{
"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,
@hendra-herviawan
hendra-herviawan / apply_df_by_multiprocessing.py
Last active January 30, 2023 03:03 — forked from yong27/apply_df_by_multiprocessing.py
pandas DataFrame apply multiprocessing
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')
#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() ]
#
@hendra-herviawan
hendra-herviawan / bashrc
Last active January 5, 2018 14:45
.Dotfile
#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
# 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
@hendra-herviawan
hendra-herviawan / AkwardGit.sh
Last active June 24, 2018 03:27
snipped_201712
#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
@hendra-herviawan
hendra-herviawan / Archlinux on X220i
Last active February 19, 2017 03:58
Archlinux on X220i
We couldn’t find that file to show.