Skip to content

Commit 20f03a0

Browse files
authored
Update README.md
1 parent 8424a1d commit 20f03a0

File tree

1 file changed

+61
-8
lines changed

1 file changed

+61
-8
lines changed

README.md

+61-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,61 @@
1-
# Exploration of the Cost of living and Grad. Student wages
2-
## > COL = Cost of Living
3-
## > Wages = Self reported PhD Salary
4-
5-
# Data collected from PhD students across several universities in the US.
6-
## Data from: https://www.phdstipends.com/
7-
### Collected by Kendall Branham & Connor S. Murray
8-
### 11/8/2022
1+
# Exploration of the Cost of Living and Graduate Student Wages
2+
3+
This repository contains an analysis of the cost of living (COL) and self-reported PhD student salaries across various universities in the United States.
4+
5+
## Data Overview
6+
7+
- **Source:** [PhD Stipends](https://www.phdstipends.com/)
8+
- **Collected by:** Kendall Branham & Connor S. Murray
9+
- **Date:** November 8, 2022
10+
11+
## Project Description
12+
13+
The goal of this project is to explore the relationship between the cost of living and the wages of PhD students. By analyzing self-reported salary data from PhD students across different universities, we aim to provide insights into the financial challenges faced by graduate students.
14+
15+
## Data Collection
16+
17+
The data used in this project was sourced from [PhD Stipends](https://www.phdstipends.com/), a platform where PhD students can anonymously report their stipends. The dataset includes information on stipends, cost of living, and other relevant details from various institutions across the US.
18+
19+
## How to Use
20+
21+
1. **Open an anaconda environment:**
22+
```sh
23+
module load anaconda/2020.11-py3.8
24+
python3
25+
```
26+
27+
2. **Run the code to download data:**
28+
```python
29+
30+
# Modules
31+
import requests
32+
import json
33+
import os
34+
import pandas as pd
35+
36+
# Working directory
37+
os.chdir("/project/berglandlab/connor/")
38+
39+
# Empty object
40+
full_stipends = []
41+
reqlimit = 1000
42+
43+
# Go through each page
44+
for i in range(0, reqlimit):
45+
data = requests.get(f'https://www.phdstipends.com/data/{i}').json()['data']
46+
for entry in data:
47+
full_stipends.append(entry)
48+
49+
# Gather data from phdstipends pages until the pages no longer return data
50+
if len(data) < 1:
51+
break
52+
53+
# Write to CSV file
54+
pd.DataFrame(full_stipends).to_csv("stipends.csv")
55+
```
56+
57+
## Contributing
58+
59+
Contributions are welcome! If you have any suggestions or improvements, feel free to open an issue or submit a pull request.
60+
61+
If you have any questions or need further assistance, please don't hesitate to contact us!

0 commit comments

Comments
 (0)