Scidbpy list arrays fails and how to download array to numpy


We received the following query from one of our users:

I’m trying to use SciDb-Py module for connect a script to Scidb but I have some problems.

The first one is in the following example:

from scidbpy import connect
import numpy as np
import time

sdb = connect('http://localhost:8080')


sdb.query("create array matriz <valor:int64>[i=0:3,1,0,j=0:3,1,0]")

X = sdb.random(10, persistent=False)  # default
A = 'arrays', False )
print A

I want to know what is the arrays i have in my database, but the query fail.

Other thing that i want to do is, for example in my database i have two arrays (‘array1’ and ‘array2’), how i do for get all the data in a numpy array in python?


Here is the solution:

You can try the following code to view the lists of arrays (note that you need to escape the quote character):

A = "\'arrays\'", False )
print A.toarray()
print A.todataframe()

To download any array to Python, say your array A:

Ap = sdb.wrap_array("A")