import streamlit as st import pandas as pd import numpy as np import altair as alt st.title('Homework 6 Post!') st.text('This is my HW 6 upload, two charts.') df = pd.read_csv('https://raw.githubusercontent.com/UIUC-iSchool-DataViz/is445_data/main/licenses_fall2022.csv') df['LastModifiedDate'] = pd.to_datetime(df['LastModifiedDate']) df_status = df.groupby('License Status').size().reset_index(name = 'count') status_bars = alt.Chart(df_status).mark_bar().encode( x = alt.X('License Status:N', axis=alt.Axis(labelLimit=0)), y = alt.Y('count:Q'), color = alt.value('purple') ) df_date = df.groupby('LastModifiedDate').size().reset_index(name = 'count') date_bars = alt.Chart(df_date).mark_bar().encode( x = alt.X('LastModifiedDate:T'), y = alt.Y('count:Q'), color = alt.value('green') ) chart = alt.hconcat(status_bars, date_bars, title='HW6 Charts') st.altair_chart(chart, use_container_width=True) para1 = """I decided to do some charts based on the driver's license dataset that was available in PrairieLearn. Both charts are count bar charts. The first one lists the different amonuts of license status. The second chart contains count data for the "Last modified date" which is the last time any sort of changes happened to the status of the license. I found it interesting that the vast majority of licenses were not active ones, which seemed a little weird to me given how important, culturally, driving is in the US. Also, chart 2 shows some sort of trend where the majority of modifications happen mid year every 3 years. I thought this had something to do with renewals, but Google says licensense usually last between 4-8 years.""" st.text(para1) st.text('I believe the charts are very self-explanatory. If anything, I should probably add something to further indicate what is meant by "LastModifiedDate". The colors I chose were random somewhat. I just chose colors that would work both in light and dark mode. Bar charts were chosen due to how well they represent count and how well someone can compare count with a bar chart.') st.text("I think that if I had more time, I would categorize the charts further, probably by state. This would probably come with some interactivity, like a widgets dropdown chart or a Geomap as a selector. I think that I would also try to show another interesting fact with my viz's. What I mean by this is that, currently, the viz's only highlight one fact about the dataset each. If I were to have more time, I would've probably tried to use color to show another dimension of the data.")