Can I draw a regression line and show parameters using scatterplot with a pandas dataframe

0 votes

I would like to produce a Scatterplot from a Pandas dataframe using the following code:

df.plot.scatter(x='one', y='two, title='Scatterplot') 

Is there a Parameter I can send with the Statement, so it plots a Regression line and shows the Parameters of the fit?

something like:

df.plot.scatter(x='one', y='two', title='Scatterplot', Regression_line)
Mar 4, 2022 in Machine Learning by Nandini
• 5,480 points
2,837 views

1 answer to this question.

0 votes

There isn't a parameter for DataFrame.plot(). Seaborn, on the other hand, makes it simple to do. Simply give lmplot the pandas dataframe.

For this you have to have seaborn installed.

import seaborn as sns 
sns.lmplot(x='one',y='two',data=df,fit_reg=True)

Ignite Your Future with Machine Learning Training

answered Mar 7, 2022 by Dev
• 6,000 points

Related Questions In Machine Learning

0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

not able to see all columns and rows of a pandas DataFrame?

Hi@akhtar, Your data set contains lots of rows ...READ MORE

answered Apr 8, 2020 in Machine Learning by MD
• 95,460 points
5,371 views
0 votes
1 answer

How can I train a model and calculate the accuracy of CBR algorithm?

Hi@Abubakar, You can find lots of documents on ...READ MORE

answered Oct 17, 2020 in Machine Learning by MD
• 95,460 points
743 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,356 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP