def make_cascading_boolean_array(shape, first_value=True):
 if (len(shape) != 2):
  raise ValueError('Shape must be 2-dimensional. Given shape was {}'.format(shape))
 cascading = np.full(shape, (not first_value), dtype=np.bool)
 ending_col = (shape[1] - 1)
 for row in cascading:
  if (ending_col > 0):
   row[:ending_col] = first_value
   ending_col -= 1
  else:
   break
 return cascading

def make_cascading_boolean_array ( shape , first_value = True ) : if ( len ( shape ) != 2 ) : raise ValueError ( 'Shape must be 2-dimensional. Given shape was {}' . format ( shape ) ) cascading = np . full ( shape , ( not first_value ) , dtype = np . bool ) ending_col = ( shape [ 1 ] - 1 ) for row in cascading : if ( ending_col > 0 ) : row [ : ending_col ] = first_value ending_col -= 1 else : break return cascading
create a numpy array with the given shape containing cascading boolean values .