All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.
All our activities include solutions with explanations on how they work and why we chose them.
Read the words from linux's dictionary into the variable df
with a single column word
. The list of words doesn't have a header, so you'll need to pass special parameters to handle this.
And WARNING! Your df
should NOT contain null
values afterwards. There's a special trick that you'll need to apply.
Your task in this activity is to find ONLY the words in which the first m
is before the first b
. And of course, start with an s
.
Store the result in the variable smb_df
.
Write the function find_words_with_chars
that can generically find words with the combinations of characters passed following our previous rules. Make sure your function is NOT modifying the original dataframe passed:
def find_words_with_chars(df, chars):
aux_df = df.copy()
# Your code here