Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import numpy as np
|
|
5 |
import pandas as pd
|
6 |
import os
|
7 |
from datasets import load_dataset
|
8 |
-
|
9 |
|
10 |
Secret_token = os.getenv('token')
|
11 |
|
@@ -16,6 +16,10 @@ taraf_info = dataset2.to_pandas()
|
|
16 |
cities = taraf_info['City'].unique().tolist()
|
17 |
min_year = int(taraf_info['Year'].min())
|
18 |
max_year = int(taraf_info['Year'].max())
|
|
|
|
|
|
|
|
|
19 |
|
20 |
def subsetEdges(city, year):
|
21 |
info = taraf_info[(taraf_info['Year'] == year) & (taraf_info['City'] == city)]
|
|
|
5 |
import pandas as pd
|
6 |
import os
|
7 |
from datasets import load_dataset
|
8 |
+
import matplotlib.pyplot as plt
|
9 |
|
10 |
Secret_token = os.getenv('token')
|
11 |
|
|
|
16 |
cities = taraf_info['City'].unique().tolist()
|
17 |
min_year = int(taraf_info['Year'].min())
|
18 |
max_year = int(taraf_info['Year'].max())
|
19 |
+
cmap = plt.colormaps['cool']
|
20 |
+
def value_to_hex(value):
|
21 |
+
rgba_color = cmap(value)
|
22 |
+
return "#{:02X}{:02X}{:02X}".format(int(rgba_color[0] * 255), int(rgba_color[1] * 255), int(rgba_color[2] * 255))
|
23 |
|
24 |
def subsetEdges(city, year):
|
25 |
info = taraf_info[(taraf_info['Year'] == year) & (taraf_info['City'] == city)]
|