I have list of dictionary like this:
collection = [{'item': ['Policy Master 1-2022-2023-P0003 - 5 Days - Plan 3', 'Policy Master 2-2022-2023-P0009 - 5 Days - Plan 3', 'Policy Master 3-2022-2023-P0012 - 5 Days - Plan 3', 'Policy Master 1-2022-2023-P0003 - 5 Days - Plan 2', 'Policy Master 2-2022-2023-P0009 - 5 Days - Plan 2'], 'Mar': [2800.0, 600.0, 600.0, 1000.0, 200.0]}, {'item': ['Policy Master 1-2022-2023-P0003 - 5 Days - Plan 3', 'Policy Master 2-2022-2023-P0009 - 5 Days - Plan 3', 'Policy Master 3-2022-2023-P0012 - 5 Days - Plan 3', 'Policy Master 1-2022-2023-P0003 - 5 Days - Plan 2'], 'Jun': [2800.0, 600.0, 600.0, 1000.0]}]
I want to item from show monthly data corresponding to it. If item was not present in previous month it should show NaN in previous month. How to do it in pandas? Also more months can be added in future. So it should consider all months dynamically.