<commit_before>    #-*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import os
import glob
import re
import xmltodict
    
    
class transport:
    
    @staticmethod
    def jumpfix(df, meas, threashold=0.005):
        '''
        removes jumps or jolts in time series data (where offset is lasting)<commit_msg>added rollmmeandiff<commit_after>    #-*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import os
import glob
import re
import xmltodict
    
    
class transport:

    @staticmethod
    def rollmeandiff(df1,p1,df2,p2,win):
        '''
        returns the rolling mean difference of two columns from two different dataframes
        df1 = dataframe 1
        p1 = column in df1
        df2 = dataframe 2
        p2 =column in df2
        win = window in days
        '''
        win = win*60*24
        df1 = df1.resample('1Min').mean()
        df1 = df1.interpolate(method='time')
        df2 = df2.resample('1Min').mean()
        df2 = df2.interpolate(method='time')
        df1['rm'+p1] = df1[p1].rolling(window=win, center=True).mean()
        df2['rm'+p2] = df2[p2].rolling(window=win, center=True).mean()
        df3 = pd.merge(df1,df2,left_index=True, right_index=True, how='outer')
        df3 = df3[np.isfinite(df3['rm'+p1])]
        df4 = df3[np.isfinite(df3['rm'+p2])]
        df5 = df4['rm'+p1] - df4['rm'+p2]
        diff = round(df5.mean(),3)
        del (df3,df4,df5)
        return diff
    
    @staticmethod
    def jumpfix(df, meas, threashold=0.005):
        '''
        removes jumps or jolts in time series data (where offset is lasting)
{'fraction_non_alphanumeric': 0.12413793103448276, 'fraction_numerical': 0.04075235109717868, 'mean_word_length': 2.447084233261339, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1854305', 'n_tokens_mistral': 564, 'n_tokens_neox': 549, 'n_words': 142}