bug fix: with column count

This commit is contained in:
Steve Nyemba 2020-04-15 09:19:49 -05:00
parent b8f59f85d5
commit 02d8588f5b
1 changed files with 6 additions and 6 deletions

View File

@ -155,13 +155,13 @@ class Components :
# df = reader() # df = reader()
df = args['reader']() if 'reader' in args else args['data'] df = args['reader']() if 'reader' in args else args['data']
if 'slice' in args and 'max_rows' in args['slice']: # if 'slice' in args and 'max_rows' in args['slice']:
max_rows = args['slice']['max_rows'] # max_rows = args['slice']['max_rows']
if df.shape[0] > max_rows : # if df.shape[0] > max_rows :
print (".. slicing ") # print (".. slicing ")
i = np.random.choice(df.shape[0],max_rows,replace=False) # i = np.random.choice(df.shape[0],max_rows,replace=False)
df = df.iloc[i] # df = df.iloc[i]