from aiida.plugins import DataFactory ArrayData = DataFactory('array') arr = [1, 2, 3, 4, 5] data = ArrayData() data.set_array(arr) print(data)
from aiida.plugins import DataFactory ArrayData = DataFactory('array') arr = [[1, 2], [3, 4], [5, 6]] data = ArrayData() data.set_array(arr) print(data)This code creates a new `ArrayData` object, sets the values of the array to a 2D array, and then prints the result. In both examples, the `DataFactory` function is used to create a new instance of the `ArrayData` class from the `aiida.plugins` package library. The `set_array` function is then called on the new Data object to set the array data. Finally, the Data object is printed to show the result.