Initialer Import der Synology Scripts
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
from MyModule import list_max
|
||||
from MyModule import list_min
|
||||
|
||||
|
||||
list1 = [-2, 1, 2, -10, 22, -10]
|
||||
list_max(list1)
|
||||
list_min(list1)
|
||||
list2 = [-20, 123, 112, -10, 22, -120]
|
||||
list_max(list2)
|
||||
list_min(list2)
|
||||
@@ -0,0 +1,15 @@
|
||||
from MyModule import list_max
|
||||
from MyModule import list_min
|
||||
|
||||
|
||||
def main():
|
||||
list1 = [-2, 1, 2, -10, 22, -10]
|
||||
list_max(list1)
|
||||
list_min(list1)
|
||||
list2 = [-20, 123, 112, -10, 22, -120]
|
||||
list_max(list2)
|
||||
list_min(list2)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,23 @@
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
grades_jan = [56, 64, 78, 100]
|
||||
grades_ben = [86, 94, 98, 90]
|
||||
|
||||
|
||||
plt.plot(range(len(grades_jan)), grades_jan, color="blue")
|
||||
plt.plot(range(len(grades_ben)), grades_ben, color="red")
|
||||
plt.xlabel("Courses")
|
||||
plt.ylabel("Grade (in %)")
|
||||
plt.legend(["Jan", "Ben"])
|
||||
plt.title("Jan vs. Ben")
|
||||
plt.show()
|
||||
|
||||
|
||||
plt.scatter(range(len(grades_jan)), grades_jan, c="blue")
|
||||
plt.scatter(range(len(grades_ben)), grades_ben, c="red")
|
||||
plt.xlabel("Courses")
|
||||
plt.ylabel("Grade (in %)")
|
||||
plt.legend(["Jan", "Ben"])
|
||||
plt.title("Jan vs. Ben")
|
||||
plt.show()
|
||||
@@ -0,0 +1,22 @@
|
||||
def list_max(input_list):
|
||||
max_value = input_list[0]
|
||||
|
||||
for i in range(1, len(input_list)):
|
||||
if input_list[i] > max_value:
|
||||
max_value = input_list[i]
|
||||
|
||||
print(max_value)
|
||||
|
||||
|
||||
def list_min(input_list):
|
||||
max_value = input_list[0]
|
||||
|
||||
for i in range(1, len(input_list)):
|
||||
if input_list[i] < max_value:
|
||||
max_value = input_list[i]
|
||||
|
||||
print(max_value)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Hello from MyModule")
|
||||
@@ -0,0 +1,16 @@
|
||||
import numpy as np
|
||||
|
||||
|
||||
vec = np.array([1, 2, 3, 4, 5])
|
||||
print(np.max(vec))
|
||||
print(np.min(vec))
|
||||
print(np.median(vec))
|
||||
print(np.mean(vec))
|
||||
print(vec.shape)
|
||||
|
||||
matrix = np.array([[1, 2], [3, 4]])
|
||||
print(np.max(matrix))
|
||||
print(np.min(matrix))
|
||||
print(np.median(matrix))
|
||||
print(np.mean(matrix))
|
||||
print(matrix.shape)
|
||||
Reference in New Issue
Block a user