Question

Exercise 4: Plot salary as a function of yrs.since.phd Use the scatter() function to make a scatterplot with yrs.since.phd on
plt.xlabel(Years since PhD) plt.ylabel(Salary) Populating the interactive namespace from numpy and matplotlib Out[13]: Te
0 0
Add a comment Improve this question Transcribed image text
Answer #1

##in question the dataset is not provided, so creating some

##random data

##In case of any issues please comment, i will definitely help you.

##please rate +ve :)

import numpy as np

import pandas as pd

yrs_since_phd=np.random.randint(1,50,(25))

sal=np.random.randint(1,20,(25))*1000

salaries_nonull=pd.DataFrame({'yrs.since.phd':yrs_since_phd,'salary':sal})

#print(salaries_nonull)


##paste the code from here, no need of code above for your question

import matplotlib.pyplot as plt

#%pylab inline

#your code

plt.scatter(salaries_nonull['yrs.since.phd'],salaries_nonull['salary'])

plt.title("Salary vs. Yrs since Phd")

plt.xlabel('Yrs since Phd')

plt.ylabel('Salary')

##paste the code from here, no need of code above for your question import matplotlib.pyplot as plt #%pylab inline #your code

Add a comment
Know the answer?
Add Answer to:
Exercise 4: Plot salary as a function of yrs.since.phd Use the scatter() function to make a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT