Relatively new to python, so looking for some help.
So i am working on a pandas dataframe where I would like to get a list of when all different datasets are refreshing.
The problem I am facing is that the data I am getting from the system is in two parts. One column contains a list of all the days it is scheduled to refresh. The other column contains a list of all the times it is scheduled to refresh.
For example
data = {
"id": ["a", "b", "c","d"],
"refresh_days": [["Monday", "Friday"], [], [], ["Sunday"]],
"refresh_time": [["01:00"], [], [], ["03:00", "06:00"]],
}
I tried using the explode method, but that requires you to have the same amount of elements between both.
The output I would like to get is a pandas Dataframe
ID | Result |
---|---|
a | monday 1:00 |
a | friday 1:00 |
b | Nan |
c | Nan |
d | Sunday 3:00 |
d | Sunday 6:00 |
Bart Raeves is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.