@@ -20,6 +20,8 @@ An easy to use library to speed up computation (by parallelizing on multi CPUs)
2020</tr >
2121</table >
2222
23+ ## Installation
24+ ` $ pip install pandarallel [--user] `
2325
2426
2527## Requirements
@@ -65,37 +67,14 @@ An easy to use library to speed up computation (by parallelizing on multi CPUs)
6567 ## API
6668 First, you have to import ` pandarallel ` (don't forget the double _ l_ ):
6769 ``` python
68- import pandarallel
70+ from pandarallel import pandarallel
6971 ```
70- ### DataFrame.parallel_apply
7172
72- If ` df ` is a pandas DataFrame, and ` func ` a function to apply to this DataFrame, replace
73- ``` python
74- df.apply(func, axis = 1 )
75- ```
76- by
77- ``` python
78- df.parallel_apply(func, axis = 1 )
79- ```
80-
81- _ Note: `` apply `` with `` axis=0 `` is not yet implemented._
82-
83- ### Series.parallel_map
84- If ` series ` is a pandas Series (aka a DataFrame column), and ` func ` a function to apply to this Series, replace
85- ``` python
86- series.map(func)
87- ```
88- by
89- ``` python
90- series.parallel_map(func)
91- ```
73+ | Without parallelisation | With parallelisation |
74+ | --------------------------------- | ----------------------------------------- |
75+ | ` df.apply(func, axis=1) ` | ` df.parallel_apply(func, axis=1) ` |
76+ | ` series.map(func) ` | ` series.parallel_apply(func) ` |
77+ | ` df.groupby(colname).apply(func) ` | ` df.groupby(colname).parallel_apply(func) ` |
78+
79+ _ Note: `` apply `` on DataFrane with `` axis=0 `` is not yet implemented._
9280
93- ### DataFrame.groupby.parallel_apply
94- If ` df ` is a pandas DataFrame, ` col_name ` is the name of a column of this DataFrame and ` func ` a function to apply to this column, replace
95- ``` python
96- df.groupby(col_name).apply(func)
97- ```
98- by
99- ``` python
100- df.groupby(col_name).parallel_apply(func)
101- ```
0 commit comments