text_plain_output_1.png
import numpy as np

import pandas as pd

app_data = pd.read_csv('../input/googleplaystore.csv')

app_data.isnull().sum()

app_data = app_data.sort_values(by='Installs', ascending=False)

app_data = app_data.sort_values(by='Installs')

nan_rows = list(app_data[app_data['Rating'].isna()].index)
nan_rows.append(10472)
app_data = app_data.drop(nan_rows, axis=0)
app_data = app_data.drop(columns=['Size', 'Current Ver', 'Android Ver'])
app_data = app_data.sort_values(by='Installs', ascending=False)

top_10 = np.unique(app_data['Installs'])
top_10 = sorted(top_10, key=len, reverse=True)[:10]
del top_10

installs = [np.int(i.replace('+', '').replace(',', '')) for i in app_data['Installs']]
app_data['Installs'] = [i for i in installs]
del installs

top_10_df = app_data[app_data['Installs'] >= 50000]

# A dataframe to contain the most reviewed app from each bin:
most_reviewed = pd.DataFrame()

# Get the most reviewed app from each bin and add it to the most_reviewed dataframe
for bins in np.unique(top_10_df["Installs"]):
    top_row = top_10_df[top_10_df["Installs"] == bins]
    top_row = top_row.sort_values(by="ReviewRatio", ascending=False)
    top_row = top_row.head(1)
    most_reviewed = most_reviewed.append(top_row)

# Clear this dataframe of irrelevant columns for enhanced visibility
most_reviewed = most_reviewed.drop(columns=["Category","Type","Price","Content Rating","Genres","Last Updated"])
most_reviewed

print('68th: {}'.format(round(np.percentile(top_10_df['ReviewRatio'], 68), 4)))
print('95th: {}'.format(round(np.percentile(top_10_df['ReviewRatio'], 95), 4)))
print('99th: {}'.format(round(np.percentile(top_10_df['ReviewRatio'], 99), 4)))
print('Max: {}'.format(max(top_10_df['ReviewRatio'])))