def validate_dataframe(array):
 from numbers import Number
 for vector in array:
  if isinstance(vector[0], Number):
   if (not all((isinstance(item, Number) for item in vector))):
    raise exceptions.PlotlyError('Error in dataframe. Make sure all entries of each column are either numbers or strings.')
  elif isinstance(vector[0], str):
   if (not all((isinstance(item, str) for item in vector))):
    raise exceptions.PlotlyError('Error in dataframe. Make sure all entries of each column are either numbers or strings.')

def validate_dataframe ( array ) : from numbers import Number for vector in array : if isinstance ( vector [ 0 ] , Number ) : if ( not all ( ( isinstance ( item , Number ) for item in vector ) ) ) : raise exceptions . PlotlyError ( 'Error in dataframe. Make sure all entries of each column are either numbers or strings.' ) elif isinstance ( vector [ 0 ] , str ) : if ( not all ( ( isinstance ( item , str ) for item in vector ) ) ) : raise exceptions . PlotlyError ( 'Error in dataframe. Make sure all entries of each column are either numbers or strings.' )
validates all strings or numbers in each dataframe column :raises: if there are any two items in any list whose types differ .