<jupyter_start><jupyter_text><jupyter_code>from google.colab import files
uploaded = files.upload()<jupyter_output><empty_output><jupyter_text>import necessary modules for data exploration<jupyter_code>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

%matplotlib inline<jupyter_output><empty_output><jupyter_text>get the document<jupyter_code>df = pd.read_csv('50_Startups.csv')
df<jupyter_output><empty_output><jupyter_text>look for empty values<jupyter_code>df.isnull().sum() # looks good to me<jupyter_output><empty_output><jupyter_text>Total r&d expendtiture for the 50 companies<jupyter_code>df['R&D Spend'].sum().round(1)<jupyter_output><empty_output><jupyter_text>Toatal marketing expenditure for the 50 companies<jupyter_code>df['Marketing Spend'].sum().round(1)<jupyter_output><empty_output><jupyter_text>Most popular cities for the startups<jupyter_code>df['State'].value_counts()<jupyter_output><empty_output><jupyter_text>Total combined profit for the 50 companies<jupyter_code>df['Profit'].sum().round(1)<jupyter_output><empty_output><jupyter_text>highest R%D spend<jupyter_code>df['R&D Spend'].max()<jupyter_output><empty_output><jupyter_text>Lowest R%D spend for 50 startups<jupyter_code>df['R&D Spend'].min()<jupyter_output><empty_output><jupyter_text>california data<jupyter_code>california = df[df['State'] == 'California']
california<jupyter_output><empty_output><jupyter_text>Total profit for startups in california<jupyter_code>california['Profit'].sum().round(1)<jupyter_output><empty_output><jupyter_text>which state has the highest profitiable company<jupyter_code>highest_profit = df['Profit'].max()
df[df['Profit'] == highest_profit]<jupyter_output><empty_output><jupyter_text>which state has the highest marketing company<jupyter_code>highest_marketing = df['Marketing Spend'].max()
df[df['Marketing Spend'] == highest_marketing]<jupyter_output><empty_output><jupyter_text>relationship between highest R%D spend and Profit<jupyter_code>highest_rd = df['R&D Spend'].max()
Relation = df[df['R&D Spend'] == highest_rd]['Profit']
print(highest_rd, Relation)<jupyter_output>165349.2 0    192261.83
Name: Profit, dtype: float64<jupyter_text>profit visualization chart<jupyter_code>profits = df['Profit']
profits.plot.line()<jupyter_output><empty_output><jupyter_text>Histogram chart visualization<jupyter_code>profits.plot.hist()<jupyter_output><empty_output><jupyter_text>R%D spend<jupyter_code>rd_spend = df['R&D Spend']
rd_spend.plot.line()<jupyter_output><empty_output><jupyter_text>pie chart state plot<jupyter_code>states = df['State'].value_counts()
states.plot.pie(figsize=(8, 8),autopct='%1.2f',startangle=90, textprops={'fontsize': 14})<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup