I have the following data frame:
pa=pd.DataFrame({\'a\':np.array([[1.,4.],[2.],[3.,4.,5.]])})
I want to select the column \'a\' and then on
pa.loc[row] selects the row with label row.
pa.loc[row, col] selects the cells which are the instersection of row and col
pa.loc[:, col] selects all rows and the column named col. Note that although this works it is not the idiomatic way to refer to a column of a dataframe. For that you should use pa['a']
Now you have lists in the cells of your column so you can use the vectorized string methods to access the elements of those lists like so.
pa['a'].str[0] #first value in lists
pa['a'].str[-1] #last value in lists