Skip to content

Instantly share code, notes, and snippets.

View shashankqv's full-sized avatar
🎯
Focusing

Shashank Vivek shashankqv

🎯
Focusing
View GitHub Profile
@shashankqv
shashankqv / tsv_to_csv.py
Created July 18, 2018 15:34
convert tsv file to csv file
import pandas as pd
import numpy as np
tsv_file_name='name.tsv'
csv_table=pd.read_table(tsv_file_name,sep='\t')
csv_table.to_csv('new_name.csv',index=False)
SET GLOBAL general_log = 'ON';
@shashankqv
shashankqv / minimalcombinatiorial.py
Created December 18, 2013 05:54
Minimal Combinatorial : Given two integers - n and r, your task is to calculate the combinatorial nCr. nCr = n! / r! (n-r)!
import sys
from operator import mul
from fractions import Fraction
def mf(n,k):
return int( reduce(mul, (Fraction(n-i, i+1) for i in range(k)), 1) )
lines = sys.stdin.readlines()
for i in range(len(lines)):
lines[i] = lines[i].replace('\n','')
if i > 0:
@shashankqv
shashankqv / soinput.py
Created December 17, 2013 17:42 — forked from fyears/soinput.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
usage:
cat about.txt | python soinput.py
'''
import sys
@shashankqv
shashankqv / solver.py
Last active December 31, 2015 00:09
Jumble Solver : A small command line application that takes the jumbled input string and prints out all correct english words with the same set of characters. The set of words are listed in the dictionary file.
import sys
################################################
# This fuction searches the words in dictionary#
# Input Parameters : Jumbled Word #
# Return type : A list containing valid words #
################################################
def wordsearch(jumbledWord):
matchList = [] # Creating an empty list