Guided project, ios data row number does not match the solution

We deleted the duplicate rows from android data. We did not do it with ios data. They also did not do it in the solution they provided.
In the beginning ios data has 7197 rows. I deleted the non English app names.
my ios_english data has 7197 rows, at the solution they provided they have 6183.
I used this code to detect more than 3 non english characters:
def english_character(string):
asciirange=
for character in string:
if ord(character) > 127:
asciirange.append(character)
if len(asciirange)>3:
return False
return True

And I used the code below to get the data with English app names:
ios_english =

for app in ios:
name = app[0]
if english_character(name):
ios_english.append(app)
I do not know why we have different answers

Hello @atasever_tr, welcome to the community!

For the ios dataset, the name = app[1] not name = app[0] as shown in your code above.
Your code is not properly typed out but here is the correct code, you can compare with yours:

Function to detect more than 3 non-english characters:

def english_character(string):
    asciirange = []
    for character in string:
        if ord(character) > 127:
            asciirange.append(character)
            
    if len(asciirange) > 3:
        return False
    else:
        return True

To get data with English app names:

ios_english = []
for app in ios:
    name = app[1]
    if english_character(name):
        ios_english.append(app)

I hope this helps.

Thank you so much @doyinsolamiolaoye for your answer. It worked when I used name= app[1].

1 Like

@atasever_tr,

Always good to help. If your problem is solved, Kindly mark my reply as solution, Thanks :blush:

Hello, what does name = app[0] and name = app[1] mean? And why is it different between both datasets?

Hello @vroomvroom,

name = app[0] means assign the value in the list app whose index is 0 of the to the variable name.
while
name = app[1] means assign the value in the list app whose index is 1 to the variable name.

@vroomvroom,

It is different between both datasets because the two datasets have the name of the apps in different columns.

The google play dataset has the name of its apps in the first column which makes the index number 0 while the Applestore dataset has the name of its apps in the second column which makes the index number 1.

Indexing of elements in a list starts from 0. This convention is called zero-based indexing.

I hope this answers your questions.

1 Like

I understand now, thank you.

1 Like

It’s my pleasure. Happy learning!