I have a list and want to split it based on unique values of its last column in python. This is my list:
pnt=[[1.,2.,4.,'AA'], [0.,0.,0.,'AA'], [2.,1.,0.,'AA'],\
[0.,-3.,1.,'BB'], [2.,5.,8.,'BB'], [.1,3.,0.,'CC']]
I want to get it as:
pnt=[[[1.,2.,4.,'AA'], [0.,0.,0.,'AA'], [2.,1.,0.,'AA']],\
[[0.,-3.,1.,'BB'], [2.,5.,8.,'BB']], [[.1,3.,0.,'CC']]]
I read this solution but still cannot solve my issue.