Hi,

I am new to python and would like to know how I can efficiently calculate the velocity from a list within a list.

I have a variable x_pos that contains the positions of 6 different people sampled at 10000 points in time. The timestep between all samples is constant = 0.1s. Running the following code thus returns the answer 6:

```
print(len(x_pos))
```

However if I take the positions of only the first person and check the length of that list:

```
x_pos1 = x_pos[0]
print(len(x_pos1))
```

The answer is 10000. This thus returns the length of the list within my original list.

I would like to know how I can calculate the instantaneous velocity of all persons efficiently, where the result is again a list within a list. As a final result I would thus like to have a main list of length 6, where each of the 6 lists inside the main list are of length 9999.

Thanks for your help!