Skip to content

Commit e992fc4

Browse files
authored
drivendataorg#10 Simplified import mechanism
1 parent 8852e1c commit e992fc4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Install latest `pandas-path` with `pip`.
1818
pip install pandas-path
1919
```
2020

21-
Import `path` from `pandas_path`, and then the `.path` accessor will be available on any Series or Index:
21+
Import `pandas_path.path`, and then the `.path` accessor will be available on any Series or Index:
2222

2323
```python
2424
# this is all you need
25-
from pandas_path import path
25+
import pandas_path.path
2626
```
2727

2828
Now you can use all the pathlib methods using the `.path` accessor on any Series in `pandas`!
@@ -54,10 +54,11 @@ import pandas as pd
5454

5555
# This is the only line you need to register `.path` as an accessor
5656
# on any Series or Index in pandas.
57-
from pandas_path import path
57+
import pandas_path.path
5858

5959
# we'll make an example series from the py files in this repo;
6060
# note that every element here is just a string--no need to make Path objects yourself
61+
# ... but of course, this also works with `Path` as well
6162
file_paths = pd.Series(str(s) for s in Path().glob('**/*.py'))
6263

6364
# 0 setup.py

0 commit comments

Comments
 (0)