Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!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: UNSURE 0.334 X-Spam-Level: *** X-Spam-Evidence: '*H*': 0.44; '*S*': 0.11; 'subject:form': 0.07; 'skip:p 40': 0.19; 'import': 0.22; 'message-id:@mail.gmail.com': 0.30; 'subject:all': 0.32; 'subject:the': 0.34; 'monday': 0.35; 'received:google.com': 0.35; 'to:addr:python-list': 0.38; 'skip:& 20': 0.39; 'subject:" ': 0.39; 'to:addr:python.org': 0.39; 'till': 0.61; 'more': 0.64; '\xc2\xa0\xc2\xa0': 0.74; 'day': 0.76; 'all\xc2\xa0': 0.84; 'skip:: 20': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=UCX9L7N+nH2n0sL9QyhRE/Wb/gZMbBg/jxxOHZ+DSLI=; b=DGfEOA1wXC4b9VlChrt4yfgLYryMQydWGyV7zOJ0MCG4KakuhJk5z2CgmWHF8D8qTa yu0L5dTZJMiUQNMtjof4OBqAlJMX4csEKOFhbNc9vzV+Qvmaup7OVM4aIHXWBHC2pckx fh/ZHfgJRQik54U/Am6dsRZpzob+so1sO38NIkwEBjPdTYbRk9JVWD6nef9O0uPEYZWK p4wjR7SnCLkBRYYo/k6n3ifm/8omgpGxM1Ae0v7L1aOySMOPfI6Y3aZwzODglQ6Sqgky GVBL2j8ecgB5IvV808EfUIm/AACp0Zm3gEz2FnR5ziLNgWqstmdm4g3L14CDrmM7nrVk 9zOg== MIME-Version: 1.0 X-Received: by 10.112.189.38 with SMTP id gf6mr42270300lbc.65.1420436962543; Sun, 04 Jan 2015 21:49:22 -0800 (PST) Date: Mon, 5 Jan 2015 13:49:22 +0800 Subject: how to select all the monday form "20150101" till "20150620"? From: length power To: python-list@python.org Content-Type: multipart/alternative; boundary=001a11c36e28940dbf050be14057 X-Mailman-Approved-At: Mon, 05 Jan 2015 13:06:34 +0100 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1420459595 news.xs4all.nl 2922 [2001:888:2000:d::a6]:32988 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83232 --001a11c36e28940dbf050be14057 Content-Type: text/plain; charset=UTF-8 import pandas as pd rng = pd.date_range("20150101","20150620",freq="D") for day in rng: x = pd.to_datetime(day) y = x.timetuple().tm_wday if(y == 0) :print(x.strftime("%Y%m%d")) I have selected all the monday form "20150101" till "20150620",how to make it more simple? --001a11c36e28940dbf050be14057 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
import pandas as pd
rng =3D pd.date_range("20= 150101","20150620",freq=3D"D")
for day in rng:<= br>=C2=A0=C2=A0 x =3D pd.to_datetime(day)
=C2=A0=C2=A0 y =3D x.timetuple= ().tm_wday
=C2=A0=C2=A0 if(y =3D=3D 0) :print(x.strftime("%Y%m%d&qu= ot;))


I have selected all=C2=A0 the monday form "2015= 0101" till "20150620",how to make it more simple?


--001a11c36e28940dbf050be14057--