Get the shape of nested list
(a)
| 5469 | |
| 5470 | |
| 5471 | def shapelist(a): |
| 5472 | """Get the shape of nested list""" |
| 5473 | if type(a) is list: |
| 5474 | return tuple([len(a)] + list(shapelist(a[0]))) |
| 5475 | else: |
| 5476 | return () |
| 5477 | |
| 5478 | |
| 5479 | def transposelist(arrays, axes, extradims=0): |