Skip to content

Commit

Permalink
more detailed nan value search
Browse files Browse the repository at this point in the history
  • Loading branch information
chrieke committed Apr 20, 2024
1 parent 4d52a97 commit f4587cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ def table_to_markdown(df):
print(f"Unique companies: {df['Focus'].nunique()}")

df = df.drop(["Notes (ex-name)"], axis=1)
# Print column name & row index of nan values
if df.loc[:, df.columns != "New"].isnull().values.any():
print(df.isnull().any(axis=1))
for column in df.columns[df.columns != "New"]:
if df[column].isnull().any():
na_rows = df[column][df[column].isnull()].index.tolist()
print(f"Column '{column}' has NaN at rows: {na_rows}")
raise ValueError("Table contains NA values!!!")

if args.check_urls:
Expand Down

0 comments on commit f4587cf

Please sign in to comment.