<jupyter_start><jupyter_text>GOOGLE PLAYSTORE ANALYSIS The dataset used in this analysis is taken from [kaggle datasets](https://www.kaggle.com/datasets) In this analysis we took a raw data which is in csv format and then converted it into a dataframe.Performed some operations, cleaning of the data and finally visualizing some necessary conclusions obtained from it. Let's import necessary libraries required for the analysis<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns<jupyter_output><empty_output><jupyter_text>Convert the csv file into dataframe using pandas<jupyter_code>df=pd.read_csv('googleplaystore.csv')
df.head(5)<jupyter_output><empty_output><jupyter_text>This is the data we obtained from the csv file.Let's see some info about this dataframe<jupyter_code>df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 10841 entries, 0 to 10840
Data columns (total 13 columns):
App               10841 non-null object
Category          10841 non-null object
Rating            9367 non-null float64
Reviews           10841 non-null object
Size              10841 non-null object
Installs          10841 non-null object
Type              10840 non-null object
Price             10841 non-null object
Content Rating    10840 non-null object
Genres            10841 non-null object
Last Updated      10841 non-null object
Current Ver       10833 non-null object
Android Ver       10838 non-null object
dtypes: float64(1), object(12)
memory usage: 1.1+ MB<jupyter_text>This dataframe consists of 10841 entries ie information about 10841 apps.It tells about the category to which the app belongs,rating given by the users,size of the app,number of reviews given,count of number of installs and some other information  DATA CLEANING Some columns have in-appropriate data,data types.This columns needed to be cleaned to perform the analysis.  SIZE :  This column has in-appropriate data type.This needed to be converted into numeric type after converting every value into MB's For example, the size of the app is in “string” format. We need to convert it into a numeric value. If the size is “10M”, then ‘M’ was removed to get the numeric value of ‘10’. If the size is “512k”, which depicts app size in kilobytes, the first ‘k’ should be removed and the size should be converted to an equivalent of ‘megabytes’.<jupyter_code>df['Size'] = df['Size'].map(lambda x: x.rstrip('M'))
df['Size'] = df['Size'].map(lambda x: str(round((float(x.rstrip('k'))/1024), 1)) if x[-1]=='k' else x)
df['Size'] = df['Size'].map(lambda x: np.nan if x.startswith('Varies') else x)<jupyter_output><empty_output><jupyter_text>10472 has in-appropriate data in every column, may due to entry mistake.So we are removing that entry from the table<jupyter_code>df.drop(10472,inplace=True)<jupyter_output><empty_output><jupyter_text>By using pd.to_numeric command we are converting into numeric type<jupyter_code>df['Size']=df['Size'].apply(pd.to_numeric)<jupyter_output><empty_output><jupyter_text>Installs : The value of installs is in “string” format. It contains numeric values with commas. It should be removed. And also, the ‘+’ sign should be removed from the end of each string.<jupyter_code>df['Installs'] = df['Installs'].map(lambda x: x.rstrip('+'))
df['Installs'] = df['Installs'].map(lambda x: ''.join(x.split(',')))<jupyter_output><empty_output><jupyter_text>By using pd.to_numeric command we are converting it into numeric data type<jupyter_code>df['Installs']=df['Installs'].apply(pd.to_numeric)<jupyter_output><empty_output><jupyter_text>Reviews :The reviews column is in string format and we need to convert it into numeric type<jupyter_code>df['Reviews']=df['Reviews'].apply(pd.to_numeric)<jupyter_output><empty_output><jupyter_text>After cleaning some columns and rows we obtained the required format to perform the analysis<jupyter_code>df.head(5)<jupyter_output><empty_output><jupyter_text>DATA VISUALIZATION In this we are taking a parameter as reference and checking the trend of another parameter like whether there is a rise or fall,which category are more,what kinds are of more intrest and so on.  Basic pie chart to view distribution of apps across various categories<jupyter_code>fig, ax = plt.subplots(figsize=(10, 10), subplot_kw=dict(aspect="equal"))
number_of_apps = df["Category"].value_counts()
labels = number_of_apps.index
sizes = number_of_apps.values
ax.pie(sizes,labeldistance=2,autopct='%1.1f%%')
ax.legend(labels=labels,loc="right",bbox_to_anchor=(0.9, 0, 0.5, 1))
ax.axis("equal")
plt.show()<jupyter_output><empty_output><jupyter_text>App count for certain range of Ratings In this we are finding the count of apps for each range from 0 to 5 ie how many apps have more rating,how many are less rated.<jupyter_code>bins=pd.cut(df['Rating'],[0.0,1.0,2.0,3.0,4.0,5.0])
rating_df=pd.DataFrame(df.groupby(bins)['App'].count())
rating_df.reset_index(inplace=True)
rating_df
plt.figure(figsize=(12, 6))
axis=sns.barplot('Rating','App',data=rating_df);
axis.set(ylabel= "App count",title='APP COUNT STATISTICS ACCORDING TO RATING');<jupyter_output><empty_output><jupyter_text>We can see that most of the apps are with rating 4 and above  and very less apps have rating below 2.  Top5 Apps with highest review count  In this we are retrieving the top5 apps with more number of reviews and seeing it visually how their review count is changing.<jupyter_code>reviews_df=df.sort_values('Reviews').tail(15).drop_duplicates(subset='App')[['App','Reviews','Rating']]
reviews_df
plt.figure(figsize=(12, 6))
axis=sns.lineplot(x="App",y="Reviews",data=reviews_df)
axis.set(title="Top 5 most Reviewed Apps");
sns.set_style('darkgrid')<jupyter_output><empty_output><jupyter_text>Facebook has more reviews compared to other apps in the playstore  Which content type Apps are more in playstore In this we are grouping the apps according to their content type and visually observing the result<jupyter_code>content_df=pd.DataFrame(df.groupby('Content Rating')['App'].count())
content_df.reset_index(inplace=True)
content_df
plt.figure(figsize=(12, 6))
plt.bar(content_df['Content Rating'],content_df['App']);
plt.xlabel('Content Rating')
plt.ylabel('App count')
plt.title('App count for different Contents');<jupyter_output><empty_output><jupyter_text>Most of the apps in playstore can be used by everyone irrespective of the age.Only 3 apps are A rated  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  Free vs Paid Apps Let's see variations considering type of App ie paid and free apps<jupyter_code>Type_df=df.groupby('Type')[['App']].count()
Type_df['Rating']=df.groupby('Type')['Rating'].mean()

Type_df.reset_index(inplace=True)
Type_df<jupyter_output><empty_output><jupyter_text>We found the number of apps that are freely available and their average rating and also number of paid apps and their average rating.<jupyter_code>fig, axes = plt.subplots(1, 2, figsize=(18, 6))
axes[0].bar(Type_df.Type,Type_df.App)
axes[0].set_title("Number of free and paid apps")
axes[0].set_ylabel('App count')
axes[1].bar(Type_df.Type,Type_df.Rating)
axes[1].set_title('Average Rating of free and paid apps')
axes[1].set_ylabel('Average Rating');<jupyter_output><empty_output><jupyter_text>Conclusion Average rating of Paid Apps is more than Free apps.So,we can say that paid apps are trust worthy and we can invest in them  -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  Max Installs In this we are finding the apps with more number of installs and as we dont have exact count of installs we got around 20 apps with 1B+ downloadsFrom the 20 apps we will see some analysis of what types are more installed<jupyter_code>max_installs=df.loc[df['Installs']==df.Installs.max()][['App','Category','Reviews','Rating','Installs','Content Rating']]
max_installs=max_installs.drop_duplicates(subset='App')
max_installs<jupyter_output><empty_output><jupyter_text>These are the 20 apps which are with 1B+ downloads  Which App has more rating and trend of 20 apps rating<jupyter_code>plt.figure(figsize=(12, 6))
sns.barplot('Rating','App',data=max_installs);<jupyter_output><empty_output><jupyter_text>We can see that Google photos,Instagram and Subway Surfers are the most rated Apps which have 1B+ downloads.Though the Apps are used by 1B+ users they have a good rating too  Which content Apps are most Installed We will group the most installed apps according to their content and see which content apps are most installed<jupyter_code>content_max_df=pd.DataFrame(max_installs.groupby('Content Rating')['App'].count())
content_max_df.reset_index(inplace=True)
content_max_df
plt.figure(figsize=(12, 6))
axis=sns.barplot('Content Rating','App',data=content_max_df);
axis.set(ylabel= "App count",title='Max Installed APP COUNT STATISTICS ACCORDING TO Content RATING');<jupyter_output><empty_output><jupyter_text>More than 10 apps are of type which can be used by any age group and about 8 apps are teen aged apps.Only 1 app is to used by person with age 10+  Which category Apps are more Installed In this we will group the most installed apps according to their category and see which category are on high demand<jupyter_code>category_max_df=pd.DataFrame(max_installs.groupby('Category')['App'].count())
category_max_df.reset_index(inplace=True)
category_max_df
plt.figure(figsize=(12, 6))
axis=sns.barplot('App','Category',data=category_max_df);
plt.plot(category_max_df.App,category_max_df.Category,'o--r')
axis.set(ylabel= "App count",title='Max Installed APP COUNT STATISTICS ACCORDING TO Category');<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13638666531563481, 'fraction_numerical': 0.02056945992501773, 'mean_word_length': 4.90311004784689, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '20', 'dir': 'jupyter-structured-clean-dedup', 'id': '741', 'license': 'MIT', 'n_tokens_mistral': 3150, 'n_tokens_neox': 2926, 'n_words': 984, 'path': 'playstore analysis.ipynb', 'repo_name': 'yazalipavan/Playstore_analysis', 'size': '9869'}