@ncdcgov · Post #4380 · 16.09.2024 г., 08:18
What is #diphtheria❓ Who is most at risk of getting infected❓ What are the signs and symptoms of #diphtheria infection❓ Watch & share 👇🏼 🔗https://youtu.be/6ZAgfCBDh0c?feature=shared
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #65 · 8 апр.
Небольшой трик с регулярными выражениями который редко вижу в чужом коде. Допустим, вам нужно распарсить простой текст и вытащить оттуда пары имя+телефон. Вернуть всё это надо в виде списка словарей. Возьмем очень простой пример текста. >>> text = ''' >>> Alex:8999123456 >>> Mike:+799987654 >>> Oleg:+344456789 >>> ''' Соответственно, для выделения нужных элементов будем использовать группы. Получится такой паттерн: (\w+):([\d+]+) Как мы будем формировать словарь из найденных групп? >>> import re >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append({ >>> "name": match.group(1), >>> "phone": match.group(2) >>> }) >>> print(results) [{'name': 'Alex', 'phone': '8999123456'}, ...] Можно немного сократить запись используя zip >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append(dict(zip(['name', 'phone'], match.groups()))) Но есть способ лучше! Это именованные группы в regex. Можно в паттерне указать имя группы и результат сразу забрать в виде словаря. >>> for match in re.finditer(r"(?P<name>\w+):(?P<phone>[\d+]+)", text): >>> results.append(match.groupdict()) То есть всё что я сделал, это добавил в начале группы (внутри сбокочек) такую запись: (?P<group-name>...) Теперь найденная группа имеет имя и можно обратиться к ней как к элементу списка >>> name = match['name'] Либо забрать сразу весь словарь методом groupdict() >>> match.groupdict() #tricks#regex
Пребарај: #diphtheria
@ncdcgov · Post #4380 · 16.09.2024 г., 08:18
What is #diphtheria❓ Who is most at risk of getting infected❓ What are the signs and symptoms of #diphtheria infection❓ Watch & share 👇🏼 🔗https://youtu.be/6ZAgfCBDh0c?feature=shared
Hashtags
@ncdcgov · Post #4260 · 19.04.2024 г., 09:23
Share Facts NOT Fear❗ 🔗Visit our website for accurate information on #diphtheria and to stay informed! ➡️Factsheet: https://ncdc.gov.ng/diseases/info/D ➡️Public health advisory: https://ncdc.gov.ng/news/435/diphtheria-public-health-advisory-amidst-outbreak-in-nigeria ➡️Healthcare workers advisory: https://ncdc.gov.ng/news/436/diphtheria-health-advisory-for-health-care-workers-amidst-outbreak-in-nigeria ➡️Situation reports: https://ncdc.gov.ng/diseases/sitreps/?cat=18&name=An%20Update%20of%20Diphtheria%20Outbreak%20in%20Nigeria
Hashtags
@ncdcgov · Post #4258 · 17.04.2024 г., 14:10
Q: How does #diphtheria spread? A: #Diphtheria spreads easily through: ➡️Direct contact with infected people ➡️Droplets from an infected person while coughing or sneezing ➡️Contact with contaminated objects/clothing For more FAQs, watch 👇🏼 & share: 🔗 https://youtu.be/6ZAgfCBDh0c
Hashtags
@ncdcgov · Post #4253 · 15.04.2024 г., 07:59
Individuals with symptoms suggestive of #diphtheria should report to a healthcare facility immediately for diagnosis and proper treatment. Ensure you take extra precautionary measures while visiting to prevent the risk of spread. Watch & share 👇🏼 🔗https://youtu.be/6ZAgfCBDh0c?feature=shared
Hashtags
@ncdcgov · Post #4237 · 30.03.2024 г., 09:26
Individuals with symptoms suggestive of #diphtheria should report to a healthcare facility immediately for diagnosis and proper treatment. Ensure you take extra precautionary measures while visiting to prevent the risk of spread. Watch & share 👇🏼 🔗https://youtu.be/6ZAgfCBDh0c?feature=shared
Hashtags
@ncdcgov · Post #4236 · 29.03.2024 г., 09:03
Q: How does #diphtheria spread? A: #Diphtheria spreads easily through: ➡️Direct contact with infected people ➡️Droplets from an infected person while coughing or sneezing ➡️Contact with contaminated objects/clothing For more FAQs, watch 👇🏼 & share: 🔗 https://youtu.be/6ZAgfCBDh0c
Hashtags
@ncdcgov · Post #4233 · 27.03.2024 г., 09:14
Q: Who is at risk of #diphtheria infection? A: ➡️Children & adults who are unvaccinated or partially vaccinated with the anti-diphtheria vaccine ➡️Individuals who live in crowded or dirty environments ➡️Healthcare workers For more FAQs, watch & share👇🏼 https://youtu.be/6ZAgfCBDh0c
Hashtags
@ncdcgov · Post #4230 · 23.03.2024 г., 08:51
What is #diphtheria❓ Who is most at risk of getting infected❓ What are the signs and symptoms of #diphtheria infection❓ Watch & share 👇🏼 🔗https://youtu.be/6ZAgfCBDh0c?feature=shared
Hashtags
@ncdcgov · Post #4137 · 22.12.2023 г., 08:13
Individuals with symptoms suggestive of #diphtheria should report to a healthcare facility immediately for diagnosis and proper treatment. Ensure you take extra precautionary measures while visiting to prevent the risk of spread. Watch & share 👇🏼 🔗https://youtu.be/6ZAgfCBDh0c?feature=shared
Hashtags
@ncdcgov · Post #4136 · 21.12.2023 г., 08:43
What is #diphtheria? Who is most at risk of getting infected? What are the signs and symptoms of #diphtheria infection? Watch & share 👇🏼 🔗https://youtu.be/6ZAgfCBDh0c?feature=shared
Hashtags
@ncdcgov · Post #4134 · 18.12.2023 г., 15:52
Q: How does #diphtheria spread? A: #Diphtheria spreads easily through: ➡️Direct contact with infected people ➡️Droplets from an infected person while coughing or sneezing ➡️Contact with contaminated objects/clothing For more FAQs, watch 👇🏼 & share: 🔗 https://youtu.be/6ZAgfCBDh0c
Hashtags
@ncdcgov · Post #4131 · 15.12.2023 г., 08:28
Q: Who is at risk of #diphtheria infection? A: ➡️Children & adults who are unvaccinated or partially vaccinated with the anti-diphtheria vaccine ➡️Individuals who live in crowded or dirty environments ➡️Healthcare workers For more FAQs, watch & share👇🏼 https://youtu.be/6ZAgfCBDh0c
Hashtags