You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
684: Add pandas support r=hgrecco a=znicholls
This pull request adds pandas support to pint (hence is related to #645, #401 and pandas-dev/pandas#10349).
An example can be seen in `example-notebooks/basic-example.ipynb`.
It's a little bit hacksih, feedback would be greatly appreciated by me and @andrewgsavage. One obvious example is that we have to run all the interface tests with `pytest` to fit with `pandas` test suite, which introduces a dependency for the CI and currently gives us this awkward testing setup (see the alterations we had to make to `testsuite`). This also means that our code coverage tests are fiddly too.
If you'd like us to squash the commits, that can be done.
If pint has a linter, it would be good to run that over this pull request too as we're a little bit all over the place re style.
Things to discuss:
- [x] general feedback and changes
- [x] test setup, especially need for pytest for pandas tests and hackish way to get around automatic discovery
- [x] squashing/rebasing
- [x] linting/other code style (related to #664 and #628: we're happy with whatever, I've found using an automatic linter e.g. black and/or flake8 has made things much simpler in other projects)
- [x] including notebooks in the repo (if we want to, I'm happy to put them under CI so we can make sure they run)
- [x] setting up the docs correctly
Co-authored-by: Zebedee Nicholls <[email protected]>
Co-authored-by: andrewgsavage <[email protected]>
Copy file name to clipboardExpand all lines: docs/index.rst
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,13 @@ points, like positions on a map or absolute temperature scales.
102
102
**Python 2 and 3**: a single codebase that runs unchanged in Python 2.7+ and
103
103
Python 3.3+.
104
104
105
+
**Pandas integration**: Thanks to `Pandas Extension Types`_ it is now possible to use Pint with Pandas. Operations on DataFrames and between columns are units aware, providing even more convenience for users of Pandas DataFrames. For full details, see the `Pandas Support Documentation`_.
106
+
107
+
108
+
When you choose to use a NumPy_ ndarray, its methods and
109
+
ufuncs are supported including automatic conversion of units. For example
110
+
`numpy.arccos(q)` will require a dimensionless `q` and the units of the output
0 commit comments