human
Write me a Python function to sort data within a column.
assistant
Here is a Python function to sort data within a column

import pandas as pd

def sort_data(df, column):
        """Sorts data within a column."""
        return df.sort_values(by=column)

# Enter the dataframe
df = pd.DataFrame({'col1': [1, 2, 3, 4, 5],
                    'col2': ['a', 'b', 'c', 'd', 'e']})

# Calling the function
df = sort_data(df, 'col1')

# Printing the dataframe
print(df)

#Example Output

#    col1 col2
# 0     1    a
# 1     2    b
# 2     3    c
# 3     4    d
# 4     5    e

#Remember to inspect code for bugs.