I am trying to do some column manipulations with row and column at same time including date and time series in Pandas. Traditionally with no series python dictionaries are great. But with Pandas it a new thing for me.
Input file : N number of them.
File1.csv, File2.csv, File3.csv, ........... Filen.csv
Ids,Date-time-1 Ids,Date-time-2 Ids,Date-time-1
56,4568 645,5545 25,54165
45,464 458,546
I am trying to merge the Date-time
column of all the files into a big data file with respect to Ids
Ids,Date-time-ref,Date-time-1,date-time-2
56,100,4468,NAN
45,150,314,NAN
645,50,NAN,5495
458,200,NAN,346
25,250,53915,NAN
Check for
date-time
column - If not matched create one and then fill the values with respect toIds
by Subtracting the currentdate-time value
with the value ofdate-time-ref
of that respectiveIds
.Fill in empty place with
NAN
and if next file has that value then replace the new value withNAN
If it were straight column subtract it was pretty much easy but in sync with date-time series
and with respect to Ids
seems a bit confusing.
Appreciate some suggestions to begin with. Thanks in advance.
Here is one way to do it.