ApppleStore: explore data Row Number vs CSV file row number

Hi All!

I used explore_data function I think everything is working fine, however when I opened AppleStore.CSV file and checked number of cells.

There is difference between number of rows in explore data shows as 7198 and AppleStore.csv file is 7129: I looked through each row in AppleStore.csv file. In some rows there is multiple rows for the single ID(which is wrong I think).

Maybe this is something which is corrected during course. (I do not know)

(Anyway even there is one row info for each ID, this difference becomes 10-15 rows, which does not still fill gap fully.)

Thank you

Could you please add link of the course and probably a screenshot of what’s going wrong.

Thank you vasheyy! :slight_smile: Following is my code:

from csv import reader

opened_file = open(‘C:\Users\xxxx\Desktop\Tmp\DataQuest\AppleStore.csv’, encoding=‘utf8’)
read_file = reader(opened_file)
apple_data_set = list(read_file)

opened_file = open(‘C:\Users\xxxx\Desktop\Tmp\DataQuest\googleplaystore.csv’, encoding=‘utf8’)
read_file = reader(opened_file)
google_data_set = list(read_file)

def explore_data(dataset, start, end, rows_and_columns=False):
dataset_slice = dataset[start:end]
for row in dataset_slice:
print(row)
print(’\n’) # adds a new (empty) line after each row

if rows_and_columns:
    print('Number of rows:', len(dataset[1:]))
    print('Number of columns:', len(dataset[0]))

explore_data(apple_data_set,1,3, rows_and_columns=True)

print(’\n’)

explore_data(google_data_set,1,3, rows_and_columns=True)

Following are results:

[‘284882215’, ‘Facebook’, ‘389879808’, ‘USD’, ‘0.0’, ‘2974676’, ‘212’, ‘3.5’, ‘3.5’, ‘95.0’, ‘4+’, ‘Social Networking’, ‘37’, ‘1’, ‘29’, ‘1’]

[‘389801252’, ‘Instagram’, ‘113954816’, ‘USD’, ‘0.0’, ‘2161558’, ‘1289’, ‘4.5’, ‘4.0’, ‘10.23’, ‘12+’, ‘Photo & Video’, ‘37’, ‘0’, ‘29’, ‘1’]

Number of rows: 7197 My question is about this number. If you open AppleStore.csv file it is 7128
Number of columns: 16

[‘Photo Editor & Candy Camera & Grid & ScrapBook’, ‘ART_AND_DESIGN’, ‘4.1’, ‘159’, ‘19M’, ‘10,000+’, ‘Free’, ‘0’, ‘Everyone’, ‘Art & Design’, ‘January 7, 2018’, ‘1.0.0’, ‘4.0.3 and up’]

[‘Coloring book moana’, ‘ART_AND_DESIGN’, ‘3.9’, ‘967’, ‘14M’, ‘500,000+’, ‘Free’, ‘0’, ‘Everyone’, ‘Art & Design;Pretend Play’, ‘January 15, 2018’, ‘2.0.0’, ‘4.0.3 and up’]

Number of rows: 10841
Number of columns: 13

Check here csv file:
AppleStore.csv (708.8 KB)

@muhiddineagle

Hey I think there is some misunderstanding, below is the pic of CSV file and there are total 7198 rows that match with your output if you don’t count the first one.

Thank you! Yeah. Maybe there is difference in the downloaded files. Data may be has changed time to time.
If I follow there instruction in the project there are a lot of incorrect data rows which are not mentioned in Google Play data store. I am going to look at the project from the beginning.