Answer to Question #308434 in Python for Akash

Question #308434

You work in XYZ Corporation as a Data Analyst. Your corporation has told you to visualize the mtcars.csv dataset with various plots. Tasks to be performed:

Dataset Link 1. Generate a bar plot graph for the columns ‘carbs’ and ‘gear’.

a. Map the ‘carbs’ onto the x-axis.

b. Map the ‘gear’ onto the y-axis.

c. Provide the x-axis label as Number of carburetors.

d. Provide the y-axis label as Number of forward gears.

e. Set the title as carbs vs gear.



You work in XYZ Corporation as a Data Analyst. Your corporation has told you to visualize the mtcars.csv dataset with various plots. Tasks to be performed:

Dataset Link 1. Plot a histogram for the column ‘wt’.

a. Map the ‘wt’ onto the x-axis.

b. Provide the x-axis label as ‘weight of the cars’.

c. Provide the y-axis label as ‘Count’

d. Set the number of bins as 30.

e. Set the title as ‘Histogram for the weight values


1
Expert's answer
2022-03-09T12:32:51-0500
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv('mtcars.csv')



plt.plot(df['carbs'], df['gear'])
plt.title('carbs vs gear')
plt.xlabel('Number of carburetors')
plt.ylabel('Number of forward gears')
plt.show()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS