Skip to content

Instantly share code, notes, and snippets.

@fabiom91
Last active October 7, 2021 14:12
Show Gist options
  • Save fabiom91/afb7b7f213ba9d202bdcf0e01fe6f361 to your computer and use it in GitHub Desktop.
Save fabiom91/afb7b7f213ba9d202bdcf0e01fe6f361 to your computer and use it in GitHub Desktop.
minimal flask app 2
from flask import Flask
import pandas as pd
app = Flask(__name__)
@app.route("/")
def hello_world():
mydata = {
"name":["John","Danny","Patricia","Rose"],
"office":["HR","Sales","Sales","HR"],
"salary":[55,67,58,60]
}
df = pd.DataFrame(mydata)
mean_salary = df['salary'].mean()
return "The mean salary is %f" % mean_salary
if __name__ == "__main__":
app.run(host='0.0.0.0', debug=True, port=80)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment