application_1.py 520 B

12345678910111213
  1. def homepage():
  2. comic_data = comic_data_df.to_dict(orient='records')
  3. comic_data = json.dumps(comic_data, indent=2)
  4. return_comic_data = {'comic_data': comic_data}
  5. feature_names = json.dumps(feature_counts)
  6. return_feature_names = {'feature_names': feature_names}
  7. return render_template('index.html',
  8. return_comic_data=return_comic_data,
  9. num_comics=comic_data_df.shape[0],
  10. return_feature_names=return_feature_names,
  11. num_features=len(feature_counts))