0

I have some values in a column that looks like this:

{"template":{"module":[{"id":"module-12","header":[{"id":"title","value":"Cycle in Comfort","decorators":[]}],"paragraph":[{"id":"description","value":["This folding exercise bike features a heavily-padded seat and backrest for your comfort."]

Is there any way I can extract information from it and paste it in other columns? Information that need to be extracted:

module-12
Cycle in Comfort
This folding exercise bike features a heavily-padded seat and backrest for your comfort

Any advice on extracting the needed information?

1 Answer 1

1

assuming your dictionary object name mydict :

item = mydict["template"]['module'][0]
module_12 = item['id']
header = item['header'][0]
cycle = header['value']
paragraph = item['paragraph'][0]
text = paragraph['value']

print(module_12)
>>> module-12
print(module_12)
>>> Cycle in Comfort
print(module_12)
>>> This folding exercise bike features a heavily-padded seat and backrest for your comfort
Sign up to request clarification or add additional context in comments.

3 Comments

thank you! considering that I may have a maximum of 5 module number with different information, in there a way to extract all those modules and information and to paste this info to other columns once is extracted?
some information may repeat and I need to extract it and paste in other columns
I think you should open new question... iam still not quite sure what do you mean

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.