Hi guys,

Trying to learn more about pandas csv reading. I have a file, with date and time on first row and a lot of data below. I want to be able to slice the data from T1 to T2 and use it for something.

fname = "C:\Users\zana.pepaj\Desktop\Temperature.csv"

data = pd.read_csv(fname, parse_dates=True)

T1 = '15.08.2012 16:39:10'
T2 = '15.08.2012 17:07:31'
print data

This is what I get out:

<class 'pandas.core.frame.DataFrame'>
Int64Index: 2587 entries, 0 to 2586
Data columns:
Depth (m);15.08.2012 15:39:09;15.08.2012 16:09:10;15.08.2012 16:39:10;15.08.2012 16:43:36;15.08.2012 16:46:18;15.08.2012 16:47:18;15.08.2012 16:48:19;15.08.2012 16:49:19;15.08.2012 16:50:20;15.08.2012 16:51:21;15.08.2012 16:52:22;15.08.2012 16:53:22;15.08.2012 16:54:23;15.08.2012 16:55:23;15.08.2012 16:56:24;15.08.2012 16:57:25;15.08.2012 16:58:25;15.08.2012 16:59:26;15.08.2012 17:00:27;15.08.2012 17:01:28;15.08.2012 17:02:28;15.08.2012 17:03:29;15.08.2012 17:04:29;15.08.2012 17:05:30;15.08.2012 17:06:31;15.08.2012 17:07:31;15.08.2012 17:08:32;15.08.2012 17:09:33;15.08.2012 17:10:33;15.08.2012 17:11:34;15.08.2012 17:12:35;15.08.2012 17:13:35;15.08.2012 17:14:36;15.08.2012 17:15:36;15.08.2012 17:16:36;15.08.2012 17:17:38;15.08.2012 17:18:38;15.08.2012 17:19:39;15.08.2012 17:20:39;15.08.2012 17:21:40;15.08.2012 17:22:41;15.08.2012 17:23:41;15.08.2012 17:24:42;15.08.2012 17:25:43;15.08.2012 17:26:43;15.08.2012 17:27:44;15.08.2012 17:28:45;15.08.2012 17:29:46;15.08.2012 17:30:47;15.08.2012 17:31:47;15.08.2012 17:32:48;15.08.2012 17:33:48;15.08.2012 17:34:48;15.08.2012 17:35:50;15.08.2012 17:36:50;15.08.2012 17:37:51;15.08.2012 17:38:51;15.08.2012 17:39:52;15.08.2012 17:40:53;15.08.2012 17:41:53;15.08.2012 17:42:54;15.08.2012 17:43:54;15.08.2012 17:44:56;15.08.2012 17:45:56;15.08.2012 17:46:57;15.08.2012 17:47:57;15.08.2012 17:48:58;15.08.2012 17:49:58;15.08.2012 17:50:59;15.08.2012 17:52:01;15.08.2012 17:53:01;15.08.2012 17:54:02;15.08.2012 17:55:02;15.08.2012 17:56:03;15.08.2012 17:57:04;15.08.2012 17:58:04;15.08.2012 17:59:05;15.08.2012 18:00:05;15.08.2012 18:01:07;15.08.2012 18:02:07;15.08.2012 18:03:08;15.08.2012 18:04:08;15.08.2012 18:05:08;15.08.2012 18:06:10;15.08.2012 18:07:09;15.08.2012 18:08:10;15.08.2012 18:09:11;15.08.2012 18:10:11;15.08.2012 18:11:13;15.08.2012 18:12:13;15.08.2012 18:13:13;15.08.2012 18:14:14;15.08.2012 18:15:14;15.08.2012 18:16:15;15.08.2012 18:17:15;15.08.2012 18:18:17;15.08.2012 18:19:17;15.08.2012 18:20:18;15.08.2012 18:21:18;15.08.2012 18:22:20;15.08.2012 18:23:20;15.08.2012 18:24:21;15.08.2012 18:25:21;15.08.2012 18:26:21;15.08.2012 18:27:23;15.08.2012 18:28:23;15.08.2012 18:29:24;15.08.2012 18:30:24;15.08.2012 18:31:25;15.08.2012 18:32:25;15.08.2012 18:33:26;15.08.2012 18:34:26;15.08.2012 18:35:27;15.08.2012 18:36:28;15.08.2012 18:37:28;15.08.2012 18:38:29;15.08.2012 18:39:29;15.08.2012 18:40:29;15.08.2012 18:41:32;15.08.2012 18:42:32;15.08.2012 18:43:32;15.08.2012 18:44:33;15.08.2012 18:45:34;15.08.2012 18:46:34;15.08.2012 18:47:35;15.08.2012 18:48:35;15.08.2012 18:49:37;15.08.2012 18:50:37;15.08.2012 18:51:37;15.08.2012 18:52:38;15.08.2012 18:53:38;15.08.2012 18:54:40;15.08.2012 18:55:39;15.08.2012 18:56:41;15.08.2012 18:57:42;15.08.2012 18:58:42;15.08.2012 18:59:42;15.08.2012 19:00:43;15.08.2012 19:01:44;15.08.2012 19:02:44;15.08.2012 19:03:46;15.08.2012 19:04:46;15.08.2012 19:05:46;15.08.2012 19:06:46;15.08.2012 19:07:47;15.08.2012 19:08:47;15.08.2012 19:09:49;15.08.2012 19:10:49;15.08.2012 19:11:50;15.08.2012 19:12:50;15.08.2012 19:13:51;15.08.2012 19:14:52;15.08.2012 19:15:53;15.08.2012 19:16:53;15.08.2012 19:17:53;15.08.2012 19:18:54;15.08.2012 19:19:54;15.08.2012 19:20:55;15.08.2012 19:21:57;15.08.2012 19:22:57;15.08.2012 19:23:58;15.08.2012 19:24:58;15.08.2012 19:26:00;15.08.2012 19:27:00;15.08.2012 19:28:01;15.08.2012 19:29:02;15.08.2012 19:30:02;15.08.2012 19:31:03;15.08.2012 19:32:03;15.08.2012 19:33:03;15.08.2012 19:34:05;15.08.2012 19:35:05;15.08.2012 19:36:06;15.08.2012 19:37:07;15.08.2012 19:38:07;15.08.2012 19:39:08;15.08.2012 19:40:07;15.08.2012 19:41:08;15.08.2012 19:42:09;15.08.2012 19:43:10;15.08.2012 19:49:27;15.08.2012 19:54:28;15.08.2012 19:59:28;15.08.2012 20:04:28;15.08.2012 20:09:29;15.08.2012 20:14:30;15.08.2012 20:19:31;15.08.2012 20:24:32;15.08.2012 20:29:32;15.08.2012 20:34:32;15.08.2012 20:39:33;15.08.2012 20:44:33;15.08.2012 20:49:35;15.08.2012 20:54:36;15.08.2012 20:59:36;15.08.2012 21:04:36;15.08.2012 21:09:37;15.08.2012 21:14:38;15.08.2012 21:19:39;15.08.2012 21:24:39;15.08.2012 21:29:39;15.08.2012 21:34:40;15.08.2012 21:39:41;15.08.2012 21:44:41;15.08.2012 21:49:42;15.08.2012 21:54:43;15.08.2012 21:59:44;15.08.2012 22:04:44;15.08.2012 22:09:45;15.08.2012 22:14:45;15.08.2012 22:19:46;15.08.2012 22:24:47;15.08.2012 22:29:47;15.08.2012 22:34:48;15.08.2012 22:39:48;15.08.2012 22:44:49;15.08.2012 22:49:50;15.08.2012 22:54:50;15.08.2012 22:59:51;15.08.2012 23:04:52;15.08.2012 23:09:53;15.08.2012 23:14:53;15.08.2012 23:19:54;15.08.2012 23:24:54;15.08.2012 23:29:55;15.08.2012 23:34:55;15.08.2012 23:39:56;15.08.2012 23:44:58;15.08.2012 23:49:58;15.08.2012 23:54:58;15.08.2012 23:59:59;16.08.2012 00:04:59;16.08.2012 00:10:00;16.08.2012 00:15:01;16.08.2012 00:20:01;16.08.2012 00:25:03;16.08.2012 00:30:02;16.08.2012 00:35:03;16.08.2012 00:40:04;16.08.2012 00:45:04;16.08.2012 00:50:06;16.08.2012 00:55:06;16.08.2012 01:00:06;16.08.2012 01:05:07;16.08.2012 01:10:08;16.08.2012 01:15:08;16.08.2012 01:20:09;16.08.2012 01:25:09;16.08.2012 01:30:10;16.08.2012 01:35:11;16.08.2012 01:40:12;16.08.2012 01:45:12;16.08.2012 01:50:13;16.08.2012 01:55:14;16.08.2012 02:00:14;16.08.2012 02:05:14;16.08.2012 02:10:15;16.08.2012 02:15:16;16.08.2012 02:20:17;16.08.2012 02:25:18;16.08.2012 02:30:19;16.08.2012 02:33:21;16.08.2012 02:34:21;16.08.2012 02:35:22;16.08.2012 02:36:23;16.08.2012 02:37:24;16.08.2012 02:38:25;16.08.2012 02:39:25;16.08.2012 02:40:25;16.08.2012 02:41:26;16.08.2012 02:42:27;16.08.2012 02:43:27;16.08.2012 02:44:28;16.08.2012 02:45:29;16.08.2012 02:46:30;16.08.2012 02:47:30;16.08.2012 02:48:31;16.08.2012 02:49:32;16.08.2012 02:50:31;16.08.2012 02:51:33;16.08.2012 02:52:33;16.08.2012 02:53:33;16.08.2012 02:54:35;16.08.2012 02:55:36;16.08.2012 02:56:35;16.08.2012 02:57:36;16.08.2012 02:58:37;16.08.2012 02:59:38;16.08.2012 03:00:38;16.08.2012 03:01:39;16.08.2012 03:02:40;16.08.2012 03:03:40;16.08.2012 03:04:41;16.08.2012 03:05:41;16.08.2012 03:06:42;16.08.2012 03:07:43;16.08.2012 03:08:43;16.08.2012 03:09:44;16.08.2012 03:10:45;16.08.2012 03:11:45;16.08.2012 03:12:46;16.08.2012 03:13:47;16.08.2012 03:14:47;16.08.2012 03:36:04;16.08.2012 03:56:05;16.08.2012 04:16:05;16.08.2012 04:36:07;16.08.2012 04:56:07;16.08.2012 05:16:07;16.08.2012 05:36:08;16.08.2012 05:56:08;16.08.2012 06:16:09;16.08.2012 06:36:10;16.08.2012 06:56:11;16.08.2012 07:16:11;16.08.2012 07:36:13;16.08.2012 07:56:13;16.08.2012 08:16:14;16.08.2012 08:36:14;16.08.2012 08:56:15;16.08.2012 09:16:16;16.08.2012 09:36:16;16.08.2012 09:56:16;16.08.2012 10:16:18;16.08.2012 10:36:18    2587  non-null values
dtypes: object(1)

Anyone have an idea how I can slice the data and use it for further calculations?

PS: I need to keep the Depth column:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.