theDreamer911
theDreamer911

Reputation: 123

Plotting three rows of one columns into one

Actually, I didn't really understand how to ask this question. But I have a dataset that look like this

Dataset

My purpose is to plot the data into multiple classes, that look like this

My Target

Using this syntax,

df_group.plot(kind='bar', figsize=(8, 6))

I got something like this

What I got

Actually how to concatenate the room_type, so it can be displayed in one place

I was uploaded my dataset here

Is somebody know how to plot into one like that?

Any help would be appreciated

Thanks

Upvotes: 0

Views: 86

Answers (1)

Quang Hoang
Quang Hoang

Reputation: 150745

Try unstack:

# change 'room_type' to 'neighbor_group' if you prefer the other way.
df_group['price'].unstack('room_type').plot.bar()

Upvotes: 1

Related Questions