Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

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

[8]ページ先頭

©2009-2025 Movatter.jp