Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manasRK
manasRK / useful_pandas_snippets.py
Created March 7, 2016 11:01 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
@manasRK
manasRK / IASNLP-2016.md
Created June 20, 2016 10:53 — forked from manshri/IASNLP-2016.md
IASNLP 2016 Project list

IASNLP-2015 Project list

LTRC, IIIT-Hyderabad

Treebanking

#####1. Shallow Parsers for different languages#####

  • Description - POS Tagging and Chunking for Gujarati,Odia, Hindi, Bengali, Marathi, Telugu (individual project for each language)
  • We will implement many supervised algorithms including CRF, HMM, MaxEnt, SVM, some semi-supervised classification methods, finally an unsupervised one. Will try to implement Morph Analyzer if time permits. students need to annotate data, understand the challenges, compare results given by multiple
  • Mentor: Pruthwik M
@manasRK
manasRK / tf-idf.py
Created August 8, 2016 17:19 — forked from michael-erasmus/tf-idf.py
Tf-idf example
import os
import math
import re
import pandas as pd
from collections import Counter
from sklearn.datasets import fetch_20newsgroups
#get a subset of the dataset
categories = [
@manasRK
manasRK / tmux-cheatsheet.markdown
Created August 12, 2016 18:37 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@manasRK
manasRK / rank_metrics.py
Created September 14, 2016 15:20 — forked from bwhite/rank_metrics.py
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@manasRK
manasRK / git_basics.md
Last active November 29, 2016 04:24
Git Basics for Beginners

If you deleted a file from the working tree, then commit the deletion:

$git commit -a -m "A file was deleted"

When you do a pull request on a branch, you can continue to work on another branch and make another pull request on this other branch.

Before creating a new branch, pull the changes from upstream. Your master needs to be up to date.

Create the branch on your local machine and switch in this branch :

@manasRK
manasRK / README.md
Created December 5, 2016 15:02 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@manasRK
manasRK / pad_packed_demo.py
Created December 28, 2017 05:10 — forked from Tushar-N/pad_packed_demo.py
How to use pad_packed_sequence in pytorch
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import torch.nn.functional as F
import numpy as np
import itertools
def flatten(l):
return list(itertools.chain.from_iterable(l))