def contains(self,
filename: str,
chunk_nr: int) -> bool:
"""
Check whether this data set contains an instance with the specified filename and chunk number.
Parameters
----------
filename: str
The filename of the instance
chunk_nr: int
The chunk number of the instance
Returns
-------
bool
True, if this data set contains an instance with the specified filename and chunk number, False otherwise
"""
if filename not in self._data[_DataVar.FILENAME].values:
return False
instances_with_filename = self._data.where(self._data[_DataVar.FILENAME] == filename)
return chunk_nr in instances_with_filename[_DataVar.CHUNK_NR].values
评论列表
文章目录