I am new to python and this is my first question, please apologize any mistakes.
I have a big csv file with continuous measurements (measurements approx. every second, but interval is not fixed). I need to get mean value per minute. I found out that groupby would probably help me doing this but I am stuck with specifying the DATE_TIME column as index and dtype'datetime'. The csv file looks like this:
,DATE_TIME,N2O_dry
0,2016-03-01 02:32:02.651,0.70714453962
1,2016-03-01 02:32:03.762,0.7071444254000001
2,2016-03-01 02:32:05.257,0.70373171894
3,2016-03-01 02:32:05.953,0.70083729096
4,2016-03-01 02:32:07.049,0.69760065648
5,2016-03-01 02:32:07.928,0.6954438788699999
6,2016-03-01 02:32:08.726,0.6874527606899999
7,2016-03-01 02:32:10.005,0.6724201105500001
8,2016-03-01 02:32:10.851,0.6607286568199999
.
.
.
104503,2016-03-02 08:21:18.421,0.26879397415
104504,2016-03-02 08:21:19.532,0.26884030311
104505,2016-03-02 08:21:20.359,0.26887979686
So far I only succeeded in reading the file in a dataframe and specifying the DATE_TIME column as index and make the DATE_TIME column an dtype='datetime64[ns]' object with this:
import pandas
df=pandas.read_csv(file,usecols=[1,'N2O_dry'])
df=df.set_index('DATE_TIME')
df=pandas.to_datetime(df.index)
However, now i seem to be left only with the DATE_TIME column. Can somebody help me, please?
`