How can I convert a python list like:
[0, 1/4, 2/4, 3/4 , 4/4]
into the following:
[r'$25^{th}$', r'$50^{th}$', r'$75^{th}$', r'$100^{th}$']
Here each element of the 2nd list corresponds to a percentile value E.g. in the first list the element 0 corresponds to values below the 25th percentile. I want the solution to be easily extendible to different lengths e.g. current list has 5 elements, but we could have 2 elements or 10. Is there a pythonic way to do this?