https://github.com/aadya940/numpyai
A Natural Language Interface to the Numpy Library using LLMs.
https://github.com/aadya940/numpyai
ai data-analysis data-science library llm machine-learning numpy python
Last synced: 10 months ago
JSON representation
A Natural Language Interface to the Numpy Library using LLMs.
- Host: GitHub
- URL: https://github.com/aadya940/numpyai
- Owner: aadya940
- License: mit
- Created: 2025-04-01T19:10:50.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-04-09T12:59:26.000Z (10 months ago)
- Last Synced: 2025-04-09T13:44:43.423Z (10 months ago)
- Topics: ai, data-analysis, data-science, library, llm, machine-learning, numpy, python
- Language: Python
- Homepage: https://numpyai.readthedocs.io/en/latest/
- Size: 138 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### NumpyAI
A Natural Language Interface for NumPy powered by LLMs. Empowering mindful data analysis using Generative AI.
### About NumpyAI
NumpyAI enables seamless interaction with NumPy using natural language queries, making numerical computing more intuitive and efficient.
#### Key Features:
- **Natural Language Processing**: Convert plain language instructions into executable NumPy code.
- **Validation & Safety**: Automatically validates and tests generated code for correctness and security.
- **Transparency**: Logs all generated code and applies checks to ensure accuracy before execution.
- **Control**: We don't allow AI to reassign or change the internal arrays passed to `numpyai.array` or `numpyai.NumpyAISession`. We believe they need to be intentional decisions by the user.
### Installation
```sh
pip install numpyai
```
Windows
```sh
set GOOGLE_API_KEY=...
```
Linux
```sh
export GOOGLE_API_KEY=...
```
### Usage Example
#### Single Array
```python
import numpyai as npi
import numpy as np
# Ensure GOOGLE_API_KEY environment variable is set.
# Create an array instance
data = [[1, 2, 3, 4, 5, np.nan], [np.nan, 3, 5, 3.1415, 2, 2]]
arr = npi.array(data)
# Query NumPyAI with natural language
print(arr.chat("Compute the height and width of the image using NumPy.")) # Expected output: (2, 6)
```
#### Multiple Arrays
```python
import numpyai as npi
import numpy as np
arr1 = np.array([[1, 2, 3], [4, 5, 6]])
arr2 = np.random.random((2, 3))
sess = npi.NumpyAISession([arr1, arr2])
imputed_array = sess.chat("Impute the first array with the mean of the second array.")
```
### Supported LLM Vendors
- Google Gemini
### Future Enhancements
- Support for additional LLM providers (OpenAI, Anthropic, etc.)
- Interactive debugging and visualization tools