# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# %matplotlib notebook

# Import Dependencies
import matplotlib.pyplot as plt # for visualization
import pandas as pd
import numpy as np
import seaborn as sns #for visualization



# +
# Import our data into pandas from CSV
used_string = '../Resources/googleplaystore.csv'
data = pd.read_csv(used_string)

data.head()
# -

# data.columns = data.columns.str.replace(' ', '_')
# data.head()
data.dtypes

# # data clean up

data.columns = data.columns.str.replace(' ', '_')

# # size column

data.Size.value_counts().head()

# +
# data.Size.unique()
# -

data.Size=data.Size.replace("Varies with device",np.nan)

# +
# data.Size.unique()
# -

data.Size.value_counts().head()

data.Rating.dtype

data.Size.dtype

# data.Size=data.Size.str.replace('k','e+3')
# data.Size=data.Size.str.replace('M','e+6')
data.Size = data.Size.str.replace("M","000")
data.Size = data.Size.str.replace("k","")
data.Size.head()

data.Size.unique()

data.Size = data.Size.replace("1,000+",1000)

data.Size=pd.to_numeric(data.Size)
data.Size.dtype

# # price column

data.Price.unique()


data = data.drop(data.index[10472])
data.Price.unique()

data.Price=data.Price.apply(lambda x:x.strip('$'))

# +

# data.Price = data.Price.replace("Everyone",np.nan)
# -

#data.Price=pd.to_numeric(data.Price)
data.Price=pd.to_numeric(data.Price)
data.Price.unique()

# # Rating column

data.Rating.unique()
data.Rating.dtype

data.dtypes

# # type column

data.Type.value_counts()

paid_apps=data[data['Type']=='Paid']

# +
# paibbbd_apps.head()
# -

sns.set_style("darkgrid")

sns.jointplot(x='Price', y='Rating', data=paid_apps)
sns.jointplot(x='Size', y='Rating', data=paid_apps, kind='hex', 
              gridsize=20)



StarcoderdataJupyterScriptsDedupFiltered