Last active
October 7, 2021 14:12
-
-
Save fabiom91/afb7b7f213ba9d202bdcf0e01fe6f361 to your computer and use it in GitHub Desktop.
minimal flask app 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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