Skip to content

Instantly share code, notes, and snippets.

@beannguyen
beannguyen / 101Alpha_code_1.py
Created September 3, 2020 14:10 — forked from kangchihlun/101Alpha_code_1.py
101Alpha_code_1.py
import numpy as np
import pandas as pd
from numpy import abs
from numpy import log
from numpy import sign
from scipy.stats import rankdata
# region Auxiliary functions
def ts_sum(df, window=10):
"""
@beannguyen
beannguyen / xpath_soup.py
Created September 14, 2018 13:29 — forked from ergoithz/xpath_soup.py
Generate unique XPATH for BeautifulSoup element
#!/usr/bin/python
# -*- coding: utf-8 -*-
def xpath_soup(element):
"""
Generate xpath from BeautifulSoup4 element
:param element: BeautifulSoup4 element.
:type element: bs4.element.Tag or bs4.element.NavigableString
:return: xpath as string