Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing a 2-D array to Excel

Is there a good way to write a 2-D array to a table in DataNitro? I'm working on a basic sudoku solver in Excel and would rather use python than VisualBasic.

like image 827
brettcvz Avatar asked Jun 20 '13 21:06

brettcvz


People also ask

How do I create a two-dimensional array in Excel VBA?

To run my example you will need to fill columns A and B in Sheet1 with some values. Then run test(). It will read first two rows and add the values to the BigArr. Then it will check how many rows of data you have and read them all, from the place it has stopped reading, i.e., 3rd row.

How do you make a 2D array?

To create an array use the new keyword, followed by a space, then the type, and then the number of rows in square brackets followed by the number of columns in square brackets, like this new int[numRows][numCols] . The number of elements in a 2D array is the number of rows times the number of columns.


1 Answers

Yes, you can use the table cell property - we just added this in our last update.

For example:

x = [[6, 7, '', 2, 3, '', '', '', ''], ... ['', '', '', '', 6, 8, '', 3, 2]] 
# the sudoku puzzle, written out row boy row
Cell("A1").table = x

Source: I'm one of the DataNitro developers.

like image 194
Ben Lerner Avatar answered Nov 14 '22 21:11

Ben Lerner