-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
207 lines (149 loc) · 5.99 KB
/
main.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
df = pd.read_csv("data\data_1602.csv")
collectionName = []
for x in range(len(df)):
if df.id[x] == "B86375904A635FB3":
collectionName.append("Mantle Warriors")
continue
if df.id[x] == "C984F63CDBB8BB0C":
collectionName.append("SneakerLabz OG")
continue
if df.id[x] == "883C86FC2E5D21D1":
collectionName.append("DopeSkulls")
continue
if df.id[x] == "BD3B7129B39506F0":
collectionName.append("CyberAgents")
continue
if df.id[x] == "C395A2ECE13B3B03":
collectionName.append("Cosmo Zombie")
continue
if df.id[x] == "A07FAEF74B59B7F7":
collectionName.append("CDGS AssetMantle Metaverse Warriors")
continue
if df.id[x] == "803C8C529D4C79B6":
collectionName.append("Stone Punks")
continue
if df.id[x] == "90059167EFA307A5":
collectionName.append("Mantle Monkeys")
continue
if df.id[x] == "AF3759D04DD81F27":
collectionName.append("How Rare Is Your Cosmos")
continue
if df.id[x] == "E691345678D3D476":
collectionName.append("Squid Waves")
continue
if df.id[x] == "FA643042634AD34B":
collectionName.append("Neon Corp")
continue
if df.id[x] == "8034E1D7A0B83DAB":
collectionName.append("ChainOps Art")
continue
if df.id[x] == "D73691D95C7250CD":
collectionName.append("Alpha Citizens")
continue
if df.id[x] == "D4C3FD5554AEDB64":
collectionName.append("MintE Memoirs")
continue
collectionName.append("Random Collection")
df.insert(1, "collectionName", collectionName, True)
for x in range(len(df)):
if df.collectionName[x] == "Random Collection":
df = df.drop(x)
df = df.drop(['id', 'totalMinted', 'totalTraded', 'floorPrice', 'salePrice', 'bestOffer', 'owners',
'uniqueOwners', 'createdBy', 'createdOnMillisEpoch', 'updatedBy', 'updatedOnMillisEpoch'], axis=1)
df2 = df.rename(columns={'collectionName': 'Collection', 'totalNFTs': 'Supply', 'totalSold': 'Sold',
'totalVolumeTraded': 'Volume', 'listed': 'Listings', 'publicListingPrice': 'Price'})
df3 = pd.read_csv("data/data_2302.csv")
collectionName = []
for x in range(len(df3)):
if df3.id[x] == "B86375904A635FB3":
collectionName.append("Mantle Warriors")
continue
if df3.id[x] == "C984F63CDBB8BB0C":
collectionName.append("SneakerLabz OG")
continue
if df3.id[x] == "883C86FC2E5D21D1":
collectionName.append("DopeSkulls")
continue
if df3.id[x] == "BD3B7129B39506F0":
collectionName.append("CyberAgents")
continue
if df3.id[x] == "C395A2ECE13B3B03":
collectionName.append("Cosmo Zombie")
continue
if df3.id[x] == "A07FAEF74B59B7F7":
collectionName.append("CDGS AssetMantle Metaverse Warriors")
continue
if df3.id[x] == "803C8C529D4C79B6":
collectionName.append("Stone Punks")
continue
if df3.id[x] == "90059167EFA307A5":
collectionName.append("Mantle Monkeys")
continue
if df3.id[x] == "AF3759D04DD81F27":
collectionName.append("How Rare Is Your Cosmos")
continue
if df3.id[x] == "E691345678D3D476":
collectionName.append("Squid Waves")
continue
if df3.id[x] == "FA643042634AD34B":
collectionName.append("Neon Corp")
continue
if df3.id[x] == "8034E1D7A0B83DAB":
collectionName.append("ChainOps Art")
continue
if df3.id[x] == "D73691D95C7250CD":
collectionName.append("Alpha Citizens")
continue
if df3.id[x] == "D4C3FD5554AEDB64":
collectionName.append("MintE Memoirs")
continue
collectionName.append("Random Collection")
df3.insert(1, "collectionName", collectionName, True)
for x in range(len(df3)):
if df3.collectionName[x] == "Random Collection":
df3 = df3.drop(x)
df3 = df3.drop(['id', 'totalMinted', 'totalTraded', 'floorPrice', 'salePrice', 'bestOffer', 'owners',
'uniqueOwners', 'createdBy', 'createdOnMillisEpoch', 'updatedBy', 'updatedOnMillisEpoch'], axis=1)
totalVolume = 0
totalVolume2 = 0
totalSales = 0
totalSales2 = 0
totalListings = 0
totalVolume = df3.totalVolumeTraded.sum()
totalVolume2 = df.totalVolumeTraded.sum()
totalSales = df3.totalSold.sum()
totalSales2 = df.totalSold.sum()
totalListings = df3.listed.sum()
totalUSDVolume = totalVolume/94.15
format_USD = "{:.2f}".format(totalUSDVolume)
df.reset_index(inplace=True, drop=True)
df3.reset_index(inplace=True, drop=True)
newSales = []
for x in range(len(df3)):
for y in range(len(df)):
if df.collectionName[y] == df3.collectionName[x]:
newSales.append(df3.totalSold[x]-df.totalSold[y])
df3.insert(3, "newSales", newSales, True)
df4 = df3.rename(columns={'collectionName': 'Collection', 'totalNFTs': 'Supply', 'totalSold': 'Sold',
'newSales': 'Sales (1 Week)', 'totalVolumeTraded': 'Volume', 'listed': 'Listings', 'publicListingPrice': 'Price'})
print("\n"+df4.to_string(index=False))
print("\nTotal MNTL Volume = " + str(totalVolume))
print("Total USD Volume = " + str(format_USD))
print("\nMNTL Volume (1 Week) = " + str(totalVolume - totalVolume2))
print("Total NFTs Sold = " + str(totalSales))
print("NFTs sold (1 Week) = " + str(totalSales - totalSales2))
print("Active Listings = " + str(totalListings)+"\n")
# figure, axis = plt.subplots(2, 2)
# axis[0, 0].
plot = df3.plot.pie(y='totalSold', figsize=(
10, 7.5), labels=df3.collectionName, ylabel='')
plt.title('Sales Chart', fontsize=20)
# axis[0, 1].
plot = df3.plot.pie(y='totalVolumeTraded', figsize=(
10, 7.5), labels=df3.collectionName, ylabel='')
plt.title('Volume Chart', fontsize=20)
matplotlib.pyplot.show()