I have a dataframe that looks like this:
import pandas as pd
data = {'Floor': [1, 2, 3, 4], 'IDR 1': [15, 6, 7, 9], 'IDR 2': [36, 12, 78, 23]}
df = pd.DataFrame(data)
df:
Floor IDR 1 IDR 2
0 1 15 36
1 2 6 12
2 3 7 78
3 4 9 23
And I want to plot this dataframe as a line chart where y-axis is the floor. I have read the documentation on df.plot() method and it seem you can input more than one columns of data into y kwarg but not to the x.
So I have been reseaching to find a solution and I came across this question that resemles the most to my problem: Plotting multiple columns in a pandas line graph
I have this code:
df.plot(kind="line", y=["IDR 1", "IDR 2"], x="Floor", grid=True, xlabel="Floor", ylabel=data)
Basicly I just want to swap the axises.
