Module # 5 assignment

Issaiah Jennings 

Module # 5 assignment


In this visualization, I explored two design frameworks: Part to Whole and Ranking, using the dataset containing Average Position and Time.

Part to Whole: Pie Chart

The pie chart shows how Time is distributed across different Average Position values. Each slice represents a proportion of Time for a given position, helping to visualize how much each position contributes to the total Time. This is a typical "Part to Whole" design, which makes it easy to see the relationship between the categories and their contributions.

Ranking: Scatter Plot

The scatter plot shows how Average Position affects Time. Each point on the graph represents a pair of Average Position and Time values. By looking at this, you can spot trends—like how Time increases as Average Position rises. This type of plot is great for understanding relationships and rankings between two variables.


import pandas as pd  # Import pandas for data manipulation

import plotly.express as px  # Import Plotly for visualization


# Data: Average Position and Time

data = {

    "Average Position": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],

    "Time": [0.1762677, 0.189679, 0.2196229, 0.2581761, 0.3255756, 0.3983259, 0.4699786, 0.5387844,

             0.6070757, 0.6739264, 0.7389249, 0.8032374, 0.8660064, 0.9114196, 0.9437645, 0.9714103,

             0.9888347, 0.9953517, 1.0011484, 1.0050586]

}


# Convert the data into a pandas DataFrame

df = pd.DataFrame(data)


# Part to Whole: Pie chart showing the distribution of Time across Average Position

fig1 = px.pie(df, names="Average Position", values="Time", title="Part to Whole: Time Distribution by Average Position")

fig1.show()  # Display the pie chart


# Ranking: Scatter plot showing the relationship between Average Position and Time

fig2 = px.scatter(df, x="Average Position", y="Time", title="Ranking: Time vs Average Position")

fig2.show()  # Display the scatter plot










Comments

Popular posts from this blog

Final project in this class Spring 2025

Assignment # 4: Time Series Visualization Using Tableau Public