Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132922 views
License: OTHER
1
sums = []
2
lengths = []
3
for i in range(0, 1000000000, 1000000):
4
chunk = dset[i: i + 1000000] # pull out numpy array
5
sums.append(chunk.sum())
6
lengths.append(len(chunk))
7
8
total = sum(sums)
9
length = sum(lengths)
10
print(total / length)
11
12