| Name | pynapple JSON |
| Version |
0.10.1
JSON |
| download |
| home_page | None |
| Summary | PYthon Neural Analysis Package Pour Laboratoires d’Excellence |
| upload_time | 2025-10-30 15:30:42 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.8 |
| license | MIT License
Copyright (c) pynapple authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
| keywords |
neuroscience
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
[](https://pypi.python.org/pypi/pynapple)
[](https://github.com/pynapple-org/pynapple/actions/workflows/main.yml)
[](https://codecov.io/gh/pynapple-org/pynapple)
[](https://github.com/pynapple-org/pynapple/issues)


PYthon Neural Analysis Package.
pynapple is a light-weight python library for neurophysiological data analysis. The goal is to offer a versatile set of tools to study typical data in the field, i.e. time series (spike times, behavioral events, etc.) and time intervals (trials, brain states, etc.). It also provides users with generic functions for neuroscience such as tuning curves and cross-correlograms.
- Free software: MIT License
- __Documentation__: [<https://pynapple.org>](https://pynapple-org.github.io/pynapple/)
> **Note**
> :page_with_curl: If you are using pynapple, please cite the following [paper](https://elifesciences.org/reviewed-preprints/85786)
------------------------------------------------------------------------
Learning pynapple
-----------------
Workshops are regularly organized by the [center for Computational Neuroscience ](https://www.simonsfoundation.org/flatiron/center-for-computational-neuroscience/) of the Flatiron institute
to teach pynapple & [NeMos](https://nemos.readthedocs.io/en/latest/) to new users.
**The next workshop will take place in New York City on February 2 - 5, 2026. Register [here](https://www.simonsfoundation.org/event/flatiron-ccn-neural-data-analysis-workshop/).**
New release :fire:
------------------
### pynapple >= 0.10.0
Tuning curves computation have been generalized to n-dimensions with the function `compute_tuning_curves`.
It can now return a [xarray DataArray](https://docs.xarray.dev/en/stable/) instead of a Pandas DataFrame.
### pynapple >= 0.8.2
The objects `IntervalSet`, `TsdFrame` and `TsGroup` inherits a new metadata class. It is now possible to add labels for
each interval of an `IntervalSet`, each column of a `TsdFrame` and each unit of a `TsGroup`.
See the [documentation](https://pynapple.org/user_guide/03_metadata.html) for more details
### pynapple >= 0.7
Pynapple now implements signal processing. For example, to filter a 1250 Hz sampled time series between 10 Hz and 20 Hz:
```python
nap.apply_bandpass_filter(signal, (10, 20), fs=1250)
```
New functions includes power spectral density and Morlet wavelet decomposition. See the [documentation](https://pynapple-org.github.io/pynapple/reference/process/) for more details.
Community
---------
To ask any questions or get support for using pynapple, please consider joining our slack. Please send an email to thepynapple[at]gmail[dot]com to receive an invitation link.
Getting Started
---------------
### Installation
The best way to install pynapple is with pip inside a new [conda](https://docs.conda.io/en/latest/) environment:
``` {.sourceCode .shell}
$ conda create --name pynapple pip python=3.11
$ conda activate pynapple
$ pip install pynapple
```
Running `pip install pynapple` will install all the dependencies, including:
- pandas
- numpy
- scipy
- numba
- pynwb 2.0
- tabulate
- h5py
- xarray
For development, see the [contributor guide](CONTRIBUTING.md) for steps to install from source code.
<!-- For spyder users, it is recommended to install spyder after installing pynapple with :
``` {.sourceCode .shell}
$ conda create --name pynapple pip python=3.11
$ conda activate pynapple
$ pip install pynapple
$ pip install spyder
$ spyder
``` -->
Basic Usage
-----------
After installation, you can now import the package:
``` {.sourceCode .shell}
$ python
>>> import pynapple as nap
```
You'll find an example of the package below. Click [here](https://osf.io/fqht6) to download the example dataset. The folder includes a NWB file containing the data.
``` py
import matplotlib.pyplot as plt
import numpy as np
import pynapple as nap
# LOADING DATA FROM NWB
data = nap.load_file("A2929-200711.nwb")
spikes = data["units"]
head_direction = data["ry"]
wake_ep = data["position_time_support"]
# COMPUTING TUNING CURVES
tuning_curves = nap.compute_tuning_curves(
spikes, head_direction, 120, epochs=wake_ep, range=(0, 2 * np.pi)
)
# PLOT
g=tuning_curves.plot(
row="unit",
col_wrap=5,
subplot_kws={"projection": "polar"},
sharey=False
)
plt.xticks([0, np.pi / 2, np.pi, 3 * np.pi / 2])
g.set_titles("")
g.set_xlabels("")
plt.show()
```
Shown below, the final figure from the example code displays the firing rate of 15 neurons as a function of the direction of the head of the animal in the horizontal plane.
<!--  -->
<p align="center">
<img width="80%" src="doc/_static/readme_figure.png">
</p>
### Credits
Special thanks to Francesco P. Battaglia
(<https://github.com/fpbattaglia>) for the development of the original
*TSToolbox* (<https://github.com/PeyracheLab/TStoolbox>) and
*neuroseries* (<https://github.com/NeuroNetMem/neuroseries>) packages,
the latter constituting the core of *pynapple*.
This package was developped by Guillaume Viejo
(<https://github.com/gviejo>) and other members of the Peyrache Lab.
<!-- Logo: Sofia Skromne Carrasco, 2021. -->
## Contributing
We welcome contributions, including documentation improvements. For more information, see the [contributor guide](CONTRIBUTING.md).
Raw data
{
"_id": null,
"home_page": null,
"name": "pynapple",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "neuroscience",
"author": null,
"author_email": "Guillaume Viejo <guillaume.viejo@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/b5/71/f378e06c077c5c84b95c51c79a1b30ad8b725c04e665e23ce58b9e6dfd09/pynapple-0.10.1.tar.gz",
"platform": null,
"description": "\n\n[](https://pypi.python.org/pypi/pynapple)\n[](https://github.com/pynapple-org/pynapple/actions/workflows/main.yml)\n[](https://codecov.io/gh/pynapple-org/pynapple)\n[](https://github.com/pynapple-org/pynapple/issues)\n\n\n\nPYthon Neural Analysis Package.\n\npynapple is a light-weight python library for neurophysiological data analysis. The goal is to offer a versatile set of tools to study typical data in the field, i.e. time series (spike times, behavioral events, etc.) and time intervals (trials, brain states, etc.). It also provides users with generic functions for neuroscience such as tuning curves and cross-correlograms.\n\n- Free software: MIT License\n- __Documentation__: [<https://pynapple.org>](https://pynapple-org.github.io/pynapple/)\n\n> **Note**\n> :page_with_curl: If you are using pynapple, please cite the following [paper](https://elifesciences.org/reviewed-preprints/85786)\n\n------------------------------------------------------------------------\n\nLearning pynapple\n-----------------\n\nWorkshops are regularly organized by the [center for Computational Neuroscience ](https://www.simonsfoundation.org/flatiron/center-for-computational-neuroscience/) of the Flatiron institute \nto teach pynapple & [NeMos](https://nemos.readthedocs.io/en/latest/) to new users. \n\n**The next workshop will take place in New York City on February 2 - 5, 2026. Register [here](https://www.simonsfoundation.org/event/flatiron-ccn-neural-data-analysis-workshop/).**\n\n\nNew release :fire:\n------------------\n\n### pynapple >= 0.10.0\n\nTuning curves computation have been generalized to n-dimensions with the function `compute_tuning_curves`.\nIt can now return a [xarray DataArray](https://docs.xarray.dev/en/stable/) instead of a Pandas DataFrame.\n\n\n### pynapple >= 0.8.2\n\nThe objects `IntervalSet`, `TsdFrame` and `TsGroup` inherits a new metadata class. It is now possible to add labels for \neach interval of an `IntervalSet`, each column of a `TsdFrame` and each unit of a `TsGroup`.\n\nSee the [documentation](https://pynapple.org/user_guide/03_metadata.html) for more details\n\n### pynapple >= 0.7\n\nPynapple now implements signal processing. For example, to filter a 1250 Hz sampled time series between 10 Hz and 20 Hz:\n\n```python\nnap.apply_bandpass_filter(signal, (10, 20), fs=1250)\n```\nNew functions includes power spectral density and Morlet wavelet decomposition. See the [documentation](https://pynapple-org.github.io/pynapple/reference/process/) for more details.\n\n\nCommunity\n---------\n\nTo ask any questions or get support for using pynapple, please consider joining our slack. Please send an email to thepynapple[at]gmail[dot]com to receive an invitation link.\n\nGetting Started\n---------------\n\n### Installation\n\nThe best way to install pynapple is with pip inside a new [conda](https://docs.conda.io/en/latest/) environment:\n \n``` {.sourceCode .shell}\n$ conda create --name pynapple pip python=3.11\n$ conda activate pynapple\n$ pip install pynapple\n```\n\n\nRunning `pip install pynapple` will install all the dependencies, including: \n\n- pandas\n- numpy\n- scipy\n- numba\n- pynwb 2.0\n- tabulate\n- h5py\n- xarray\n\nFor development, see the [contributor guide](CONTRIBUTING.md) for steps to install from source code.\n\n<!-- For spyder users, it is recommended to install spyder after installing pynapple with :\n\n``` {.sourceCode .shell}\n$ conda create --name pynapple pip python=3.11\n$ conda activate pynapple\n$ pip install pynapple\n$ pip install spyder\n$ spyder\n``` -->\n\n\nBasic Usage\n-----------\n\nAfter installation, you can now import the package: \n\n``` {.sourceCode .shell}\n$ python\n>>> import pynapple as nap\n```\n\nYou'll find an example of the package below. Click [here](https://osf.io/fqht6) to download the example dataset. The folder includes a NWB file containing the data.\n\n``` py\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nimport pynapple as nap\n\n# LOADING DATA FROM NWB\ndata = nap.load_file(\"A2929-200711.nwb\")\n\nspikes = data[\"units\"]\nhead_direction = data[\"ry\"]\nwake_ep = data[\"position_time_support\"]\n\n# COMPUTING TUNING CURVES\ntuning_curves = nap.compute_tuning_curves(\n spikes, head_direction, 120, epochs=wake_ep, range=(0, 2 * np.pi)\n)\n\n# PLOT\ng=tuning_curves.plot(\n row=\"unit\", \n col_wrap=5, \n subplot_kws={\"projection\": \"polar\"}, \n sharey=False\n)\nplt.xticks([0, np.pi / 2, np.pi, 3 * np.pi / 2])\ng.set_titles(\"\")\ng.set_xlabels(\"\")\nplt.show()\n```\nShown below, the final figure from the example code displays the firing rate of 15 neurons as a function of the direction of the head of the animal in the horizontal plane.\n\n<!--  -->\n<p align=\"center\">\n <img width=\"80%\" src=\"doc/_static/readme_figure.png\">\n</p>\n\n\n### Credits\n\nSpecial thanks to Francesco P. Battaglia\n(<https://github.com/fpbattaglia>) for the development of the original\n*TSToolbox* (<https://github.com/PeyracheLab/TStoolbox>) and\n*neuroseries* (<https://github.com/NeuroNetMem/neuroseries>) packages,\nthe latter constituting the core of *pynapple*.\n\nThis package was developped by Guillaume Viejo\n(<https://github.com/gviejo>) and other members of the Peyrache Lab.\n\n<!-- Logo: Sofia Skromne Carrasco, 2021. -->\n\n## Contributing\n\nWe welcome contributions, including documentation improvements. For more information, see the [contributor guide](CONTRIBUTING.md).\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) pynapple authors\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "PYthon Neural Analysis Package Pour Laboratoires d\u2019Excellence",
"version": "0.10.1",
"project_urls": {
"documentation": "http://pynapple.org/",
"homepage": "http://pynapple.org/",
"repository": "https://github.com/pynapple-org/pynapple"
},
"split_keywords": [
"neuroscience"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "dc1de4ed733912a6a024446d1e5d19bc56ff767bf2eb9e347de4d630989dfebd",
"md5": "fe01d9e32780018269218848c31fd223",
"sha256": "a7c077607a1c23febf25d857d69df564c3b1dae102aaed758043e69cb19cb8ee"
},
"downloads": -1,
"filename": "pynapple-0.10.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fe01d9e32780018269218848c31fd223",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 141897,
"upload_time": "2025-10-30T15:30:38",
"upload_time_iso_8601": "2025-10-30T15:30:38.943654Z",
"url": "https://files.pythonhosted.org/packages/dc/1d/e4ed733912a6a024446d1e5d19bc56ff767bf2eb9e347de4d630989dfebd/pynapple-0.10.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b571f378e06c077c5c84b95c51c79a1b30ad8b725c04e665e23ce58b9e6dfd09",
"md5": "2b1adb8f75ee12b7a5249e20fab2fe63",
"sha256": "f7c2e0231ff5948f1546424b8f404a4e24b96be335f39d548fb67c80ddadde0a"
},
"downloads": -1,
"filename": "pynapple-0.10.1.tar.gz",
"has_sig": false,
"md5_digest": "2b1adb8f75ee12b7a5249e20fab2fe63",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 89073591,
"upload_time": "2025-10-30T15:30:42",
"upload_time_iso_8601": "2025-10-30T15:30:42.197579Z",
"url": "https://files.pythonhosted.org/packages/b5/71/f378e06c077c5c84b95c51c79a1b30ad8b725c04e665e23ce58b9e6dfd09/pynapple-0.10.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-30 15:30:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pynapple-org",
"github_project": "pynapple",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "pynapple"
}