dsfdfw

Untitled

Jul 5th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. def create_repeated_list(dict_a, dict_b):
  2. result = []
  3.  
  4. for key, value in dict_b.items():
  5. if value > 0:
  6. if 'Physician_1' in dict_a and key <= len(dict_a['Physician_1']):
  7. list_to_repeat = [0.0 if v == -0.0 else v for v in dict_a['Physician_1'][key - 1].values()]
  8. for _ in range(int(value)):
  9. result.extend(list_to_repeat)
  10. else:
  11. print(f"Schlüssel {key} nicht in dict_a['Physician_1'] gefunden")
  12.  
  13. return result
Advertisement
Add Comment
Please, Sign In to add comment