I am pulling my hair out over here. I am running the following query and getting errors using tweepy:
for user in response.includes.users:
print(user.profile_image_url)
I am getting:
AttributeError: ‘dict’ object has no attribute ‘users’
I am looking right at it but i can’t get the data:
Please assist if possible! TIA
In python, the response object is usually a dict, so you probably want response["includes"]["users"]
Hey Igor thanks!
It was response.includes[‘users’] .
Is there a name for that? A reason why I would use the bracket notation and not dot? I would like to read further about how to recognize when I need to use that. I have more experience with JS.
Kind Regards
Bradley
Yep, in python this is a “dictionary” - like a Map in JS maybe? A key value store either way: Dictionaries in Python – Real Python this might help