Search

Do Face Masks Really Protect Against Covid-19 As Claimed?

Public health officials have launched a protracted campaign to make us believe that wearing a face mask prevents the spread of Covid-19, the latest pandemic. But is this true? That was the question on the mind of a Duke physician, Eric Westman, who was a champion for people putting on masks. He wanted to be sure that he was recommending the right prevention technique to people and businesses. So he decided to carry out a proof-of-concept study. A proof-of-concept study is a study that aims to test whether a technique or method is really as effective as claimed. Also it is used in science as a testing phase to verify the feasibility of a method, a technique or even an idea. When scientist carry out an investigation in science, they start with an idea like this.

face mask like this are good against pandemics
 

Doctor Westman was working with a non-profit and he needed to provide face masks to people. He was also skeptical about the claims that mask providers were making about how effective their marks were against a pandemic like covid-19, so he went to a chemist and physicist at the University, Martin Fischer, Ph.D. and asked him to carry out a test on various face masks. The test they did was based on both surgical masks used in medical settings and cloth face masks. They also carried out tests on bandanas and neck fleeces used by people who claim they can prevent the spread of covid-19.

Fischer’s line of work usually involves exploring the mechanisms involved in optical contrast while doing molecular imaging studies. He was intrigued by the doctor’s challenge so he set out to help him. For the study he used materials that were freely available; something that can easily be bought online. These materials include a box, a laser, a lens, and a cell phone camera.

From the study it was reported that it proved positive and showed that face mask were effective at preventing the spread of Covid-19. They recently published their scientific study article in the journal “Science Advances”. Despite this being a low cost technique, it helped to prove that face mask prevent droplets coming out of the mouth while speaking, sneezing or coughing from being transmitted from one person to another. They reported that while carrying out the study they could see that when people speak to each other, cough, or sneeze that molecules of droplets are passed from one person to the other. They also confirmed that it is not all masks that are effective at preventing the spread of droplets. Some face coverings were seen to perform better than others in preventing the spread of droplets.

So how did the masks compare? They tried out the proof-of-concept study on various masks and compared their effectiveness. They found that the best masks were the N95 masks which were used in medical settings. They also found that surgical masks and masks made of polypropylene were equally effective in preventing the spread of droplet molecules. Face masks which were made from cotton allowed some molecules to pass through but were found to have good coverage. They could eliminate several droplets that were being passed when people were speaking. Overall it was shown that bandanas and neck fleeces should not be used at all or recommended as face covering. This was because they were ineffective in blocking the spread of droplet molecules.

When the physicist was asked if this was the final word on the subject, he replied in the negative. Therefore more studies need to be carried out because this is just a demonstration to show the effectiveness of various face masks. The study was done to help businesses see that they can carry out these tests themselves before investing on any type of face mask or face covering.

When asked on the benefits of the study, Westman, who was inspired to start it, said that many people and businesses have been asking him about how they could test all these face masks that were new in the market. So he decided to show that businesses could carry out the tests themselves with very simple materials. He said that the parts for the testing were easily purchased online and they were putting out this information to help others.

As they hoped, they have shown that various face coverings that were being promoted by public health officials were indeed effective in preventing the transmission of molecular droplets from one person to the other.

Although this is just a proof-of-concept and not a rigorous testing technique, one can confidently recommend the use of face masks to individuals and businesses because they really work in preventing the spread of covid-19. My advice to everyone is to stay safe, wear a face mask, and help stop the spread of covid-19. We will see an end to this soonest. Please, carry out social distancing and regular hand washing to prevent the spread of this current pandemic.

Material for this post was provided by the dukehealth.org website.

Application Of The Built-in Python Enumerate Function

python enumerate function
 

How many times have you ever wanted to loop through a list or tuple while keeping count of the number of times and you ended up doing it with a for-loop? For beginners, I think the answer would be many times. But that is not pythonic. For example, I notice this code often among many python programmers who are not aware of the existence of the built-in python enumerate function. They keep an antipattern consisting of a range over the length of a list while keeping a running total of how many times they have gone through the range object created.


fruits = ['mango', 'pawpaw', 'lettuce', 'orange', 'banana']
for i in range(len(fruits)):
    print(i, fruits[i])

Please, if you are doing this, it is harmful to your code and not pythonic because your code is not easy to read and is vulnerable to your making typing errors.

To prevent code like this, python has a nice function that does it elegantly called the python enumerate function.

The python enumerate function

The syntax of the python enumerate function is enumerate(iterable, start=0). This is a function that accepts an iterable as first positional argument with a start value for the counter to the iterable. The default for the start value is 0 but you can specify a starting value of your choice. When you enumerate an iterable, it gives you an enumerate object. The benefit of such an enumerate object is that it is an iterator with which you can use a for loop to return a count of the items in the enumerate object. We will get to that later. But let’s see how it works with an example of enumerate.

If you run the above code, you will find that the python enumerate function gives an enumerate object. Now, let’s loop over the enumerate object.

In the above code, I used the default start of 0 and you can see that when the counter was printed, the counter started from 0. We can tweak that feature to get a starting counter of our choice. Now for some examples of enumerate function.

So, you can see how powerful this little known feature in the python programming language is. The enumerate function gives all iterables an advantage the python dictionaries already have, which is an index notation that is compact and reliable.

So, the next question is: what can we do with the python enumerate function?

The simple answer is a lot.

Application of the python enumerate function

  1. Add a counter to a list or iterable
  2. .

    Just as in the example I gave above, there are lots of times we want to add a counter to a list or tuple, especially if it is a large list or tuple. This handy function makes it possible. You can use the counter as a key to get an item in the iterator that you want to use. For example, you have an extremely long list of cars and you want to be able to know them by number. You could use enumerate to give them a count value starting from any number and then retrieve each car based on the counter.

    For some example:

    What if we wanted to know the first, or third car?

  3. Convert to a list or tuple
  4. .

    We could convert the python enumerate object which is an iterator to a list or a tuple and use the handy functions of python lists or tuples. It is so easy to do. Just use the enumerate object as the argument to the list or tuple and it is easily done. When you have the enumerate object as a list, you can then use python list functions on them instantly.

    Here are some code examples.

    You can see from the above that I used the index of the cars_list list to get the last item in the list of cars, and then used the len function of the list to find out the number of cars in the list.

You can read about the rationale for the enumerate function from PEP 279 and its documentation at python.org.

Python Functions That Add Items To Python Lists And Their Applications

In an earlier post, I discussed on how to remove items from python lists. Today, we will expand on the concept of lists and python list functions. We will be discussing on how to add items to python lists. In doing this, we are going to be using two functions, python’s append to list and python’s extend list functions. The two do the same job of adding objects to a list but they are not cousins. I mean, they are adding very different objects and use very different concepts.

python add to list
 

First we will start by discussing the python append to list function.

Python append to list function.

The syntax for this function is list.append(x). What it says is that you are going to be adding an item, x, to the end of the list. When you call the python append list function and give it an argument, x, where x is an object, it just adds x to the end of the list. Any object can be added to the end of the list, even sequences, but they are added just as one item.

Let us give examples of the python append to list function.

You can see from running the code above that no matter the length of the object being appended or the nature of the object, it is treated as a single item. So, whenever you want to add to a list and you want to treat that object as a single item in the list, you should use the python append to list function.

Python extend list function.

The syntax of the python extend list function is list.extend(iterable). The function takes an iterable and what it does is that it iterates through each of the items in the iterable and adds them to the list. It mutates the original list based on the number of items in the argument; the python extend list function is acting like a concatenating of the original list. Therefore, you could say that while in the python append to list function the length of the list increases by 1, in the python extend list function the list increases by the number of items in the iterable.

A picture is worth a thousand words. So, let’s illustrate the concept using examples.

I used the same examples for both the python append to list and python extend list functions just to help you better understand their functionality. You could see that for the cases, the python extend list function gives lists of longer length.

These two python list functions are not the only way you can add items to a python list. There are overloaded methods we could also use.

Using overloaded operators to add to python lists.

Operator overloading or function overloading is when the same built-in operator like + or * have different behaviors for different objects or classes. You might have noticed this earlier in your python journey. For example, adding integers, 2 + 3, gives a different behavior for the + operator from adding strings, ‘mango’ + ‘banana’.

We will discuss how the + and += operators are used to add iterables to lists. They are both semantically similar to the python extend list function. When using either of them, the second object must be an iterable, otherwise python will return an error.

Here is some code to show how these overloaded operators work.

So you now have at your arsenal methods to add items to python lists.

Happy pythoning.

To cap it all, note that the worst case complexity of the python append to list function is O(1) i.e constant complexity while that of python extend list is O(k) where k is the length of the iterable that is being used to extend the original list.

Matched content