dimanche 6 décembre 2015

How to find dimension of a tuple?

I have a tuple that looks like this

  array=(1,2,3,4)
  lenM = numpy.shape(array)
  print lenM
  (50,)

  if not lenM[1]:
       "Code"

Now how do I automate the my code to find if the tuple is one dimensional or two dimensional?

Aucun commentaire:

Enregistrer un commentaire