Skip to content

Instantly share code, notes, and snippets.

View Arkadeep-sophoIITG's full-sized avatar

ARKADEEP Arkadeep-sophoIITG

  • IIT Guwahati
View GitHub Profile
@Arkadeep-sophoIITG
Arkadeep-sophoIITG / perfect.py
Created September 23, 2018 16:56
Solution to the famous sum products and difference puzzle. https://en.wikipedia.org/wiki/Sum_and_Product_Puzzle
#!/usr/bin/env python
from collections import Counter
def decompose_sum(s):
return [(a,s-a) for a in range(1,int(s/2+1))]
def isprime(n):
'''check if integer n is a prime'''
@Arkadeep-sophoIITG
Arkadeep-sophoIITG / shuffle.py
Last active September 6, 2020 13:41
Accepts an input csv file and shuffles the rows using python pandas dataframe
'''
Title : Pandas Row Shuffler
Author : Arkadeep
'''
import numpy as np
import pandas as pd
import sys
arguments = sys.argv[1]
args = arguments.strip('.csv');
@Arkadeep-sophoIITG
Arkadeep-sophoIITG / SlackifyHTML.py
Created December 20, 2017 13:55
Converts HTML to Slack formatted markdown
from html.entities import name2codepoint
from html.parser import HTMLParser
class SlackifyHTML(HTMLParser):
def __init__(self, html, *args, **kwargs):
super().__init__(*args, **kwargs)