You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sheet_name: an optional label for the sheet to read from. If defined, the codelist will be taken from that sheet. If no sheet_name is defined, the first sheet is taken.
105
+
codelist_name: an optional name of the codelist which to extract. If defined, codelist_column must be present and the codelist_name must occur within the codelist_column.
106
+
code_column: the name of the column containing the codes.
107
+
code_type_column: the name of the column containing the code types.
108
+
codelist_column: the name of the column containing the codelist names.
109
+
"""
110
+
importpandasaspd
111
+
112
+
ifsheet_nameisNone:
113
+
_df=pd.read_excel(path)
114
+
else:
115
+
xl=pd.ExcelFile(path)
116
+
ifsheet_namenotinxl.sheet_names:
117
+
raiseValueError(
118
+
f"Sheet name {sheet_name} not found in the Excel file."
119
+
)
120
+
_df=xl.parse(sheet_name)
121
+
122
+
ifcodelist_nameisnotNone:
123
+
# codelist name is not none, therefore we subset the table to the current codelist
0 commit comments