Skip to content

Commit 9416b8f

Browse files
committed
patrick feedback on daks docs
1 parent 92b6ad8 commit 9416b8f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/hub/datasets-dask.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ def dummy_count_words(texts):
7171
return pd.Series([len(text.split(" ")) for text in texts])
7272
```
7373

74+
or a similar function using pandas string methods (faster):
75+
76+
```python
77+
def dummy_count_words(texts):
78+
return texts.str.count(" ")
79+
```
80+
7481
In pandas you can use this function on a text column:
7582

7683
```python

0 commit comments

Comments
 (0)