Project Overview
Welcome to the Python Galactic Exploration Challenge: Chart the Stars! In this interactive exercise, you will embark on a journey as a data scientist for the Galactic Exploration Agency (GEA). Your mission is to analyze and visualize astronomical data, manage resources for interstellar missions, and uncover hidden patterns in the cosmos. Leveraging Python’s powerful data analysis libraries alongside interactive tools like CodeMirror and Pyodide, you’ll gain hands-on experience in solving real-world astronomical challenges.
Through a series of engaging tasks, you’ll enhance your Python programming skills, deepen your understanding of data analysis, and contribute to humanity’s quest to explore the galaxy.
Objective
By the end of this exercise, you will:
- Develop Proficiency in Python: Strengthen your Python programming skills, focusing on data manipulation and visualization.
- Master Interactive Coding Environments: Utilize CodeMirror for an enhanced coding experience and Pyodide to execute Python code directly in the browser.
- Analyze Astronomical Data: Perform data analysis on real-world astronomical datasets to extract meaningful insights.
- Visualize Data Effectively: Create compelling visualizations to represent complex data patterns and trends.
- Solve Real-World Problems: Apply your skills to manage interstellar mission resources and uncover cosmic phenomena.
Tasks
Embark on the following tasks to chart the stars and manage interstellar missions. Each task is designed to guide you through critical data analysis and visualization scenarios using Python. After completing each task, you can check your answers using the provided sample solutions.
Task 1: List All Stars in the Dataset
Objective: Retrieve a list of all stars in the dataset with their details.
Instructions:
- Use Python to load the
starsdataset. - Display all star IDs, names, constellations, magnitudes, distances, and spectral types.
Task 2: Identify the Brightest Stars
Objective: Determine the top 5 brightest stars based on their apparent magnitude.
Instructions:
- Sort the stars by their
magnitudein ascending order (lower magnitude means brighter). - List the top 5 brightest stars with their details.
Task 3: Analyze Exoplanet Discoveries Over Time
Objective: Visualize the number of exoplanet discoveries each year.
Instructions:
- Load the
exoplanetsdataset. - Group the data by
discovery_yearand count the number of exoplanets discovered each year. - Create a bar chart to represent the number of discoveries per year.
Task 4: Map Missions to Their Target Stars
Objective: Create a visualization showing which missions are targeting which stars.
Instructions:
- Merge the
missionsandstarsdatasets on the star IDs. - Plot a scatter plot where each point represents a mission, positioned based on the star’s
distance_ly. - Differentiate missions by their
statususing colors or markers.
Task 5: Calculate Average Exoplanet Mass by Star Type
Objective: Determine the average mass of exoplanets orbiting different spectral types of stars.
Instructions:
- Merge the
exoplanetsandstarsdatasets on the host star IDs. - Group the data by
spectral_typeand calculate the averagemass_jupiterfor exoplanets in each group. - Display the results in a table.
Task 6: Forecast Future Exoplanet Discoveries
Objective: Predict the number of exoplanet discoveries in the next five years based on historical data.
Instructions:
- Analyze the trend in
discovery_yearfrom theexoplanetsdataset. - Use a simple linear regression model to forecast discoveries for the next five years.
- Plot the historical data and the forecasted values.
Task 7: Visualize Star Distribution in Constellations
Objective: Create a visual representation of how stars are distributed across different constellations.
Instructions:
- Load the
starsdataset. - Count the number of stars in each
constellation. - Generate a pie chart or bar graph to show the distribution.
Task 8: Optimize Resource Allocation for Missions
Objective: Allocate available resources to active missions based on their distance and importance.
Instructions:
- Consider the
resourcesdataset for available resources like Energy, Ammo, Fuel, Medicine, and Food. - Develop a strategy to allocate resources to missions prioritizing active ones targeting closer stars.
- Display the allocation plan in a structured format.
