scatterplot/ violon plot /histogram /boxplot
dataset addresss=["https://data.gov.uk/dataset/bb3520e6-dd76-46d9-8bdd-86f0a2178be9/organogram-of-staff-roles-salaries/datafile/cb432dfd-a5eb-4eaa-8523-961601d5601b/preview#organogram"]
(save dataset as uk_statistic)
.
uk=pd.read_csv("uk_statistic")
.......................boxplot.....................................................
x=uk['Salary Cost of Reports (£)']
y=uk['Actual Pay Floor (£)']
plt.boxplot(x)
plt.title("UK Sststistics")
plt.xlabel('salary cost of Report')
plt.ylabel('Actual pay floor')
plt.show()
.........................................violin plot...................................................
x=uk['Salary Cost of Reports (£)']
#y=uk['Actual Pay Floor (£)']
plt.violinplot(x)
plt.show
..................................................histogram................................................
title = 'UK Sststistics'
plt.figure(figsize=(10,6))
plt.hist(uk['Actual Pay Floor (£)'])
plt.title(title, fontsize=15)
plt.xlabel('salary cost of Report')
plt.ylabel('Actual pay floor')
plt.savefig(title, dpi=300)
plt.show()
.....................................scatterplot.................................
x=uk['Salary Cost of Reports (£)']
y=uk['Actual Pay Floor (£)']
plt.scatter(x,y)
plt.title("UK Sststistics")
plt.xlabel('salary cost of Report')
plt.ylabel('Actual pay floor')
plt.show()
Comments
Post a Comment