Exploring Daily Horoscopes with Pandas DataFrames
Exploring Daily Horoscopes with Pandas DataFrames Data Science Project
Intro to Pandas for Data Analysis

Exploring Daily Horoscopes with Pandas DataFrames

In this project, we will delve into the basics of DataFrames by analyzing a dataset containing daily horoscopes for various zodiac signs. Your objective will be to understand the shape and structure of the data, utilizing various DataFrame operations to perform statistical analysis and gain insights into various zodiac signs.
Start this project
Exploring Daily Horoscopes with Pandas DataFramesExploring Daily Horoscopes with Pandas DataFrames
Project Created by

Vidhi Shah

Project Activities

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.

input

Determine the shape of the DataFrame.

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(,))

codevalidated

Identify count of unique mood values.

Start off by extracting the count of all unique values from the mood column.

Store your result in moods variable.

codevalidated

What is the average lucky number across all entries?

Use the .mean() method to calculate the average lucky number.

Store you result in variable named avg_lucky_number.

multiplechoice

How can you select rows based on a condition in pandas?

multiplechoice

Which method is used to find the most frequent value in a column?

codevalidated

Which zodiac sign is most often listed as compatible?

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.

codevalidated

Which zodiac sign appears most frequently in the dataset?

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.

codevalidated

What is the range of lucky numbers in the DataFrame?

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 :

img9

codevalidated

Renaming Columns

Rename the lucky_number column to Lucky_Num.

codevalidated

Select the multiple columns to create a new DataFrame.

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 :

img10

codevalidated

Find Frequency of Each Color

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 :

img11

codevalidated

Which description talks about money?

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 :

img12

Exploring Daily Horoscopes with Pandas DataFramesExploring Daily Horoscopes with Pandas DataFrames
Project Created by

Vidhi Shah

This project is part of

Intro to Pandas for Data Analysis

Explore other projects