Skip to content

Commit

Permalink
Update new_lists.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Nora-Olivia-Ammann committed Apr 26, 2024
1 parent 878794a commit 20203f7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/dsp_tools/commands/excel2json/new_lists.py
Expand Up @@ -119,6 +119,13 @@ def _get_labels(row: pd.Series[Any], columns: list[str]) -> dict[str, str]:
Provided a df row and a list of column titles,
create a mapping from language codes to the label of that language.
(The label comes from the Excel cell at the intersection of the row with the column.)
Parameters:
row: A pandas Series representing a row of a DataFrame.
columns: A list of column names.
Returns:
A dictionary with language codes as keys and the corresponding labels as values.
"""
return {
lang: row[col]
Expand Down

0 comments on commit 20203f7

Please sign in to comment.