I have dataset as below,
| index | 10_YR_CAGR | 5_YR_CAGR | 1_YR_CAGR |
|---|---|---|---|
| c1_rev | 20.5 | 21.5 | 31.5 |
| c2_rev | 20.5 | 22.5 | 24 |
| c3_rev | 21 | 24 | 27 |
| c4_rev | 20 | 26 | 30 |
| c5_rev | 24 | 19 | 15 |
| c1_eps | 21 | 22 | 23 |
| c2_eps | 21 | 24 | 25 |
This data has 5 companies and its parameters like rev, eps, profit etc. I need to plot as below:
rev:
- x_axis-> index_col c1_rev, ...c5_rev
- y_axis -> 10_YR_CAGR .. 1_YR_CAGR
eps:
- x_axis -> index_col: c1_eps,...c5_eps
- y_axis -> 10_YR_CAGR,... 1_YR_CAGR
etc...
I have tried with following code:
eps = analysis_df[analysis_df.index.str.contains('eps',regex=True)]
for i1 in eps.columns[eps.columns!='index']:
sns.lineplot(x="index",y=i1,data=eps,label=i1)
I have to make a dataframe from source and then loop it. How can I try to create a for loop which loops from the main source dataframe itself?
Instead of creating a loop for separate parameters, how can I loop from the main source dataframe to create a chart of plots with parameters like rev, eps, profit to facegrid parameters? How to apply those filter in facetgrid?
My sample output of the above code,
How to plot the same sort of plot for different parameters in a single for loop?

