- API reference
- pandas arrays, scalars, and data types
- pandas.api.t...
pandas.api.types.is_file_like#
- pandas.api.types.is_file_like(obj)[source]#
Check if the object is a file-like object.
For objects to be considered file-like, they mustbe an iterator AND have either aread and/orwritemethod as an attribute.
Note: file-like objects must be iterable, butiterable objects need not be file-like.
- Parameters:
- objThe object to check
- Returns:
- bool
Whetherobj has file-like properties.
Examples
>>>importio>>>frompandas.api.typesimportis_file_like>>>buffer=io.StringIO("data")>>>is_file_like(buffer)True>>>is_file_like([1,2,3])False
On this page