Question: I'm pretty new of RN but I don't really understand Promises with async.
I got how works but I don't use them correctly cause they don't work in my code.
Example

```js
 const getAnimationTime = () => {
  let res = meditationTime;
  return new Promise(resolve => resolve(res));
};

```

and then:

```js
 useEffect(() => {
      (async function fetchData() {
        const fetcher = await getAnimationTime();
        console.log('fetcher', fetcher);
        setAnimationTime(fetcher);
      })();
      console.log('anitime useEffect', animationTime);
    }, []);

```

I did what I saw in tutorials and doesn't work. In this case, I always get `undefined`

Can someone explain to me how works?
Thanks!

Answer: 
Use [`DataFrame.cumsum`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.cumsum.html), compare if greater like `0` and convert mask to `0,1` value by [`DataFrame.astype`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.astype.html):

```
df = df.cumsum(axis=1).gt(0).astype(int)
print (df)
       Day1  Day2  Day3  Day4
Index                        
1         0     1     1     1
2         1     1     1     1
3         0     0     0     0

```
Use Pandas Dataframe .transform() method. Check for membership in the row and replace.

```
df.transform(lambda row: [1]*4 if 1 in row.values else row, axis=1)

```