Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83232 > unrolled thread

how to select all the monday form "20150101" till "20150620"?

Started bylength power <elearn2014@gmail.com>
First post2015-01-05 13:49 +0800
Last post2015-01-05 13:49 +0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  how to select all the monday form "20150101" till "20150620"? length power <elearn2014@gmail.com> - 2015-01-05 13:49 +0800

#83232 — how to select all the monday form "20150101" till "20150620"?

Fromlength power <elearn2014@gmail.com>
Date2015-01-05 13:49 +0800
Subjecthow to select all the monday form "20150101" till "20150620"?
Message-ID<mailman.17389.1420459595.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

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?

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web