Skip to content
Snippets Groups Projects
Commit 5cbd9a40 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: refactor for missing obligatory columns

parent 1b7e2bb7
No related branches found
No related tags found
2 merge requests!73MAINT: change wording of TableImporter argument and allow converters and...,!70ENH: allow to provide required columns explicitly
Pipeline #35533 passed
......@@ -373,24 +373,20 @@ class TableImporter():
for index, row in df.iterrows():
# if none of the relevant information is given, skip
if np.array([pd.isnull(row.loc[key]) for key in self.obligatory_columns
if key in df.columns]).all():
if pd.isnull(row.loc[[key for key in self.obligatory_columns if key in df.columns]]).all():
df = df.drop(index)
continue
# if any of the relevant information is missing, report it
i = 0
okay = True
while okay and i < len(self.obligatory_columns):
key = self.obligatory_columns[i]
i += 1
if key not in df.columns:
continue
i += 1
if pd.isnull(row.loc[key]):
errmsg = (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment