Black Lives Matter. Please consider donating to Black Girls Code today.

How to make callback function with only inputs

Hello.
I’m really interesting make the web page with dash plotly.
while making the app. I had a problem. please help me.

I want to make dynamic controller to erase the typos in pandas DataFrame format.
So i want to fix the typo with dynamic controller.

Scenario is like bellow.

First I load the data.
Second i choose specific column(‘column_name’) and get category using panda.Dataframe[‘column_name’].unique() function
for example
if panda.Dataframe[‘column_name’].unique() get [High, Middle, Low, Loow, midle]
There are two typos ‘Loow’, ‘midle’ in result.

In below code, CI means user dash_core_components.Input like [High, Middle, Low]
code : typo_list = df[~df[column_name].str.lower().isin([x.strip().lower() for x in CI])][column_name].unique()
typo_list = [Loow, midle]

I want to replace Loow to Low, midle to Middle using dash_core_components.Input
There are one input id and one button id ( ‘after replace’, ‘confirm_replace’)

My thought flow is like that using python code.

for t[quote=“tolry418, post:1, topic:37689, full:true”]
Hello.
I’m really interesting make the web page with dash plotly.
while making the app. I had a problem. please help me.

I want to make dynamic controller to erase the typos in pandas DataFrame format.
So i want to fix the typo with dynamic controller.

Scenario is like bellow.

First I load the data.
Second i choose specific column(‘column_name’) and get category using panda.Dataframe[‘column_name’].unique() function
for example
if panda.Dataframe[‘column_name’].unique() get [High, Middle, Low, Loow, midle]
There are two typos ‘Loow’, ‘midle’ in result.

In below code, CI means user dash_core_components.Input like [High, Middle, Low]
code : typo_list = df[~df[column_name].str.lower().isin([x.strip().lower() for x in CI])][column_name].unique()
typo_list = [Loow, midle]

I want to replace Loow to Low, midle to Middle using dash_core_components.Input
There are one input id and one button id ( ‘after replace’, ‘confirm_replace’)

My thought flow is like that using python code.

for typo_list in typo_list:
    @dash_app.callback([Input('after_replace', 'value'), Input('confirm_replace', 'n_clicks')])
     def replace(after_replace, confirm_replace):  
         df[~df[column_name].str.lower().isin([x.strip().lower() for x in CI])][column_name].replace(typo, after_replace)
         if confirm_replace==1:
             return df.to_json(data_format='iso', orient='split')

My point is that i want to use only Inputs for interacting with data and get edited data by human input .
Is it possible?

PLEASE HELP ME.
Thank you in advance.