Skip to content

Amir G - Finally finished ;) // 'Better late than sorry'#25

Open
amirg33 wants to merge 1 commit intoIronhack-data-bcn-oct-2023:mainfrom
Ironhack-Labs-Okt-2023:main
Open

Amir G - Finally finished ;) // 'Better late than sorry'#25
amirg33 wants to merge 1 commit intoIronhack-data-bcn-oct-2023:mainfrom
Ironhack-Labs-Okt-2023:main

Conversation

@amirg33
Copy link
Copy Markdown

@amirg33 amirg33 commented Oct 18, 2023

No description provided.

@bripollc
Copy link
Copy Markdown

Amir,

Te dejo algunas correcciones del lab. Pero buen trabajo! 🤓 Felicitats!

  • The next step is to create a function that will remove references. We will do this by splitting the string on the { character.
def reference(x):
    x = x.split("{")
    return x[0]

Te dejo un opción muuuuuucho más sencilla:) Aunque la tuya está bien.

  • 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

De esta manera eliminarás los espacios en blanco:) (aunque no te lo pide)

  • Bonus - Rewrite the word_filter function above to not be case sensitive.
 def word_filter_case(x):

    word_list = ['and', 'the', 'a', 'an']
        
    if x.lower() in word_list:
        return False
    else:
        return True
  • Challenge 3 - Reducing
 def concat_space(a, b):
    return a + " " +b
prophet_string = reduce(concat_space, prophet_filter)
print(prophet_string)

Por el Challenge 4 no te preocupes, son cosas que veremos estos días.

Ps: gracias por limitar tus prints 🙏🏼🥲 , hace que el notebook sea mucho más legible

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