My data frame looks something like this with URLs instead of letters:
.csv code:
query,ranks
a,"[k, g, y, l, a]"
h,"[f, g, l, h, p]"
x,"[b, x, y, a, g]"
w,"[w, I, b, d, g]"
r,"[I, r, n, f, g]"
I want the outcome to be like this:
.csv code:
query,ranks,rank
a,"[k, g, y, l, a]",5
h,"[f, g, l, h, p]",4
x,"[b, x, y, a, g]",2
w,"[w, I, b, d, g]",1
r,"[I, r, n, f, g]",2
As you can see, each letter (URL) has been ranked according to its position.
Edit: Sometimes the 'ranks' value (dtype: list, of strings) doesn't have the 'query' value.

