I have worked on lists in g1ant but lists are 1D array, now I want to work on 2D array but I don't know how to do that it g1ant. Is there any way of doing it?
At the current state of G1ANT, it is not possible to create a 2D array as a g1ant structure. Although you can use C# snippets in which it is possible to create 2D arrays and operate on them.
Related
I have a table with some missing values which I want to find via interpolation.
Which bring me down to two questions. Is it better to input the a values into a 2D array or into a dataframe? (I am still a bit of a novice with this sort of scripts). And what would be the best way to do 2D interpolation accordingly for the missing values?
Could someone, please clarify that what is the benefit of using a Numba typed list over an ND array? Also, how do the two compares in terms of speed, and in what context would it be recommended to use the typed list?
Typed lists are useful when your need to append a sequence of elements but you do not know the total number of elements and you could not even find a reasonable bound. Such a data structure is significantly more expensive than a 1D array (both in memory space and computation time).
1D arrays cannot be resized efficiently: a new array needs to be created and a copy must be performed. However, the indexing of 1D arrays is very cheap. Numpy also provide many functions that can natively operate on them (lists are implicitly converted to arrays when passed to a Numpy function and this process is expensive). Note that is the number of items can be bounded to a reasonably size (ie. not much higher than the number of actual element), you can create a big array, then add the elements and finally work on a sub-view of the array.
ND arrays cannot be directly compared with lists. Note that lists of lists are similar to jagged array (they can contains lists of different sizes) while ND array are likes a (fixed-size) N x ... x M table. Lists of lists are very inefficient and often not needed.
As a result, use ND arrays when you can and you do not need to often resize them (or append/remove elements). Otherwise, use typed lists.
is there a way to convert a 2d array into a 1d array with sql? see picture and example below.
basically in the collapse column (see attached screenshot), instead of having array(array(int)), i'd need array(int) - so instead of [[0,0,0],[0,0,0]], i'd need [0,0,0,0,0,0]
I've resolved this by using flatten function
a=np.array([1,2,3])
b=np.array([5,6,7,8])
c=np.array([8])
d=9
I want to composite a new array:
np.array([2,7,8,8,9])
So type code :
newlist=np.concatenate((a[1],b[2:4],c,d))
But hint error:
ValueError: zero-dimensional arrays cannot be concatenated
Is single value that sliced from a np.array regarded as one dimesional array or a number?
In general, How to compose number and one dimensional array into an one demension array or list?
Just change np.concatenate() into np.hstack():
np.hstack((a[1],b[2:4],c,d))
np.hstack() takes a sequence of arrays and stacks them horizontally to make a single array.
I have written a vi in labview that converts acquired data to 2D array. Now, I want to use shift register, and what comes out from the loop, would be a 2D array that is average of all 2D arrays after that the loop is stopped by user.
I would appreciate your help
You can do something like this:
(source: hostingpics.net)