Guided Project: Isolating the free apps

Hi Guys :smile:

Please, can someone help me with the below code? I am trying to isolate the free apps but the output isnt showing the number of rows and columns for free iOS Apps

free_googleApps = []
free_appleApps = []

for app in google_englishApps:
    price = app[7]
    if price == '0':
        free_googleApps.append(app)  
        
for this_app in apple_englishApps:
    price = app[4]
    if price == '0.0':
        free_appleApps.append(this_app)
        
        
explore_data(free_googleApps, 0, 3, True)
print('\n')
explore_data(free_appleApps, 0, 3, True)

Here is the output below:

['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']


['U Launcher Lite – FREE Live Cool Themes, Hide Apps', 'ART_AND_DESIGN', '4.7', '87510', '8.7M', '5,000,000+', 'Free', '0', 'Everyone', 'Art & Design', 'August 1, 2018', '1.2.4', '4.0.3 and up']


['Sketch - Draw & Paint', 'ART_AND_DESIGN', '4.5', '215644', '25M', '50,000,000+', 'Free', '0', 'Teen', 'Art & Design', 'June 8, 2018', 'Varies with device', '4.2 and up']


Number of rows: 8864
Number of columns: 13


Number of rows: 0

IndexErrorTraceback (most recent call last)
<ipython-input-31-7085dc801b2d> in <module>()
     15 explore_data(free_googleApps, 0, 3, True)
     16 print('\n')
---> 17 explore_data(free_appleApps, 0, 3, True)

<ipython-input-4-6de612c779e4> in explore_data(filename, start, end, rows_and_columns)
      7     if rows_and_columns:
      8         print('Number of rows:', len(filename))
----> 9         print('Number of columns:', len(filename[0]))

IndexError: list index out of range

Thanks,
Olubaji

Hi!

Seems like there isn´t anything to display in free_appleApps. Did you try checking if the list contains anything? Using free_appleApps.head() for example…?