def convert(values):
dtype = values.dtype<EOL>if is_categorical_dtype(values):<EOL><INDENT>return values<EOL><DEDENT>elif is_object_dtype(dtype):<EOL><INDENT>return values.ravel().tolist()<EOL><DEDENT>if needs_i8_conversion(dtype):<EOL><INDENT>values = values.view('<STR_LIT>')<EOL><DEDENT>v = values.ravel()<EOL>if compressor == '<STR_LIT>':<EOL><INDENT>_check_zlib()<EOL>if dtype == np.object_:<EOL><INDENT>return v.tolist()<EOL><DEDENT>v = v.tostring()<EOL>return ExtType(<NUM_LIT:0>, zlib.compress(v))<EOL><DEDENT>elif compressor == '<STR_LIT>':<EOL><INDENT>_check_blosc()<EOL>if dtype == np.object_:<EOL><INDENT>return v.tolist()<EOL><DEDENT>v = v.tostring()<EOL>return ExtType(<NUM_LIT:0>, blosc.compress(v, typesize=dtype.itemsize))<EOL><DEDENT>return ExtType(<NUM_LIT:0>, v.tostring())<EOL>
convert the numpy values to a list