Skip to content

Commit

Permalink
Column locator sequence input (#415)
Browse files Browse the repository at this point in the history
* change type hints.

---------

Co-authored-by: Christian Geng <cgeng@audeering.com>
Co-authored-by: Hagen Wierstorf <hwierstorf@audeering.com>
  • Loading branch information
3 people authored Jun 19, 2024
1 parent 839d86e commit 667d169
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions audb/core/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,21 @@ def _add_meta(
def _column_loc(
self,
column: str,
files: typing.Union[str, typing.Sequence[str]],
file: str,
dtype: typing.Callable = None,
) -> typing.Union[typing.Any, typing.List[typing.Any]]:
r"""Column content for selected files."""
value = self._df.at[files, column]
) -> typing.Any:
r"""Column content for selected file.
Args:
column: one of the names in ``Dependencies._schema``
file: row to query, index is a filename
dtype: convert data to dtype
Returns:
scalar value
"""
value = self._df.at[file, column]
if dtype is not None:
value = dtype(value)
return value
Expand Down

0 comments on commit 667d169

Please sign in to comment.