I want to have an option in the table in my site that allows the user to rearrange the table by min or max value in a specific column, but couldn't find anything about this.
The dataset I am using is this: https://raw.githubusercontent.com/plotly/datasets/master/bubble_chart_tutorial.csv
I want the GDP per capita column to be rearranged.
Tried using
df.groupby(['country'], as_index=False)['GDP per capita'].max()
df = pd.read_csv(DBPath).rename_axis('id', axis = 1)
db_table = df.to_html(escape=False)
fig1, ax1 = plt.subplots()
plt.ylabel('Amount of Countries')
plt.xlabel('Life Expectancy')
df['life expectancy'].hist()
fig2, ax2 = plt.subplots()
plt.ylabel('Amount of Countires')
plt.xlabel('GDP per capita')
df['GDP per capita'].hist()
fig3, ax3 = plt.subplots()
encoded1 = fig_to_base64(fig1)
plot_img1 = '<img src="data:image/png;base64, {}">'.format(encoded1.decode('utf-8'))
encoded2 = fig_to_base64(fig2)
plot_img2 = '<img src="data:image/png;base64, {}">'.format(encoded2.decode('utf-8'))
encoded3 = fig_to_base64(fig3)
plot_img3 = '<img src="data:image/png;base64, {}">'.format(encoded3.decode('utf-8'))
This is the function for the table in my site.