array

class numpyai.array(data)

Bases: object

A wrapper around numpy.ndarray providing AI-powered functionalities and extended operations.

Parameters:

data – numpy.ndarray The data of the array class.

assert_is_code(llm_response)

Ensure LLM response is valid Python/NumPy code.

chat(query)

Handles user queries by generating and executing NumPy code.

property data
execute_numpy_code(code, args)

Execute the generated code safely.

Parameters:
  • code – The code to execute

  • args – Either the array itself or a dict containing variables for execution

generate_numpy_code(query)

Generate valid NumPy code from the query.