INNER CODE UNIT · Python
spaces
lefterisloukas/edgar-crawler · extract_items.py:349
spaces = sum(
c.isspace() for c in table_text
) # Count the number of space characters
if len(table_text) - spaces:
# Calculate the percentage of non-blank digit characters by dividing the count of digits
# by the total number of non-space characters
non_blank_digits_percentage = digits / (len(table_text) - spaces)
else:
# If there are no non-space characters, set the percentage to 0
non_blank_digits_percentage = 0
if len(table_text):
# Calculate the percentage of space characters by dividing the count of spaces
# by the total number of characters
spaces_percentage = spaces / len(table_text)
else:
# If the table text is empty, set the percentage to 0