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.
What is the shape of our DataFrame df
?
Note : Enter the number of rows and columns separated by comma(,). For example,
2466, 18
(there is a space after comma(,))
Start off by extracting the count of all unique values from the mood
column.
Store your result in moods
variable.
Use the .mean()
method to calculate the average lucky number.
Store you result in variable named avg_lucky_number
.
Find the most compatible zodiac sign from the compatibility
column using mode()
.
Since mode()
returns a Series, access the first element (the most frequent value).
Store the result in variable named most_frequent_compatible
.
Find out which zodiac sign
appears the most in the DataFrame df
.
Since mode()
returns a Series, access the first element (the most frequent value).
Store your result in most_frequent_sign
variable.
Find the range (i.e min
and max
value) of lucky numbers in the DataFrame df
.
Store your result in variable named lucky_number_range
.
Your result should match the following output :
Rename the lucky_number
column to Lucky_Num
.
Select the columns sign
and mood
and create a new DataFrame.
Name the new DataFrame as df_sign_mood
.
Your result would look something like this :
Find the frequency of each color mentioned in the color
column.
Store your result in the variable named color_counts
.
Your result should match the following output :
Using the str.contains
method create a new column called contains_money
that indicates (True/False)
whether each description
contains the word money
.
To ensure the search is case-insensitive (i.e., it matches "Money", "MONEY", or "money"), set the parameter case=False
.
Your result would look something like this :