Skip to content
Advertisement

Tag: series

Python: Round decimal places after seconds in timestamp

I have this series: Initially, I wanted to round to seconds by doing: However, I am trying to merge this dataset to another of higher frequency. So I’d like to round the decimal places of the timestamp instead. Example: 2021-06-15 16:23:04.388 would become 2021-06-15 16:23:04.380 How can I do this? to a timestamp? Answer If .388 should become .380 we

Occurence of a value in many lists

i have a Series Object in pandas with 2 columns, one for the indices and one with lists, I need to find if a value occurs in only one of these lists and return it with the most optimal way. As an example let’s say we have this i need to return 77 because it occurs in only one of

Advertisement