Skip to content

Commit

Permalink
improve README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnault Chazareix committed Jan 21, 2021
1 parent 8b45bb3 commit b80472c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,33 @@ from stqdm import stqdm
for _ in stqdm(range(50), desc="This is a slow task", mininterval=1):
sleep(0.5)
```

### Display a progress bar during pandas Dataframe & Series operations
STqdm inherits from tqdm, you can call stqdm.pandas() in a similar way. See [tqdm docs](https://github.com/tqdm/tqdm#pandas-integration).
```python
from time import sleep

import pandas as pd
from stqdm import stqdm

stqdm.pandas()

pd.Series(range(50)).progress_map(lambda x: sleep(1))
pd.Dataframe({"a": range(50)}).progress_apply(lambda x: sleep(1), axis=1)
```

### Display the progress bar only in the frontend or the backend

```python
from time import sleep

from stqdm import stqdm

# Default to frontend only
for i in stqdm(range(50), backend=False, frontend=True):
sleep(0.5)


for i in stqdm(range(50), backend=True, frontend=False):
sleep(0.5)
```

0 comments on commit b80472c

Please sign in to comment.