dear boss
I have seven columns in my DataFrame and I want to count five columns while obtaining the maximum value from only one column. I attempted to do this, but Streamlit returned an error. Please review my code.
import pandas as pd
data = {
"Col1": \[1, 2,2, 3\],
"Col2": \["A", "B","aB", "C"\],
"Col3": \[4.5, 5.5,52.5, 6.5\],
"Col4": \[True, False,False, True\],
"Col5": \["X", "Y","2Y", "Z"\],
"Col6": \[10, 20, 32,30\],
"Col7": \["High", "Low","Low", "Medium"\]
}
# Create the DataFrame
df = pd.DataFrame(data)
st.write(df)
df2 =df.groupby(‘group_column’).agg( id_count=(‘ID’, ‘count’), max_age=(‘age’, ‘max’))
st.write(df2)
please give me right solution
thank you in advance