#Open and read dataset and copy dataset as list of lists opened_file = open('googleplaystore.csv', encoding="utf8") read_file = reader(opened_file) android = list(read_file) android_header = android android = android[1:] #Try to find rows with empty cells len_android_header = len(android_header) for row in android: if len(row) != len_android_header: print(row)
What I expected to happen:
The expected result was output to show the row with unequal length (compared to header). The android list (of lists) with index 10472 has empty spaces as pointed out in the discussion forum and in the solution as well. So, I wanted to use a for loop to check for lists of shorter length.
What actually happened:
Output shows nothing. The above code did not help because the list index 10472 shows empty elements as ’ ’ and it counts those empty spaces as elements within the list. Therefore, length of the list with index 10472 is same as length of android_header.