Skip to content

Commit a102da4

Browse files
authored
Merge branch 'master' into kylestratis-patch-2
2 parents 485413e + 12f8baa commit a102da4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3682
-1208
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,6 @@ ENV/
108108

109109
# Mac
110110
*.DS_Store
111+
112+
# VS Code workspace
113+
*.code-workspace

flask-connexion-rest/version_4/people.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def create(person):
9090
else:
9191
abort(
9292
406,
93-
"Peron with last name {lname} already exists".format(lname=lname),
93+
"Person with last name {lname} already exists".format(lname=lname),
9494
)
9595

9696

pandas-gradebook-project/01-loading-the-data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
hw_exam_grades = pd.read_csv(
2929
DATA_FOLDER / "hw_exam_grades.csv",
30-
converters={"SID": str.lower, "Email Address": str.lower},
30+
converters={"SID": str.lower},
3131
usecols=lambda x: "Submission" not in x,
3232
index_col="SID",
3333
)

pandas-gradebook-project/02-merging-dataframes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
hw_exam_grades = pd.read_csv(
2929
DATA_FOLDER / "hw_exam_grades.csv",
30-
converters={"SID": str.lower, "Email Address": str.lower},
30+
converters={"SID": str.lower},
3131
usecols=lambda x: "Submission" not in x,
3232
index_col="SID",
3333
)

pandas-gradebook-project/03-calculating-grades.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
hw_exam_grades = pd.read_csv(
3030
DATA_FOLDER / "hw_exam_grades.csv",
31-
converters={"SID": str.lower, "Email Address": str.lower},
31+
converters={"SID": str.lower},
3232
usecols=lambda x: "Submission" not in x,
3333
index_col="SID",
3434
)
@@ -88,7 +88,7 @@
8888

8989
sum_of_quiz_scores = quiz_scores.sum(axis=1)
9090
sum_of_quiz_max = quiz_max_points.sum()
91-
final_data["Total Quizzes"] = sum_of_hw_scores / sum_of_hw_max
91+
final_data["Total Quizzes"] = sum_of_quiz_scores / sum_of_quiz_max
9292

9393
average_quiz_scores = (quiz_scores / quiz_max_points).sum(axis=1)
9494
final_data["Average Quizzes"] = average_quiz_scores / quiz_scores.shape[1]

pandas-gradebook-project/04-grouping-the-data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
hw_exam_grades = pd.read_csv(
3030
DATA_FOLDER / "hw_exam_grades.csv",
31-
converters={"SID": str.lower, "Email Address": str.lower},
31+
converters={"SID": str.lower},
3232
usecols=lambda x: "Submission" not in x,
3333
index_col="SID",
3434
)
@@ -88,7 +88,7 @@
8888

8989
sum_of_quiz_scores = quiz_scores.sum(axis=1)
9090
sum_of_quiz_max = quiz_max_points.sum()
91-
final_data["Total Quizzes"] = sum_of_hw_scores / sum_of_hw_max
91+
final_data["Total Quizzes"] = sum_of_quiz_scores / sum_of_quiz_max
9292

9393
average_quiz_scores = (quiz_scores / quiz_max_points).sum(axis=1)
9494
final_data["Average Quizzes"] = average_quiz_scores / quiz_scores.shape[1]

pandas-gradebook-project/05-plotting-summary-statistics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
hw_exam_grades = pd.read_csv(
3232
DATA_FOLDER / "hw_exam_grades.csv",
33-
converters={"SID": str.lower, "Email Address": str.lower},
33+
converters={"SID": str.lower},
3434
usecols=lambda x: "Submission" not in x,
3535
index_col="SID",
3636
)
@@ -90,7 +90,7 @@
9090

9191
sum_of_quiz_scores = quiz_scores.sum(axis=1)
9292
sum_of_quiz_max = quiz_max_points.sum()
93-
final_data["Total Quizzes"] = sum_of_hw_scores / sum_of_hw_max
93+
final_data["Total Quizzes"] = sum_of_quiz_scores / sum_of_quiz_max
9494

9595
average_quiz_scores = (quiz_scores / quiz_max_points).sum(axis=1)
9696
final_data["Average Quizzes"] = average_quiz_scores / quiz_scores.shape[1]

pandas-gradebook-project/06-final-gradebook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
hw_exam_grades = pd.read_csv(
2828
DATA_FOLDER / "hw_exam_grades.csv",
29-
converters={"SID": str.lower, "Email Address": str.lower},
29+
converters={"SID": str.lower},
3030
usecols=lambda x: "Submission" not in x,
3131
index_col="SID",
3232
)
@@ -78,7 +78,7 @@
7878

7979
sum_of_quiz_scores = quiz_scores.sum(axis=1)
8080
sum_of_quiz_max = quiz_max_points.sum()
81-
final_data["Total Quizzes"] = sum_of_hw_scores / sum_of_hw_max
81+
final_data["Total Quizzes"] = sum_of_quiz_scores / sum_of_quiz_max
8282

8383
average_quiz_scores = (quiz_scores / quiz_max_points).sum(axis=1)
8484
final_data["Average Quizzes"] = average_quiz_scores / quiz_scores.shape[1]

practical-k-means/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Practical K-Means Clustering in Python
2+
3+
The Jupyter notebooks in this directory follow the code examples in Real Python's [Practical K-Means Clustering in Python](https://realpython.com/k-means-clustering-python/) article. The article is structured such that there are two main sections with code. The first section works with synthetic data. The second section starts when the TCGA cancer gene expression dataset is introduced.
4+
5+
## Getting Started
6+
7+
Follow the instructions below to get up and running with a Jupyter notebook and all the code from the article.
8+
9+
### Install Dependencies
10+
11+
These notebooks have dependencies. One way to install these dependencies is to use the Anaconda Python distribution.
12+
13+
```bash
14+
(base) $ conda install jupyter matplotlib numpy pandas seaborn scikit-learn
15+
(base) $ conda install -c conda-forge kneed
16+
```
17+
18+
You can also install all the requirements using `pip` and the `requirements.txt` file included in this directory.
19+
20+
```bash
21+
$ python3 -m pip install -r requirements.txt
22+
```
23+
24+
### Synthetic Data Notebook
25+
26+
Open the notebook that accompanies the sections of the article that work with synthetic data:
27+
28+
```bash
29+
(base) $ jupyter notebook practical-kmeans-synthetic.ipynb
30+
```
31+
32+
### Cancer Gene Expression Data Notebook
33+
34+
Open the notebook that accompanies the sections of the article that work with TCGA cancer gene expression data:
35+
36+
```bash
37+
(base) $ jupyter notebook practical-kmeans-cancer-gene-expression.ipynb
38+
```

0 commit comments

Comments
 (0)