This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib notebook | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import colors as mcolors | |
class DynamicPlot(): | |
colors = list(mcolors.cnames.values()) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from tqdm import tqdm | |
def jaccard_sim(doc1, doc2, thres=0.9): | |
return len(doc1 & doc2) / len(doc1 | doc2) > thres | |
def duplicated(df, textcol, func, **kwargs): | |
"""Simlarly to pd.duplicated it finds the duplicated rows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def chunk(seq, size): | |
return (seq[pos:pos + size] for pos in range(0, len(seq), size)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import numpy as np | |
import pandas as pd | |
from pandas.util.testing import makeIntIndex, rands_array | |
class RandomDataFrame: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Non-blocking exception catching context manager with step skipping and | |
lightweight logging and reporting capabilities. | |
2021 - Andras Fulop @fulibacsi""" | |
import json | |
import sys | |
import traceback | |
import warnings |