Hi @luisgomezesp,
Thanks for describing your problem and providing the code you've already tried! Could you also provide us with some sample data so that we can run your code and help you more easily? You will get an answer much quicker if we can see some of your data to use as an example.
This article gives some help on how to create a minimal reproducible example. If you can post a small sample of your data, or of some fake data that reproduces your problem (in case your actual data are sensitive etc), that would be great!
Thanks