Python Visuals

 

Python samples with numpy, pandas and matplotlib. (Created in Jupyter Notebooks)

See the code on my Github Page – The Project  (October Visuals With Python)

Pie Chart October Rides by Ride Type & Percentage

#  Configure the Size of chart
plt.figure(figsize=(8,5), dpi=150)
# Plot Style 
plt.style.use('ggplot')
# Insert Values... in this case the number of rides per type
y = np.array([6,4, 1,])
#  Make The Labels
mylabels = ["Road Cycling", "Trainer", "Stationary Bike"]
# Make the pie chart and calculate percentages 
plt.pie(y, labels = mylabels, autopct='%.2f %%')
plt.show() 

Bar Chart October Rides by Route

# Configure the size of the chart
plt.figure(figsize=(11,5), dpi=100)
plt.title('October Rides by Route &  Total Distance', fontdict={'fontweight':'bold', 'fontsize': 18})
# Labels = The different routes and monthly total distance per route
labels = ['Zube Group', 'DJP', 'Sun Ski', 'Stationary', 'Zube Stokes', 'Barcelona', 'Amsterdam', 'Milano', 'Lombardy']
values = [29.41,63.05,30.51,13.5,86.5,13.06,21.72,9.68,23.1 ]
plt.yticks([0,10.5,20.5,30.5,40.5,50.5,60.5,70.5,80.5,90])
bars = plt.bar(labels, values)
plt.xlabel('Route')
plt.ylabel('Total Distance for Month')

plt.savefig('barchart.png', dpi=300)

plt.show()

 

Line Graph showing October Blood Pressure

# Import the csv file
Vitals = pd.read_csv('OneDrive/Scott_Stuff/Hack_My_Health_2022/Oct Vitals Python.csv')
# Plot the size of the chart
plt.figure(figsize=(8,5), dpi=100)
# Title the chart
plt.title('October Blood Pressure Readings', fontdict={'fontweight':'bold', 'fontsize': 18})
# Extract the data from the file
plt.plot(Vitals.DATE, Vitals.SYSTOLIC, 'b.-', label='SYSTOLIC',)
plt.plot(Vitals.DATE, Vitals.DIASTOLIC, 'r.-', label='DIASTOLIC')
# Lable X and Y Axis 
plt.xlabel('DATE')
plt.ylabel('SYSTOLIC / DIASTOLIC')
# Insert the legend
plt.legend()

plt.savefig('OCT Vitals BP and Weight.png', dpi=300)

plt.show()

To hire me click HERE

MY BRANDS:

To learn more about the Freelance Data Analyst and Cloud Engineering work I do, please visit XL Mobile Media
To learn more about the Digital Marketing and Analytics work I do, please visit XL Digital Media