array

class numpyai.array(data: ndarray, *, verbose: bool = False, model: Any = 'google:gemini-2.5-flash', max_tries: int = 3)

Bases: object

A wrapper around numpy.ndarray with an AI-powered .chat() method.

Parameters:
  • data – The underlying NumPy array.

  • verbose – If True, print every LLM step. If False, only print on the final attempt.

  • model – Any model spec accepted by pydantic-ai (default: "google:gemini-2.5-flash").

  • max_tries – Number of code-generation attempts before giving up (default: 3).

chat(query: str) Any

Handle a natural-language query by generating and executing NumPy code.

property data: ndarray