[LABS] Ricardo map, filter, reduce#14
[LABS] Ricardo map, filter, reduce#14Ricardo-Beato wants to merge 1 commit intoIronhack-data-bcn-oct-2023:mainfrom
Conversation
|
Ricardo, Sometimes the code can be a bit frustrating, but good job:) It's a matter of trial and error! 💥Challenge 1 - Mapping prophet = prophet[568:]def reference(x):
x = x.split("{")
return x[0]prophet_reference = list(map(reference, prophet))
print(prophet_reference[0:10])Everything is well declared and you almost had it! You just needed to use the
Further on in the exercise, the same thing happens when you try to apply 💥Challenge 2 - Filtering def word_filter(x):
word_list = ['and', 'the', 'a', 'an']
if x in word_list:
return False
else:
return TrueHere you did use
def word_filter_case(x):
word_list = ['and', 'the', 'a', 'an']
if x.lower() in word_list:
return False
else:
return True💥Challenge 3 - Reduce Perfect! Only you don't need to import the Don't worry about Challenge 4, we'll see about that in the next few days. ps: if when printing your answers you limit the range it will be more readable the notebook, jeje 🙃 |

Please see the comments on my solutions, I really struggled with some and even though I think I got the desired result, not sure this is the way and I don't fully understand why my initial approaches did not work. Thanksssss!