def if_pandas_df_convert_to_numpy(obj):
if pd is not None and isinstance(obj, pd.DataFrame):<EOL><INDENT>return obj.values<EOL><DEDENT>else:<EOL><INDENT>return obj<EOL><DEDENT>
Return a Numpy array from a Pandas dataframe.

    Iterating over a DataFrame has weird side effects, such as the first
    row being the column names. Converting to Numpy is more safe.