-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_perf.py
53 lines (35 loc) · 1.15 KB
/
create_perf.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import pandas as pd
from novem import Plot
# let's grab some sample data
df = pd.read_csv('https://data.novem.no/v1/examples/plot/nei_rgn_perf.csv', index_col=0)
plt = Plot('nei_rgn_perf', type='line')
# add our data
df.pipe(plt)
# name of the visualisation
plt.name = "Novem Example Index - Performance History"
# set colored lines as label format
plt.config.legend.format = "%cl %l"
# summary for listings
plt.summary = "Performance history by region"
# add a caption to the table
plt.caption = """The above chart shows the Year To Date performance for the
Novem Example Index (NEI) as well as the performance of the key underlying regions.
Regional performance show the total performance of the region and not it's
contribution to the aggregate NEI.
"""
# share it with the world
plt.shared += 'public'
# share it with ai
plt.shared += 'chat'
# let's print our url
print(plt.url) # https://novem.no/p/NJy4w
with open(__file__,'r') as f:
ctnt = f.read().replace('````','```') # turtles
desc = f"""
# Novem Example Index - Performance history by region
A line chart showing historical performance by region
````
{ctnt}
````
"""
plt.description = desc