graphPaname/app/processing.py

18 lines
402 B
Python
Raw Normal View History

2020-06-13 20:57:21 +02:00
from base64 import b64encode
from io import BytesIO
2020-06-14 00:58:52 +02:00
from app.preprocessing import create_dataframe, create_map
2020-06-13 20:57:21 +02:00
2020-06-14 00:58:52 +02:00
def create_table(df) -> str:
2020-06-13 20:57:21 +02:00
df.fillna(value=0, inplace=True)
2020-06-14 00:58:52 +02:00
table = df.to_html(classes=["table-striped", "table-hover"])
return table
2020-06-13 20:57:21 +02:00
def process_data(dataset):
df = create_dataframe(dataset)
2020-06-14 00:58:52 +02:00
table = create_table(df)
2020-06-13 20:57:21 +02:00
map = create_map(df)
2020-06-14 00:58:52 +02:00
return table, map