Skip to content

Junior - lab map, filter and reduce done#13

Open
linharesjunior wants to merge 4 commits intoIronhack-data-bcn-oct-2023:mainfrom
linharesjunior:main
Open

Junior - lab map, filter and reduce done#13
linharesjunior wants to merge 4 commits intoIronhack-data-bcn-oct-2023:mainfrom
linharesjunior:main

Conversation

@linharesjunior
Copy link
Copy Markdown

No description provided.

@bripollc
Copy link
Copy Markdown

Junior,

I leave you some corrections from the lab. But good job! 🤓 Congratulations!

  • Do this by removing from prophet elements 0 through 567 of the list (you can also do this by keeping elements 568 through the last element)
prophet2 = prophet[568:]
print(prophet2)

Your answer is OK but I leave you a much simpler solution. No need to apply map() function:)

  • Let's write a function to split those words. Our function will return the string split on the character \n. Write your function in the cell below.
def line_break(x):
    x_split = x.split("\n")
    x_split = [line for line in x_split if line.strip() != '']
    return x_split

This way you will eliminate the blank spaces! (although you are not asked to do so)

Don't worry about Challenge 4, we'll see about that in the next few days.

ps: thanks for not printing all the text in the answers, it makes the readability of the document much easier for me! But you can also limit your printing, so I can see what's going on in your code, jeje 🙃

image

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

Successfully merging this pull request may close these issues.

2 participants