Created
October 23, 2018 18:44
-
-
Save icexelloss/65388355b4532cbaab16e93aefc0dc08 to your computer and use it in GitHub Desktop.
flint_boxcox
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 scipy import stats | |
@udf('double') | |
def boxcox(v): | |
return pd.Series(stats.boxcox(v)[0]) | |
df = … | |
# time, v | |
# 20180101, 1.0 | |
# 20180101, 2.0 | |
# 20180101, 3.0 | |
df = df.addColumnsForCycle({'v_boxcox': boxcox(df['v'])}) | |
# time, v, v_boxcox | |
# 20180101, 1.0, 0.0 | |
# 20180101, 2.0, 0.852 | |
# 20180101, 3.0, 1.534 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment