-
Notifications
You must be signed in to change notification settings - Fork 253
Expand file tree
/
Copy pathbuild.py
More file actions
26 lines (22 loc) · 772 Bytes
/
build.py
File metadata and controls
26 lines (22 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# %load q06_get_unique_matches_count/build.py
# Default imports
from greyatomlib.python_intermediate.q05_read_csv_data.build import read_ipl_data_csv
path = 'data/ipl_matches_small.csv'
import numpy as np
# Enter Code Here
def get_unique_matches_count():
varfile=np.genfromtxt(path,dtype='|S20',delimiter=',',skip_header=1,)
varcol=varfile[:,0]
ipl_matches_array = np.count_nonzero(np.unique(varcol))
return ipl_matches_array
varfile=np.genfromtxt(path,dtype='|S20',delimiter=',',skip_header=1,)
get_unique_matches_count()
import numpy as np
path = 'data/ipl_matches_small.csv'
varfile
#for i in varfile: print(i[1],i[2])
#np.unique(varfile[0])
#varfile[0]
#ipl_ctr=np.ndarray(shape=(1,0), dtype=float, order='F')
varcol=varfile[:,0]
np.unique(varcol)