-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
58 lines (43 loc) · 1.15 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from flask import Flask,render_template,request,session,redirect
import pandas as pd
import numpy as np
import os
import random
import mysql.connector
import re
import requests
import codecs
import pandas as pd
import html
requests.packages.urllib3
app= Flask(__name__)
@app.route('/')
def land():
return render_template('land.html')
@app.route('/customer.html')
def test():
return render_template('customer.html')
@app.route('/customer1.html', methods = ['POST'])
def test1():
males=request.form['males']
females=request.form['females']
mini=request.form['min']
maxi=request.form['max']
park=request.form['park']
bd=request.form['bd']
area=request.form['area']
path=os.getcwd()+"\\filtered3.csv"
raw_data=pd.read_csv(path)
print(path)
l=[]
low=(int)(mini)
high=(int)(maxi)
bhk=(int)(bd)
parking=(int)(park)
data=raw_data.loc[raw_data['AREA'] == area]
e_data=data[(data["Estimate"]>=low) & (data["Estimate"]<=high)]
r_data=e_data[(e_data["N_ROOM"]==bhk)]
print(r_data)
r_data.to_csv('result.csv')
return render_template('list.html', n = area)
app.run(debug=True)