SHARE
TWEET

Untitled

a guest May 25th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. res = []
  2. people = ['xx', 'xx', 'xx']
  3.  
  4. datedb = {"201905":{"18":"2","19":"1","25":"1","26":"1"},"201906":{"01":"2","02":"2","07":"2","08":"2","09":"1","15":"2","16":"2","22":"1","23":"1","29":"1","30":"1"},"201907":{"06":"2","07":"2","13":"2","14":"2","20":"1","21":"2","27":"1","28":"1"},"201908":{"03":"2","04":"2","10":"2","11":"2","17":"1","18":"1","24":"1","25":"2","31":"1"},"201909":{"01":"1","07":"2","08":"1","13":"2","14":"2","15":"2","21":"2","22":"2","28":"1"},"201910":{"01":"2","02":"2","03":"2","04":"1","05":"1","06":"1","07":"2","13":"1","19":"1","20":"1","26":"1","27":"2"},"201911":{"02":"2","03":"2","09":"2","10":"1","16":"2","17":"2","23":"1","24":"1","30":"1"},"201912":{"01":"1","07":"2","08":"2","14":"2","15":"2","21":"1","22":"1","28":"2","29":"1"}}
  5.  
  6. for m in datedb:
  7.     for d in datedb[m]:
  8.         date = m + d
  9.         res.append(date)
  10.         print(date)
  11.  
  12. check = []
  13. out = []
  14. for item in res:
  15.     tmp = {}
  16.     for j in people:
  17.         if len(check) == 3:
  18.             check = []
  19.         if j not in check:
  20.             check.append(j)
  21.             tmp['date'] = item
  22.             tmp['name'] = j
  23.             break
  24.     out.append(tmp)
  25.  
  26. print (out)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top