I have the following DataFrame:
... | ... | CPU Utilization % | CPU Temperature °С | dif (CPU Utilization - CPU Temperature) |
---|---|---|---|---|
... | ... | 10.913399 | 9.727057 | 10.913399 - 9.727057 |
... | ... | 14.230935 | 12.561181 | 14.230935 - 12.561181 |
etc |
I want to plot df['dif'] and use as x-values 'CPU Utilization %' and y-values - 'CPU Temperature °С':
I tried do
df['dif'].plot(kind='scatter', x='util', y='temp')
but it says:
ValueError: plot kind scatter can only be used for data frames
How can i plot graph?
CodePudding user response:
It was already suggested in the comment attached to your question by @QuangHoang, I will suggest you to do it with a scatter plot with the seaborn library, such as:
import seaborn as sns
sns.scatterplot(data=df, x='util', y='temp', hue='diff')
The hue
argument enables to rank them according to the 'diff'
value, as a "third dimension".