These tips will help you when you post your Python and Pandas questions elsewhere…
See Getting good answers to your questions.
Especially about ‘creating a minimal, complete, and verifiable example’. Those trying to help you should be able to paste in code and data (possibly toy data similar to yours and provided as text and not a screenshot) you provide and get what you get. Go to another computer now and try just using what you provided here as text to run your code and produce what you show in say 3 minutes. I suspect you won’t because you never provided a minimal reproducible example. You’ll want to do that when you post your additional questions elsehwere.