Add example for exo1.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 9 Nov 2018 09:01:09 +0000 (10:01 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 9 Nov 2018 09:01:09 +0000 (10:01 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
TP1/exo1/iris2.py [new file with mode: 0755]

diff --git a/TP1/exo1/iris2.py b/TP1/exo1/iris2.py
new file mode 100755 (executable)
index 0000000..dc46570
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+from sklearn.datasets import load_iris  # les données iris sont chargées
+irisData = load_iris()
+
+print(len(irisData.data))
+# help(len)
+print(irisData.target_names[0])
+print(irisData.target_names[2])
+print(irisData.target_names[-1])
+print(irisData.target_names[len(irisData.target_names) - 1])
+print(irisData.data.shape)
+print(irisData.data[0])
+print(irisData.data[0][1])
+print(irisData.data[:, 1])