Welcome to National-University-Ranking-App Discussions! #12
Replies: 2 comments 7 replies
-
@TelRich Here's the code for my data cleaning task; |
Beta Was this translation helpful? Give feedback.
-
States with the highest number of schoolsstates_nur = nur_data['state_full'].value_counts(ascending=True) ax = states_nur.plot(kind='barh', figsize=(20, 15)) Five states (California, Newyork, Massachusetts, Pennsylvania and Illinois) account for 35% of the total schools on the list.five_or_more = (states_nur > 3).sum()/len(states_nur) ax = value_freq.plot(kind='bar') 68% of the states have less than 4 schools on the top 230 listSchools in the top 50 and where they are locatednur_top50 = nur_data.head(50) ax = nur_top50.plot(kind='barh') Schools in California, Massachusetts and New York account for close to half of the top 50 schools in the USChecking to see if there is any relationship between the rank column and other numerical columns.nur_data.corr() The result shows the following:1. A strong negative relationship between the rank and tuition fees columns2. A moderate negative relationship between in-state and tuition fees3. A moderate negative relationship between undergraduate enrollment and tuition fees4. A moderate positive relationship between undergraduate enrollment and in-stateVisualizing the rank and tuition fees columns correlationimport matplotlib.pyplot as plt Visualizing the rank and tuition fees columns correlationplt.scatter(nur_data['in_state'], nur_data['tuition_and_fees']) Visualizing the undergraduate enrollment and tuition fees columns correlationplt.scatter(nur_data['undergrad_enrollment'], nur_data['tuition_and_fees']) plt.scatter(nur_data['undergrad_enrollment'], nur_data['in_state']) States with the most expensive schoolsmean_nur = nur_data.pivot_table(values='tuition_and_fees', index='state_full').sort_values(by='tuition_and_fees', ascending=True) ax = mean_nur.plot(kind='barh', figsize=(20, 15)) The top five states with the most expensive schools are District of Columbia, New Hampshire, Connecticut, Massachusetts and Vermont.The five least expensive schools are in South Dakota, Wyoming, Utah, North Dakota and Mississippi |
Beta Was this translation helpful? Give feedback.
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
Beta Was this translation helpful? Give feedback.
All reactions