/
PeercoinAnalytics.py
44 lines (40 loc) · 1022 Bytes
/
PeercoinAnalytics.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
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import csv
from datetime import datetime
x = []
y = []
txnconfirmed = []
txndate=[]
txntype=[]
txnlabel=[]
txnaddress=[]
txnamount=[]
txid=[]
SumTotal=0
walbalance=[]
with open('peercoin_txns.csv','r') as csvfile:
csvtxndata = csv.reader(csvfile, delimiter = ',')
txndata = list(csvtxndata)
header = txndata[0]
del txndata[0]
txndata.reverse()
for row in txndata:
txnconfirmed.append(row[0])
formdate=datetime.strptime(row[1], '%Y-%m-%dT%H:%M:%S')
txndate.append(formdate)
txntype.append(row[2])
txnlabel.append(row[3])
txnaddress.append(row[4])
txnamount.append(row[5])
txid.append(row[6])
SumTotal+=float(row[5])
walbalance.append(SumTotal)
x=txndate
y=walbalance
plt.bar(x, y, color = 'g', width = 0.72, label = "Amount")
plt.xlabel('Dates')
plt.ylabel('Sum Total (PPC)')
plt.title('Sum Total of Wallet')
plt.legend()
plt.show()