I've a pandas dataframe with some analisis and need to filter and print in html by flask only X latest rows with upper or down arrows.
I am trying to make the code but I am making a tremendous mess between so much data and how to pass it to the html. I have this part but it doesn't work. Any idea to made it posible?
from flask import Flask,render_template
df = pd.read_csv('data.csv')
@app.route('/')
def index():
lastdates = 5
product = {
"brand":"Dyson",
"model":"mod2019"
}
mod2019 = df['mod2019']
result2019 = mod2019.tail(lastdates).values[0]
if result2019 == '