Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route("/hasil")
- def hasil():
- trainNew = test_pd
- trainNew = gab
- trainNew = trainNew.drop("index", axis=1)
- label = test_pd['Label']
- pos = label[label=='pos']
- neg = label[label=='neg']
- jml_pos = pos.count()
- jml_neg = pos.count()
- jml_label = label.count()
- persen_pos = str(round((jml_pos/jml_label)*100,2))
- persen_neg = str(round((jml_neg/jml_label)*100,2))
- labels = ["Positif","Negative"]
- data = [jml_pos,jml_neg]
- colors = [ "#00a65a", "#dd4b39"]
- return render_template('hasil.html', tables=[trainNew.to_html(classes='table table-striped table-bordered table-hover',header='true',justify='justify',table_id='tabel')],set=zip(data, labels, colors))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement