# Return From Methods

**URL:** <https://discuss.streamlit.io/t/return-from-methods/9287>\
**Category:** Using Streamlit\
**Created:** [January 29, 2021, 8:44am UTC](https://discuss.streamlit.io/t/return-from-methods/9287 "2021-01-29T08:44:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhinavkrdeeps](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/abhinavkrdeeps/32/5491_2.png) [@abhinavkrdeeps](https://discuss.streamlit.io/u/abhinavkrdeeps)\
**Post date:** [January 29, 2021, 8:44am UTC](https://discuss.streamlit.io/t/return-from-methods/9287/1 "2021-01-29T08:44:26Z")

</div>

Hi, I am defining a method where i want to do some changes in the dataframe and want that change to reflect in the caller mehod. But the changes are not shown.

Below is the code. i have two options, feature extraction andbuild models which call two different methods. If user chooses feature extraction i will call feature\_engineering(df) and do some changes and then when user chooses build model , i want to call build\_model(df) with the new dataframe that i get from feature\_engineering(df). But not i am not able to get it.

```python
    if menu == "Feature Extraction":
    		st.title("Feature Engineering")
    		df = feature_engineering(df)

   if menu == "Build Models On Your Data":
		build_models(df)

def feature_engineering(df):
	if 'Exited' in list(df.columns.values):
		df.drop('Exited', axis=1, inplace=True)
	if 'Surname' in list(df.columns.values):
		df.drop('Surname', axis=1,inplace=True)

```

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [February 7, 2022, 3:52pm UTC](https://discuss.streamlit.io/t/return-from-methods/9287/2 "2022-02-07T15:52:38Z")

</div>


