Skip to content

#10 Simplified import mechanism in README #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Install latest `pandas-path` with `pip`.
pip install pandas-path
```

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

```python
# this is all you need
from pandas_path import path
import pandas_path.path
```

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

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

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

# 0 setup.py
Expand Down