Skip to content

Tag: pandas

Balance dataset using pandas

This is for a machine learning program. I am working with a dataset that has a csv which contains an id, for a .tif image in another directory, and a label, 1 or 0. There are 220,025 rows in the csv. I have loaded this csv as a pandas dataframe. Currently in the dataframe, there are 220,025 rows, with 130,908

Finding regex patterns regardless of spaces

There are strings (which are rows of a pandas data frame): 2.5807003.49 9/2020 24,54 4.7103181.69 9 /2020 172,05 4.7197189.46 09/2020 172,0 5 4.7861901.25 9/2020 8 9,16 2.5807003.49 10/2020 35,65 4.7103181.69 10/2020 185,50 4.7197189.46 1 0/2020 185,5 0 4.7861901.25 10/2020 94 ,32 What I need is to extract th…

Resampling timestamps in a CSV

I have a CSV file that stores data from different smartphone sensors. The timestamps are elapsed nanoseconds since the program to record the data was started. Short example: The time steps between the timestamps are not equal, but I would like them to be. My question is how to achieve this? I was thinking abo…