0

Below is my pandas dataframe and I want to draw a countplot for train, test, val with hue as 0 and 1 in the same count plot, how can I do this?

   train  val  test
0     78    9    11
1    124   15    16

thank you for the help in advance.

1

1 Answer 1

2
d = {'train': [78, 124], 'val': [9, 15], 'test': [11, 16]}
df = pd.DataFrame(data=d)
df.plot.bar()

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.