(Mar 1, 2014 03:06 PM)_UserName_ Wrote: Is there any way to programmatically determine if the array you are parsing is a regular array or a two dimensional array?
For example, how would you distinguish:
array1 = ["This", "Is", "A", "Sample", "Array", "."]
from
array2 = [["This", "Is"], ["A", "Sample"], ["Array", "."]]
A really really ghetto way of doing it could be:
Code
if str(array2).count("[") > 1 and str(array2).count("],") > 1:
print "Multi dimensional"
else:
print "One dimensional"