Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/normalisasi')
- def normalisasi():
- connection = mysql.connect()
- df = pd.read_sql_query("SELECT rumah_tangga, niaga_kecil, niaga_besar, sosial_umum, sosial_khusus, pemerintah, tnipolri, industri_kecil, industri_besar, target FROM tb_dataset", connection);
- normalisasi = (df - df.min()) / (df.max() - df.min())*0.8+0.1
- data = pd.fetchall()
- return render_template('normalisasi.html', data = data)
- <tbody>
- {% for item in data %}
- <tr>
- <td>{{item[0]}}</td>
- <td>{{item[1]}}</td>
- <td>{{item[2]}}</td>
- <td>{{item[3]}}</td>
- <td>{{item[4]}}</td>
- <td>{{item[5]}}</td>
- <td>{{item[6]}}</td>
- <td>{{item[7]}}</td>
- <td>{{item[8]}}</td>
- <td>{{item[9]}}</td>
- <td>{{item[10]}}</td>
- </tr>
- {% endfor %}
- </tbody>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement