1st Guided Project: Profitable App Profiles

Screen Link: https://app.dataquest.io/m/350/guided-project%3A-profitable-app-profiles-for-the-app-store-and-google-play-markets/2/opening-and-exploring-the-data

I don’t understand why the "explore_data(android…"here should be “3” and “True”.

Hmmm… Not sure if I got your question totally correct, but if you’ll have a look at function definition, it requires those parameters.

def explore_data(dataset, start, end, row_and_columns=False):

so when you call this function, you have to pass it all required arguments, otherwise it will through error.

Original function - def explore_data (dataset, start, end, row_and_columns=False):
example given - explore_data(android, 0, 3, True)

The 0, and 3 in that example can be any indices for your data slice, for example 1,5, or 1, 10, it’s just the start, and end of the number slice. Link below:


I actually didn’t understand this part, while typing out the code below:


I initially was typing in rows_and_columns as a parameter versus True/False.

Playing around in Jupyter typing in False/True, in place of rows_and_columns=False, ran the function listed below, but wasn’t sure why. If someone can clear that up.

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

In earlier steps of the course we have used length function to find out number of rows.

Similarly in here we are calculating number of rows and columns:

First thing first, we run Boolean command just to tell Python whether we want to calculate ros and columns length.

If yes, we would use True and we don’t want then False won’t run the if command.

If you don’t want to use Boolean, then simply you can reqrite the code as below:
In here,
1.) Remove the fourth parameter
2.) Remove the if command
3.) Indent properly
4.) Run the code for any dataset

Following is the output for android dataset.