Created
January 30, 2018 18:50
-
-
Save lettergram/3b408a50ef403668b0c8c48514409a72 to your computer and use it in GitHub Desktop.
Resamples dataframe example for https://blog.projectpiglet.com
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 | |
import scipy.stats as ss | |
from scipy import signal | |
# Outer Join, Fill NaN | |
combined_df = first_df.join(second_df, how='outer').fillna(method='ffill').fillna(0.0) | |
# Resample first_df and second_df to be the same size | |
combiend_df[col1] = ss.zscore(signal.resample(first_df[col1], len(comb_df))) | |
combined_df[col2] = ss.zscore(signal.resample(np.diff(second_df[col2]), len(comb_df))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment