text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import os

import pandas as pd

import seaborn as sns

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style='ticks')
sns.set_context('paper')
import plotly
import plotly.plotly as py
import plotly.graph_objs as go
import os

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

df = df[df['Category'] != '1.9']

c2 = df['Category'].value_counts(dropna=True, sort=True, normalize=True).plot.bar()
plt.title('Frequency of App Categories')

df['Genres_List'] = list(map(lambda x: x.split(';'), df['Genres']))
df['Genres_Sele'] = list(map(lambda x: x[0], df['Genres_List']))

ax = sns.boxplot(x="Rating", y="Content Rating", data=df)
plt.xlabel('Rating counts from 0 to 5')

df['Price'] = df[df.columns[7]].replace('[\\$,]', '', regex=True).astype(float)

df_price = df[df['Price'] <= 50]

def KB_to_MB(kb):
    """converts all sizes in the DF to float MB size"""
    if 'Varies with device' in kb:
        return np.nan
    else:
        num = float(kb[:-1])
        mes = kb[-1]
        if mes is 'k':
            mb = float(0.000976562)
            c_mb = mb * num
            return c_mb
        else:
            return num
df['Size_MB'] = list(map(lambda x: KB_to_MB(x), df['Size']))
df = df.dropna()

df['Installs'] = df[df.columns[5]].replace('[\\+,]', '', regex=True).astype(float)

sns.regplot(x='Installs', y='Size_MB', fit_reg=True, data=df)
plt.xlabel('Amount of installs in K')
plt.ylabel('Size of App in MB')
plt.title('The relationship between App Size and Download Frequency')