> 
> **Possible Duplicate:**  
> 
> [Remove leading and trailing zeros from multidimensional list in Python](https://stackoverflow.com/questions/13633901/remove-leading-and-trailing-zeros-from-multidimensional-list-in-python) 
> 
> 
> 

if I have a list such as:

```
my_list = [[1,2,0,1], [1,0,0,1]]

```

I want to split this at the zeros and throw them away, so that I end up with something like:

```
my_list = [[[1, 2], [1]], [[1],[1]]]

```

Any help much appreciated.