def fix_column_name(val):
 if (val is not None):
  try:
   val = str(val)
  except UnicodeEncodeError:
   if six.PY2:
    raise ValueError(u'Column names must not contain Unicode characters on Python 2')
   raise
 return val

def fix_column_name ( val ) : if ( val is not None ) : try : val = str ( val ) except UnicodeEncodeError : if six . PY2 : raise ValueError ( u'Column names must not contain Unicode characters on Python 2' ) raise return val
fixes column names so that they are compatible with numpy on python 2 .