I have another problem with pandas. I can do the below task utilizing loops but it would be very inefficient due to the size of the input. Please let me know if there is a pandas solution.
I would like create a new DF_C based on DF A. I need to create multiple rows based on the columns COL_A and COL_B (the values will be separated by commas). State will always have one element in it.
The sequence of rows does not matter.
I have a DF A:
State COL_A B_COL
01 01 03, 01
02 01, 03 01, 04
02 07 03
04 01 05
I would like a resulting df_c:
State COL_A B_COL
01 01 03
01 01 01
02 01 01
02 01 04
02 03 01
02 03 04
02 07 03
04 01 05