Skip to content

Instantly share code, notes, and snippets.

View Hasil-Sharma's full-sized avatar
🎯
Focusing

Hasil Sharma Hasil-Sharma

🎯
Focusing
View GitHub Profile
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
@Hasil-Sharma
Hasil-Sharma / softmax.py
Last active March 30, 2019 21:13
Vectorized softmax calculation using numpy
import numpy as np
def softmax(x):
""" Compute the softmax for each row of the input x
Arguments:
x -- A N dimensional veector or M X N dimensional numpy matrix.
Return:
x -- modified x in-place
"""
@Hasil-Sharma
Hasil-Sharma / in_df1_not_in_df2.py
Created September 22, 2017 23:18
Finding records which are in one DataFrame (df1) and not in other DataFrame (df2)
import pandas as pd
df1['marker'] = 1
joined = pd.merge(df1, df2, on = ['column'], how = 'left')
# Required columns are the ones with marker as NaN
df1 = joined[pd.isnull(joined['marker'])][df1.columns]