0
I have a class with an element that is a list I’m trying to display in a pandas dataframe this list in a single line to represent the character’s inventory.
assignment of items in the list:
if self.wealth == "rich":
self.inventory = ["dagger","nobles's clothing", "cloak","backpack","rations for a week","waterskin",
"potion of healing","pouch for coins","personal servant","personal guard", " three saddled horses"]
I am making the dataframe this way but end up cutting the list for being too big, I would like to do it in a way that does not cut this line.
inventory = pd.DataFrame({"Inventory": [self.inventory]," ": " "})
inventory.set_index(" ", inplace=True)
display(inventory)
I ended up solving otherwise but did not know about this use of Join() obg by info.
– pydoni
Glad you got @pydoni, hug and see you next time!
– Éder Garcia