Add example using pandas Series to map_partition doctring (#7323)#9161
Conversation
|
Can one of the admins verify this patch? |
|
|
||
| >>> d = [1, 2, 3, 4, 5] | ||
| >>> s = pd.Series(data=d) | ||
| >>> ds = dd.from_pandas(s, npartitions=2) |
There was a problem hiding this comment.
Since this is a part of the border example, I'm wondering if it'll be nicer to re-use the same ddf in the example instead of defining a new Series?
Something like:
>>> res = ddf.x.map_partitions(lambda x: len(x)) # ddf.x is a Dask Series Structure
>>> res.dtype
dtype('int64')There was a problem hiding this comment.
This makes a lot of sense, thanks for the suggestion! Added in commit 9595b03.
|
@Alex-JG3 I see this is your first PR. Welcome to Dask, and thanks for opening this! |
|
Nothing for the PR author to do here (this is a note about a flaky CI test). This CI build failed on Linux Python 3.10 with cc @ian-r-rose (for vis) |
|
ok to test |
|
This looks great! Thanks for the contribution @Alex-JG3 |
pre-commit run --all-files