-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestFeatures.py
38 lines (33 loc) · 898 Bytes
/
testFeatures.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
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
# df = px.data.tips()
#
# fig = px.treemap(df, path=["day", "time", "tip"], values="total_bill", color="sex")
# print(df.head())
#
df = pd.read_excel("Data/Overview of the savings.xlsx")
# df["Maximum savings"] = df["Maximum savings"].astype(int)
print(df.head())
# fig = px.treemap(
# df,
# path=[
# "Star Rating",
# "Construction weight",
# "Maximum savings",
# ],
# names="Maximum savings",
# values="Percentage o buildings",
# # color="sex",
# )
# fig.update_layout(
# uniformtext=dict(minsize=10, mode="hide"), # margin=dict(t=50, l=25, r=25, b=25
# font={"size": 30},
# )
fig = px.sunburst(
df,
path=["Star Rating", "Construction weight"],
values="Percentage o buildings",
)
fig.update_traces(textinfo="label+percent entry")
fig.show()