Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

visualizer.py 1.1 KB

You have to be logged in to leave a comment. Sign In
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
  1. # Created by: leo
  2. # Created on: 2018.10.30
  3. import matplotlib.pyplot as plt
  4. import pandas as pd
  5. from max_current import string_coef_maxcur
  6. inpfiles = ['ycz2505.csv', 'ycz3208.csv', 'ycz3602.csv', 'ycz3608.csv',
  7. 'ycz3611.csv', 'ycz6502.csv', 'ycz6604.csv']
  8. string_ids = [12, 16, 16, 2, 4, 1, 2]
  9. for file, str_id in zip(inpfiles, string_ids):
  10. raw = pd.read_csv('data/' + file, usecols=[0,4,6],
  11. index_col = 0).dropna()
  12. raw.index = pd.to_datetime(raw.index)
  13. months = raw.groupby(pd.Grouper(freq='M'))
  14. month_max_current = months['value'].max()
  15. daily = raw.groupby(pd.Grouper(freq='D'))
  16. normal_cur = daily.filter(lambda x: x['value'].max() > 2).groupby(pd.Grouper(freq='D'))
  17. low_cur = daily.filter(lambda x: x['value'].max() <= 2).groupby(pd.Grouper(freq='D'))
  18. coefs = low_cur.apply(string_coef_maxcur, str_id)
  19. plt.scatter(coefs.index, coefs, alpha=0.5, s=10, marker='x')
  20. plt.xticks(rotation=70)
  21. # print(file)
  22. # print(coefs)
  23. # plt.show()
  24. plt.xlabel('Date')
  25. plt.ylabel('String Coeffients')
  26. plt.title('Coeffients of Strings')
  27. plt.grid()
  28. plt.legend(inpfiles)
  29. plt.show()
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...