From b3f0fc84fc7c860e9b9fab2afcf7578c95627443 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 9 Nov 2018 10:01:09 +0100 Subject: [PATCH] Add example for exo1. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TP1/exo1/iris2.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 TP1/exo1/iris2.py diff --git a/TP1/exo1/iris2.py b/TP1/exo1/iris2.py new file mode 100755 index 0000000..dc46570 --- /dev/null +++ b/TP1/exo1/iris2.py @@ -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]) -- 2.34.1