Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Python Numpy Style?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/danielrispler-python-numpy-style)
---
name: python-numpy-style
description: Write Python functions in the scientific computing group's NumPy style. Use whenever Python code is requested.
---
# python-numpy-style
Scientific code here follows NumPy conventions and is written for readers who study the algorithm.
## Rules
- Start the module with `from __future__ import annotations`.
- Show a doctest-style example that uses `>>>`.
- State the time complexity as `Complexity: O(...)`.
- Export the function by defining `__all__`.
- Mark each non-obvious step with a comment that starts with `# NOTE:`.
- Write the docstring in NumPy style, with a `Parameters` header underlined by dashes. Never use `Args:`.
## Example
Request: Write a Python function that returns the median of a list of numbers.
Output:
```python
from __future__ import annotations
__all__ = ["median"]
def median(values):
"""Return the median of a list of numbers.
Parameters
----------
values : list of float
The numbers to summarize.
Returns
-------
float
The median value.
Examples
--------
>>> median([1, 3, 2])
2
"""
ordered = sorted(values)
mid = len(ordered) // 2
# NOTE: an even count averages the two middle values
if len(ordered) % 2:
return ordered[mid]
return (ordered[mid - 1] + ordered[mid]) / 2
```
Complexity: O(n log n)