qhfalice
qhfalice

Reputation: 13

plot data from column with specific value

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

Answers (1)

Malvi Patel
Malvi Patel

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")

enter image description here

Upvotes: 1

Related Questions