Scatter plot is not sort in matplotlib from csv file












-1















My Code:



import pandas as pd

import matplotlib.pyplot as plt

df=pd.read_csv("linear_regression_dataset.csv", sep=";")

plt.scatter(df.Deneyim,df.Maas)

plt.xlabel("deneyim")

plt.ylabel("maas")

plt.show()


result image :



Is there a solution proposal?



That's the graphic I want to be image:










share|improve this question




















  • 1





    Hi there, welcome to Stack Overflow! It isn't clear what your problem is, or what you are looking for a solution to. Please read about how to ask good questions, as well as this question checklist and update your question accordingly. Thanks!

    – TrebuchetMS
    Nov 14 '18 at 9:08








  • 1





    Your values are stored as object in the df instead of numbers. Make sure they are numbers. Because we don't have access to the data it's not clear why you have objects, so one cannot help further.

    – ImportanceOfBeingErnest
    Nov 14 '18 at 9:25











  • Please clarify your question. It's absolutely not clear what your problem is, what you expect your result to be and how your current result deviates from that. See stackoverflow.com/help/how-to-ask and codeblog.jonskeet.uk/2012/11/24/…

    – planetmaker
    Nov 14 '18 at 12:02











  • I added the result I wanted to see

    – Burak MAKAV
    Nov 14 '18 at 13:00
















-1















My Code:



import pandas as pd

import matplotlib.pyplot as plt

df=pd.read_csv("linear_regression_dataset.csv", sep=";")

plt.scatter(df.Deneyim,df.Maas)

plt.xlabel("deneyim")

plt.ylabel("maas")

plt.show()


result image :



Is there a solution proposal?



That's the graphic I want to be image:










share|improve this question




















  • 1





    Hi there, welcome to Stack Overflow! It isn't clear what your problem is, or what you are looking for a solution to. Please read about how to ask good questions, as well as this question checklist and update your question accordingly. Thanks!

    – TrebuchetMS
    Nov 14 '18 at 9:08








  • 1





    Your values are stored as object in the df instead of numbers. Make sure they are numbers. Because we don't have access to the data it's not clear why you have objects, so one cannot help further.

    – ImportanceOfBeingErnest
    Nov 14 '18 at 9:25











  • Please clarify your question. It's absolutely not clear what your problem is, what you expect your result to be and how your current result deviates from that. See stackoverflow.com/help/how-to-ask and codeblog.jonskeet.uk/2012/11/24/…

    – planetmaker
    Nov 14 '18 at 12:02











  • I added the result I wanted to see

    – Burak MAKAV
    Nov 14 '18 at 13:00














-1












-1








-1








My Code:



import pandas as pd

import matplotlib.pyplot as plt

df=pd.read_csv("linear_regression_dataset.csv", sep=";")

plt.scatter(df.Deneyim,df.Maas)

plt.xlabel("deneyim")

plt.ylabel("maas")

plt.show()


result image :



Is there a solution proposal?



That's the graphic I want to be image:










share|improve this question
















My Code:



import pandas as pd

import matplotlib.pyplot as plt

df=pd.read_csv("linear_regression_dataset.csv", sep=";")

plt.scatter(df.Deneyim,df.Maas)

plt.xlabel("deneyim")

plt.ylabel("maas")

plt.show()


result image :



Is there a solution proposal?



That's the graphic I want to be image:







python-3.x matplotlib






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 12:58







Burak MAKAV

















asked Nov 14 '18 at 8:56









Burak MAKAVBurak MAKAV

11




11








  • 1





    Hi there, welcome to Stack Overflow! It isn't clear what your problem is, or what you are looking for a solution to. Please read about how to ask good questions, as well as this question checklist and update your question accordingly. Thanks!

    – TrebuchetMS
    Nov 14 '18 at 9:08








  • 1





    Your values are stored as object in the df instead of numbers. Make sure they are numbers. Because we don't have access to the data it's not clear why you have objects, so one cannot help further.

    – ImportanceOfBeingErnest
    Nov 14 '18 at 9:25











  • Please clarify your question. It's absolutely not clear what your problem is, what you expect your result to be and how your current result deviates from that. See stackoverflow.com/help/how-to-ask and codeblog.jonskeet.uk/2012/11/24/…

    – planetmaker
    Nov 14 '18 at 12:02











  • I added the result I wanted to see

    – Burak MAKAV
    Nov 14 '18 at 13:00














  • 1





    Hi there, welcome to Stack Overflow! It isn't clear what your problem is, or what you are looking for a solution to. Please read about how to ask good questions, as well as this question checklist and update your question accordingly. Thanks!

    – TrebuchetMS
    Nov 14 '18 at 9:08








  • 1





    Your values are stored as object in the df instead of numbers. Make sure they are numbers. Because we don't have access to the data it's not clear why you have objects, so one cannot help further.

    – ImportanceOfBeingErnest
    Nov 14 '18 at 9:25











  • Please clarify your question. It's absolutely not clear what your problem is, what you expect your result to be and how your current result deviates from that. See stackoverflow.com/help/how-to-ask and codeblog.jonskeet.uk/2012/11/24/…

    – planetmaker
    Nov 14 '18 at 12:02











  • I added the result I wanted to see

    – Burak MAKAV
    Nov 14 '18 at 13:00








1




1





Hi there, welcome to Stack Overflow! It isn't clear what your problem is, or what you are looking for a solution to. Please read about how to ask good questions, as well as this question checklist and update your question accordingly. Thanks!

– TrebuchetMS
Nov 14 '18 at 9:08







Hi there, welcome to Stack Overflow! It isn't clear what your problem is, or what you are looking for a solution to. Please read about how to ask good questions, as well as this question checklist and update your question accordingly. Thanks!

– TrebuchetMS
Nov 14 '18 at 9:08






1




1





Your values are stored as object in the df instead of numbers. Make sure they are numbers. Because we don't have access to the data it's not clear why you have objects, so one cannot help further.

– ImportanceOfBeingErnest
Nov 14 '18 at 9:25





Your values are stored as object in the df instead of numbers. Make sure they are numbers. Because we don't have access to the data it's not clear why you have objects, so one cannot help further.

– ImportanceOfBeingErnest
Nov 14 '18 at 9:25













Please clarify your question. It's absolutely not clear what your problem is, what you expect your result to be and how your current result deviates from that. See stackoverflow.com/help/how-to-ask and codeblog.jonskeet.uk/2012/11/24/…

– planetmaker
Nov 14 '18 at 12:02





Please clarify your question. It's absolutely not clear what your problem is, what you expect your result to be and how your current result deviates from that. See stackoverflow.com/help/how-to-ask and codeblog.jonskeet.uk/2012/11/24/…

– planetmaker
Nov 14 '18 at 12:02













I added the result I wanted to see

– Burak MAKAV
Nov 14 '18 at 13:00





I added the result I wanted to see

– Burak MAKAV
Nov 14 '18 at 13:00












1 Answer
1






active

oldest

votes


















-1














sort the dataframe first and then you can plot



import pandas as pd

import matplotlib.pyplot as plt

df=pd.read_csv("linear_regression_dataset.csv", sep=";")
df['Mass']= df['Mass'].astype(int)
df.sort_values('Maas',inplace=True)
plt.scatter(df.Deneyim,df.Maas)

plt.xlabel("deneyim")

plt.ylabel("maas")

plt.show()





share|improve this answer


























  • Why do you mean by doesnt work. Did you got any error?

    – AI_Learning
    Nov 14 '18 at 13:12











  • Its done thanks

    – Burak MAKAV
    Nov 14 '18 at 13:16











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53296275%2fscatter-plot-is-not-sort-in-matplotlib-from-csv-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









-1














sort the dataframe first and then you can plot



import pandas as pd

import matplotlib.pyplot as plt

df=pd.read_csv("linear_regression_dataset.csv", sep=";")
df['Mass']= df['Mass'].astype(int)
df.sort_values('Maas',inplace=True)
plt.scatter(df.Deneyim,df.Maas)

plt.xlabel("deneyim")

plt.ylabel("maas")

plt.show()





share|improve this answer


























  • Why do you mean by doesnt work. Did you got any error?

    – AI_Learning
    Nov 14 '18 at 13:12











  • Its done thanks

    – Burak MAKAV
    Nov 14 '18 at 13:16
















-1














sort the dataframe first and then you can plot



import pandas as pd

import matplotlib.pyplot as plt

df=pd.read_csv("linear_regression_dataset.csv", sep=";")
df['Mass']= df['Mass'].astype(int)
df.sort_values('Maas',inplace=True)
plt.scatter(df.Deneyim,df.Maas)

plt.xlabel("deneyim")

plt.ylabel("maas")

plt.show()





share|improve this answer


























  • Why do you mean by doesnt work. Did you got any error?

    – AI_Learning
    Nov 14 '18 at 13:12











  • Its done thanks

    – Burak MAKAV
    Nov 14 '18 at 13:16














-1












-1








-1







sort the dataframe first and then you can plot



import pandas as pd

import matplotlib.pyplot as plt

df=pd.read_csv("linear_regression_dataset.csv", sep=";")
df['Mass']= df['Mass'].astype(int)
df.sort_values('Maas',inplace=True)
plt.scatter(df.Deneyim,df.Maas)

plt.xlabel("deneyim")

plt.ylabel("maas")

plt.show()





share|improve this answer















sort the dataframe first and then you can plot



import pandas as pd

import matplotlib.pyplot as plt

df=pd.read_csv("linear_regression_dataset.csv", sep=";")
df['Mass']= df['Mass'].astype(int)
df.sort_values('Maas',inplace=True)
plt.scatter(df.Deneyim,df.Maas)

plt.xlabel("deneyim")

plt.ylabel("maas")

plt.show()






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 14 '18 at 13:14

























answered Nov 14 '18 at 13:04









AI_LearningAI_Learning

2,8382730




2,8382730













  • Why do you mean by doesnt work. Did you got any error?

    – AI_Learning
    Nov 14 '18 at 13:12











  • Its done thanks

    – Burak MAKAV
    Nov 14 '18 at 13:16



















  • Why do you mean by doesnt work. Did you got any error?

    – AI_Learning
    Nov 14 '18 at 13:12











  • Its done thanks

    – Burak MAKAV
    Nov 14 '18 at 13:16

















Why do you mean by doesnt work. Did you got any error?

– AI_Learning
Nov 14 '18 at 13:12





Why do you mean by doesnt work. Did you got any error?

– AI_Learning
Nov 14 '18 at 13:12













Its done thanks

– Burak MAKAV
Nov 14 '18 at 13:16





Its done thanks

– Burak MAKAV
Nov 14 '18 at 13:16


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53296275%2fscatter-plot-is-not-sort-in-matplotlib-from-csv-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Hercules Kyvelos

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud