Reputation: 13
how can I plot column A as x-axis and B as y-axis with data only related to C. looking for a graph that looks like density graph.
Upvotes: 1
Views: 2866
Reputation: 106
If you are having error while extracting specific columns then, it might be because of extra spaces, just try removing extra space.
Here is code:
usa = df[df.Country == 'USA']
usa.columns = usa.columns.to_series().apply(lambda x: x.strip())
usa[['Score', 'Profit']]
For Density Graph, the question is still unclear, but here density plot based on what I have understood
import seaborn as sns
p=sns.kdeplot(usa['Score'], shade=True, color="r")
p=sns.kdeplot(usa['Profit'], shade=True, color="b")
Upvotes: 1