Custom Editors: Autogenerate UI from Any Function
Extend Mito with custom dataframe transformations, like proprietary algorithms, calculations, and domain-specific knowledge.
How to Write Custom Editor
Example: Calculating Moving Average
import pandas as pd
def calculate_moving_average(df, column_to_average, window_size, exponential=False):
"""
Calculate moving average for a given financial time series data.
"""
if exponential:
df['EMA'] = df[column_to_average].ewm(span=window_size, adjust=False).mean()
else:
df['SMA'] = df[column_to_average].rolling(window=window_size).mean()
return dfStep 1: Add types to the function
Step 2: Pass this function to the editors parameter
editors parameterStep 3: Pass some good testing data to the Mito sheet
Step 4: Access the functionality in Mito with the Custom Edits dropdown
Custom Edits dropdown

Supported Types
Last updated
Was this helpful?