Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Pandas / I can't format the data after Resample.Interpolate

I have these data coming from a csv file

enter image description here

I did an interpolate with a 5 min period

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

ecoData = ecoData.resample('5min').interpolate()
ecoData.head()

Here is the result

enter image description here

Then I would like to keep only 2 digits so I did a test on the first column :

ecoData["1/31/2019"].map('{:.2f}'.format)
ecoData.head()

But nothing has changed as a result

>Solution :

Did you save the result?

ecoData["1/31/2019"] = ecoData["1/31/2019"].map('{:.2f}'.format)
ecoData.head()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading