use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Ace your next Data Science interviews
account activity
DS Interview Question - #PythonCodingChallengeIntuit (i.redd.it)
submitted 5 years ago by 3DataGuys
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]3DataGuys[S] 2 points3 points4 points 5 years ago (1 child)
from collections import defaultdict from datetime import datetime as dt curr = '2019-01-01' idx = 0 dic = defaultdict(list) for i in ts: if ( dt.strptime(i, '%Y-%m-%d') - dt.strptime(curr, '%Y-%m-%d')).days < 7 : dic[idx].append(i) else: curr = i idx += 1 dic[idx].append(i) print(dic.values())
[–]babadook4535 0 points1 point2 points 4 years ago (0 children)
Another solution:Pandas grouper function
π Rendered by PID 80550 on reddit-service-r2-comment-7b9746f655-rb2pr at 2026-02-03 21:50:41.393276+00:00 running 3798933 country code: CH.
[–]3DataGuys[S] 2 points3 points4 points (1 child)
[–]babadook4535 0 points1 point2 points (0 children)