Skip to content

Commit a44f6fe

Browse files
added further solutions
1 parent bab4cd7 commit a44f6fe

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

part-08/solution/lecture_numpy1.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# TODO: Create an array with 10 evenly spaced numbers over the interval from 0 to 73.
2+
3+
import numpy as np
4+
# YOUR CODE HERE
5+
6+
print(np.linspace(0, 73, 10))

part-08/solution/lecture_numpy2.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# TODO: Take the following 3x3 array and reduce it to a 1D array.
2+
3+
import numpy as np
4+
array = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
5+
# YOUR CODE HERE
6+
print(array.flatten())

part-08/solution/lecture_pandas_filter.py

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

88
df = pd.read_csv("part-08/data/employees.csv")
99

10-
df = df[df["Position"] != "Manager"]
10+
#df = df[df["Position"] == "Manager"]
1111

1212
print("Filtered DataFrame:")
1313
print(df.head())
@@ -17,5 +17,5 @@
1717

1818
df = df[df["Salary"] == df["Salary"].min()]
1919

20-
print("Highest paid employee:")
20+
print("Minimal paid employee:")
2121
print(df["Name"])

0 commit comments

Comments
 (0)