🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

data upsampling with python pandas

User: "Katharina_MUL"
New Altair Community Member
Updated by Jocelyn

Hello,

 

so I have a little problem. I'd like to upsample my data (timestamp+9 attributes) with python pandas in RapidMiner. In Jupyter it's working fine, but as soon as I'm using the code in the "Execute Python" operator, it won't work. In the result, there a missing values and my timestamp is gone.

One big issue could be the timestamp. The format is like " YYYY-MM-dd HH:mm:ss.SSS" and I'd like to upsample the data to 100 ms. So RapidMiner doesn't show me the format, since it's cutting off the miliseconds.

Do you have any ideas?

Thanks!

 

Code for Jupyter:

import pandas as pd
df = pd.read_csv('aufgefuellt.csv', header=0, sep =';', parse_dates=True)
df['Datum'] = pd.to_datetime(df['Datum'], format='%d-%m-%Y %H:%M:%S.%f')
df.set_index('Datum')
df1 = df.reset_index().set_index('Datum').resample('0.1S').mean()
del df1['index']
df2=df1

 

Code in RapidMiner:

import pandas as pd
def rm_main(data):
data['timestamp'] = pd.to_datetime(data['timestamp'], format='%Y-%m-%d %H:%M:%S.%f')
df1 = data.reset_index().set_index('timestamp').resample('0.1S').mean()
return df1

 

 

 

 

Find more posts tagged with

Comments

No comments on this post.