def to_feather(df, path):
path = _stringify_path(path)<EOL>if not isinstance(df, DataFrame):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>feather = _try_import()[<NUM_LIT:0>]<EOL>valid_types = {'<STR_LIT:string>', '<STR_LIT>'}<EOL>if not isinstance(df.index, Int64Index):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>type(df.index)))<EOL><DEDENT>if not df.index.equals(RangeIndex.from_range(range(len(df)))):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if df.index.name is not None:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if df.columns.inferred_type not in valid_types:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>feather.write_feather(df, path)<EOL>
Write a DataFrame to the feather-format

Parameters
----------
df : DataFrame
path : string file path, or file-like object