Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.034 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'column': 0.07; 'string': 0.09; 'question?': 0.09; 'statistical': 0.09; 'python': 0.11; 'suggest': 0.14; 'windows': 0.15; 'appreciated!': 0.16; 'discusses': 0.16; 'former,': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'all,': 0.19; 'trying': 0.19; 'seems': 0.21; 'header:User- Agent:1': 0.23; 'entries': 0.24; '(or': 0.24; 'somewhere': 0.26; 'asking': 0.27; 'header:In-Reply-To:1': 0.27; '(like': 0.30; 'gary': 0.31; 'subject:time': 0.33; 'table': 0.34; "i'd": 0.34; 'but': 0.35; 'there': 0.35; 'dates': 0.36; 'module.': 0.36; 'entry': 0.36; 'turn': 0.37; 'received:10': 0.37; 'question,': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'guidance': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'first': 0.61; 'date,': 0.68; 'institute': 0.72; 'records': 0.73; 'received:10.10': 0.74; 'received:204': 0.75; 'analysis': 0.75; 'day': 0.76; 'dr.': 0.77; '11am': 0.84 Date: Fri, 05 Jul 2013 12:47:49 -0700 From: Gary Herron User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: python-list@python.org Subject: Re: analyzing time References: <2aa041fe-8226-4fb9-9ce6-b1eb48a19e4d@googlegroups.com> In-Reply-To: <2aa041fe-8226-4fb9-9ce6-b1eb48a19e4d@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373054109 news.xs4all.nl 16010 [2001:888:2000:d::a6]:53332 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50014 On 07/05/2013 12:18 PM, noydb wrote: > Hello All, > > I have a table with a column of type date, with dates and time combined (like '1/6/2013 3:52:69PM'), that spans many months. How would I pull out records that are the first and last entries per day? > > Also, if I wanted to find time clusters per day (or per week) -- like if an entry is made every day around 11am -- is there a way to get at that temporal statistical cluster? > > Python 2.7, Windows 7. > > Any guidance would be greatly appreciated! Time seems tricky... > > Thanks, > > N Are you asking a Python question, like how to turn a string "1/6/2013 3:52:69PM" into an internal representation of time, or are you asking a data analysis and statistical question? If the former, then look at datetime.strptime from the datetime module. If the later, then you may get an answer here, but I'd suggest trying somewhere that discusses statistics and analysis. Gary Herron -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418