'Jupyter dropdown menu to choose graph based on column name

I would like to make a dropdown menu that shows each column name from the dataset, and the user can choose a column to visualize the data. With Python this code is:

for i in df.columns:
    plt.figure(figsize = (10,6))
    plt.title("Count vs "+i)
    sns.histplot(data = df, x = i, element = 'bars')

I have tried the following code, which does not account for each column name, nor does it output charts similar to the above code.

def f(x):
    return x

def f(age):
    df.loc[age].iplot(
                    xTitle='Year', 
                    yTitle='Count of {}'.format(age),
                    title='Count per Age'
                     )

interact(f, age=df.index)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source