Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map-and-reduce.md: code in Pluck challenge throws TypeError #16

Open
wmotion opened this issue Jul 3, 2023 · 0 comments
Open

map-and-reduce.md: code in Pluck challenge throws TypeError #16

wmotion opened this issue Jul 3, 2023 · 0 comments

Comments

@wmotion
Copy link

wmotion commented Jul 3, 2023

In the exercise https://esciencecenter-digital-skills.github.io/parallel-python-workbench/instructor/map-and-reduce.html#challenge-consider-pluck

the verbatim code

from dask import bag as db
  
data = [
     { "name": "John", "age": 42 },
     { "name": "Mary", "age": 35 },
     { "name": "Paul", "age": 78 },
     { "name": "Julia", "age": 10 }
  ]

bag = db.from_sequence(data)

bag.map(partial(getitem,"name")).compute()

throws

  TypeError: string indices must be integers    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant