Skip to content

Instantly share code, notes, and snippets.

View soumilshah1995's full-sized avatar
🎯
happy

Soumil Nitin Shah soumilshah1995

🎯
happy
View GitHub Profile
@soumilshah1995
soumilshah1995 / Date_Dimension.md
Created December 16, 2022 01:41 — forked from alcheng10/Date_Dimension.md
Python (Pandas) function that creates a dimension date with workday flag
import pandas as pd
import holidays

def create_dim_date(start_date, end_date):
    '''
    Create Dimension Date in Pandas
    
    :return df_date : DataFrame
    '''
@soumilshah1995
soumilshah1995 / examples.json
Created October 24, 2022 12:34 — forked from spinscale/examples.json
Elastic Bytes - rank/distance feature
###################################################
## Boosting scores based on numeric field values ##
###################################################
# Existing solution: function_score query
# Problem: Performance penalty
# Solution: Rescoring, only rescoring top-n documents
# Lucene optimization in Elasticsearch 7: Block MAX WAND
# New query: distance_feature, efficiently skips non-competitive hits
class Node(object):
"""
Tree node: left and right child + data which can be any object
"""
def __init__(self, data):
"""
Node Constructor
@param data node data object
"""
self.left = None
@soumilshah1995
soumilshah1995 / scrapeImages.py
Created November 15, 2019 18:21 — forked from genekogan/scrapeImages.py
scraping full size images from Google Images
from bs4 import BeautifulSoup
import requests
import re
import urllib2
import os
import argparse
import sys
import json
# adapted from http://stackoverflow.com/questions/20716842/python-download-images-from-google-image-search