There is one method that no one mentioned, which could be noted. This was a problem that I ran into when I performed several criteria checks and returned one element of the series (basically a unique string result). If you have one item in the series and you need this item or know the index of the specific item you want to collect, simply do the following:
d[d["name"] == "World"].tolist()[0]
for the first (and only) element in one series of articles.
Or that:
d[d["name"] == "World"].tolist()[index]
where index is the index of the element you are looking for in the series.
If you want it to be like a string, you may need to execute the string as a string if it is still not gated.
source share