import pandas as pd
import holidays
def create_dim_date(start_date, end_date):
'''
Create Dimension Date in Pandas
:return df_date : DataFrame
'''
This file contains hidden or 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
################################################### | |
## 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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 |