import pandas as pd import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
style.use('ggplot')skill = {
'skill': ['Python', 'SQL', 'Power BI', 'Excel'],
'rate': np.random.randint(76, 100, size = 4)
}
data = pd.DataFrame(skill)
print(data)plt.figure(figsize = (6,4))
plt.bar(data['skill'], data['rate'], color = 'orange')
plt.title('Rate Of Skills')
plt.tight_layout()
plt.xticks(rotation = 45, ha = 'right')
plt.show()file_path = 'jupyter sales analysis.xlsx' sales = pd.read_excel(file_path) sales.head(3)
sales.columns
sales.drop(['Row ID', 'Order ID', 'Customer ID', 'Postal Code', 'Product ID'], axis = 1, inplace = True)
sales.head(3)
sales.isnull().sum()
hist_data = sales[['Sales', 'Quantity', 'Discount', 'Profit']] hist_data.hist(bins = 20, figsize = (12,8), color = 'orange') plt.show()
state_sales = sales.groupby('State')['Sales'].sum().reset_index(
name = 'Total Sales').sort_values(
by = 'Total Sales', ascending = False).round(2)
state_sales = state_sales.head(20)
state_salesplt.figure(figsize = (8,5))
plt.barh(state_sales['State'], state_sales['Total Sales'], color = 'orange')
for state, sale in zip(state_sales['State'], state_sales['Total Sales']):
plt.text(sale, state, f"{sale}", ha = 'left', va = 'center')
plt.title('Top 20 States With Highest Sales', fontsize = 15)
plt.show()products = sales.groupby('Category')['Sales'].sum().reset_index(
name = 'Total Sales').round(2)
products['Percentage Sales'] = ((products['Total Sales'] / sum(
products['Total Sales'])) * 100).round(2)
productstotal = round(sum(products['Total Sales']),2)
color = ['blue', 'green', 'orange']
plt.figure(figsize = (8,5))
plt.pie(products['Total Sales'], labels = products['Category'],
autopct = '%1.1f%%', colors = color, explode = [0.02, 0, 0],
wedgeprops = {'width': 0.4}, textprops = {'fontsize': 12})
plt.text(0,0,f"Total\n{total}", ha = 'center', va = 'center',
fontsize = 17)
plt.title('Total Sales By Product Category')
plt.show()sales.columns
year = sales.groupby('Year')[['Sales', 'Profit']].sum()
yearyear['% Profit Increase'] = (year['Profit'].pct_change() * 100).round(2) year['% Profit Increase'].fillna(0, inplace = True) year
num_terms = 10 fibonacci = [0, 1] while len(fibonacci) < num_terms: next_term = fibonacci[-1] + fibonacci[-2] fibonacci.append(next_term) print(fibonacci)