I've stumbled upon this for loop. In the for loop, I can't understand i[:4] operation. The i variable will receive all the values from the 'cast' while the j variable will receive the corresponding index value. However, when I move down to the list2=i[:4], I can't get it. Does it mean to transfer the first four values in i? So i can contain ['A','B','C','D','E'], but it will only pass on the values from A to D to list2? Am I right?
for i,j in zip(movies['cast'],movies.index):
list2=[]
list2=i[:4]
movies.loc[j,'cast']=str(list2)