Commit
·
af45389
1
Parent(s):
b2daa87
feature: 6 six rounding to dataframe
Browse files- agent/dashboard/data.py +10 -1
agent/dashboard/data.py
CHANGED
|
@@ -2,8 +2,17 @@ import solara
|
|
| 2 |
import pandas as pd
|
| 3 |
from typing import Optional, cast
|
| 4 |
import solara.express as solara_px
|
|
|
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
state = solara.reactive(
|
| 9 |
{
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
from typing import Optional, cast
|
| 4 |
import solara.express as solara_px
|
| 5 |
+
import numpy as np
|
| 6 |
|
| 7 |
+
def read_data():
|
| 8 |
+
df = pd.read_csv('agent/data/averaged_full_state_data.csv')
|
| 9 |
+
df = df.infer_objects()
|
| 10 |
+
for col in df.columns:
|
| 11 |
+
if df.dtypes[col] == np.float64:
|
| 12 |
+
df[col] = df[col].apply(lambda x: round(x, 6))
|
| 13 |
+
return df
|
| 14 |
+
|
| 15 |
+
df = read_data()
|
| 16 |
|
| 17 |
state = solara.reactive(
|
| 18 |
{
|