2. Architecture visualisation

2.1. Module requierement

[1]:
from openalea.mtg.algo import orders
import pandas as pd
from oawidgets.mtg import plot
from oawidgets.plantgl import PlantGL
import openalea.plantgl.all as pgl
[2]:
import openalea.strawberry #import openalea.strawberry module

from openalea.strawberry import geometry # impoort Rules_production functions from openalea.strawberry module
from openalea.strawberry import visu3d, visu2d # import Visualisation and Visualisation2d functions from openalea.strawberry module
from openalea.strawberry import analysis # import analysis and variables functions from openalea.strawberry module
from openalea.strawberry.import_mtgfile import import_mtgfile

2.2. Import and load mtg file

[3]:
Gariguette = import_mtgfile(filename= ["Gariguette"])
Capriss = import_mtgfile(filename= ["Capriss"])
Ciflorette = import_mtgfile(filename= ["Ciflorette"])
Cir107 = import_mtgfile(filename= ["Cir107"])
Darselect = import_mtgfile(filename= ["Darselect"])
Clery = import_mtgfile(filename= ["Clery"])
# plot(Gariguette)
g = import_mtgfile(filename= ["Breadding_value"])

2.3. Visualisations

[4]:
Gariguette.properties()['order'] = orders(Gariguette) # This fonction are important it allows to add order properties to mtg
Capriss.properties()['order'] = orders(Capriss) # This fonction are important it allows to add order properties to mtg
Clery.properties()['order'] = orders(Clery) # This fonction are important it allows to add order properties to mtg
Cir107.properties()['order'] = orders(Cir107) # This fonction are important it allows to add order properties to mtg
Ciflorette.properties()['order'] = orders(Ciflorette) # This fonction are important it allows to add order properties to mtg
Darselect.properties()['order'] = orders(Darselect) # This fonction are important it allows to add order properties to mtg
g.properties()['order'] = orders(g) # This fonction are important it allows to add order properties to mtg
Two complementary vizualisation are developt:
* Two 3D vizualisation * A 2D vizualisation

2.4. 3D Visualizations

3D vizualisation are compose of two possibles vizualisations: + With leaves (hide_leaves = False) + Without leaves (hide_leaves = True)

  • 3D vizualisation with leaves (hide_leaves = False) This vizualisation allows to vizualised all plants along times. The growth developement are represented by occurence of the module order (rank of axis) which are colored accoding to module order. It permit also to see if growth developement are homogenous within each date. Comparison of this vizualisation between varieties allows to see vegetative growth différence between varieties

[5]:
scene=visu3d.plot3d(Capriss,by=["Sample_date"],hide_leaves=False,display=False)
PlantGL(scene, group_by_color=False)
Display 117 curves
  • 3D vizualisation without leaves (hide_leaves= True) This vizualisation are the same previous vizualisation but without leaves. Hidden leaves hightlight Inflorescence shape (blue box). Shape of inflorescence reflect the intensity and complexity of the inflorescence for each plant. Like previously, this representation allow to see if architecture are homogenous between the plant within each date. It allows also to performed comparison between varieties

[6]:
scene= visu3d.plot3d(Darselect,by=["Sample_date"],hide_leaves=True,display=False)
PlantGL(scene, group_by_color= False)

Display 77 curves

2.5. 2D visualization

2.5.1. 2D-Visualization plant by plant

Commentaires:
- Amélioration possible donnée Génotype, date et Plante à la place de g.vertices et le numéros - Amélioré l’argument dist pour plus de clarté
[7]:
scene=visu2d.plot2d(Gariguette,Gariguette.vertices(scale=1)[20:21],dist=[3]*3,display=False)
PlantGL(scene,group_by_color=False)

2.5.2. Visualization of the most central individuals

To vizualise the most central individual you need to calculated the central individual for each date.
1. For this you must to extract MTG information of all properties for each genotype and date at plant scale using variables.extract_at_plant_scale function. 2. From this extraction you use analysis.median_individuals fonction, which permit to calculate the most central individual based on meadian for must robusted.

2.5.2.1. Extraction of data at plant scale using ariable.extract_at_plant_scale function

  • Example for Gariguette

[13]:
# Extraction of data at plant scale
Gariguette_data_extraction_at_plant_scale =  analysis.extract_at_plant_scale(Ciflorette)
Gariguette_data_extraction_at_plant_scale
[13]:
Genotype date modality plant nb_total_leaves nb_total_flowers nb_stolons nb_visible_leaves nb_missing_leaves nb_vegetative_bud nb_initiated_bud nb_floral_bud nb_inflorescence type_of_crown leaf_area order_max nb_ramifications vid
0 Ciflorette 2014/12/04 A 1 9 1 3 7 0 3 1 1 1 3 0.00 1 0 1
1 Ciflorette 2014/12/04 A 2 13 0 2 8 0 2 2 5 0 4 116.11 1 1 43
2 Ciflorette 2014/12/04 A 3 8 0 0 5 0 2 2 3 1 3 88.12 1 0 120
3 Ciflorette 2014/12/04 A 4 8 0 0 4 0 1 2 5 0 1 88.33 0 0 172
4 Ciflorette 2014/12/04 A 5 9 0 2 6 0 0 2 5 0 1 91.12 0 0 235
5 Ciflorette 2014/12/04 A 6 12 0 2 8 0 4 1 4 0 1 64.25 0 0 309
6 Ciflorette 2014/12/04 A 7 11 0 1 8 0 2 1 6 0 1 88.38 0 0 374
7 Ciflorette 2014/12/04 A 8 7 0 0 5 0 2 1 4 0 1 87.95 0 0 454
8 Ciflorette 2014/12/04 A 9 16 0 2 10 0 2 3 6 0 4 108.07 1 1 508
9 Ciflorette 2015/01/07 A 1 10 10 2 10 0 0 1 6 1 1 58.73 0 0 590
10 Ciflorette 2015/01/07 A 2 10 8 2 10 0 0 0 8 1 1 58.78 0 0 679
11 Ciflorette 2015/01/07 A 3 8 8 0 8 0 0 0 8 1 1 58.73 0 0 783
12 Ciflorette 2015/01/07 A 4 13 9 2 10 0 2 0 6 1 4 59.89 1 1 894
13 Ciflorette 2015/01/07 A 5 13 0 1 10 0 4 0 2 1 6 41.47 1 1 991
14 Ciflorette 2015/01/07 A 6 14 10 0 11 0 2 1 8 2 6 72.80 1 1 1053
15 Ciflorette 2015/01/07 A 7 10 11 3 10 0 0 0 7 1 1 57.68 0 0 1146
16 Ciflorette 2015/01/07 A 8 7 11 0 7 0 0 0 7 1 1 72.68 0 0 1255
17 Ciflorette 2015/01/07 A 9 9 11 3 9 0 0 0 6 1 1 63.15 0 0 1345
18 Ciflorette 2015/02/13 A 1 33 38 1 25 0 13 1 7 5 17 79.97 2 4 1422
19 Ciflorette 2015/02/13 A 2 17 19 1 15 0 6 0 8 3 6 75.16 1 1 1578
20 Ciflorette 2015/02/13 A 3 13 26 0 13 0 1 0 10 3 6 102.53 1 1 1691
21 Ciflorette 2015/02/13 A 4 33 37 1 24 0 15 0 8 5 16 60.88 2 3 1796
22 Ciflorette 2015/02/13 A 5 22 45 2 19 0 5 3 7 5 11 80.35 2 2 1955
23 Ciflorette 2015/02/13 A 6 13 15 1 13 0 3 0 6 4 8 70.23 2 1 2089
24 Ciflorette 2015/02/13 A 7 28 33 2 20 0 6 1 8 4 15 105.49 1 4 2171
25 Ciflorette 2015/02/13 A 8 19 32 1 17 0 4 2 9 4 9 76.47 1 2 2300
26 Ciflorette 2015/02/13 A 9 28 39 1 26 0 8 0 10 6 16 72.67 2 3 2438
27 Ciflorette 2015/03/02 A 1 33 33 3 24 0 12 2 8 4 18 154.40 2 3 2600
28 Ciflorette 2015/03/02 A 2 17 21 2 14 0 7 0 4 4 11 130.59 3 2 2743
29 Ciflorette 2015/03/02 A 3 24 24 2 21 0 8 1 9 4 11 86.94 2 2 2831
30 Ciflorette 2015/03/02 A 4 23 33 0 19 0 8 0 9 3 11 91.12 2 2 2973
31 Ciflorette 2015/03/02 A 5 24 25 2 19 0 7 0 10 3 11 103.99 2 2 3104
32 Ciflorette 2015/03/02 A 6 26 31 0 20 0 9 1 6 5 15 103.82 2 2 3245
33 Ciflorette 2015/03/02 A 7 26 31 1 21 0 11 0 9 4 14 158.69 2 3 3359
34 Ciflorette 2015/03/02 A 8 21 34 2 19 0 5 0 8 4 11 108.50 2 2 3510
35 Ciflorette 2015/03/02 A 9 19 25 2 19 0 2 2 7 3 9 135.74 1 2 3635
36 Ciflorette 2015/03/30 A 1 28 57 0 22 0 12 1 7 6 17 183.36 3 2 3757
37 Ciflorette 2015/03/30 A 2 35 35 0 28 0 18 0 8 5 18 67.83 2 3 3879
38 Ciflorette 2015/03/30 A 3 21 34 2 19 0 4 0 10 4 10 218.96 2 1 4025
39 Ciflorette 2015/03/30 A 4 32 37 1 26 0 11 1 7 5 20 165.98 3 3 4146
40 Ciflorette 2015/03/30 A 5 29 51 1 28 0 5 3 9 7 15 149.64 2 2 4288
41 Ciflorette 2015/03/30 A 6 32 54 0 26 0 6 3 11 8 23 127.37 3 4 4433
42 Ciflorette 2015/03/30 A 7 27 39 1 26 0 7 0 8 5 19 81.68 2 4 4588
43 Ciflorette 2015/03/30 A 8 39 32 1 30 0 17 1 5 7 24 105.36 2 5 4719
44 Ciflorette 2015/03/30 A 9 11 16 0 9 0 4 0 5 2 5 162.25 2 0 4870
45 Ciflorette 2015/05/27 A 1 77 112 14 72 0 13 1 19 20 46 233.55 4 5 4926
46 Ciflorette 2015/05/27 A 2 40 50 7 30 0 3 0 9 9 22 109.68 5 1 5261
47 Ciflorette 2015/05/27 A 3 51 86 9 45 0 7 1 5 13 29 120.94 5 2 5405
48 Ciflorette 2015/05/27 A 4 16 33 1 16 0 2 2 4 5 10 160.00 3 1 5579
49 Ciflorette 2015/05/27 A 5 44 68 8 36 0 8 0 6 11 25 0.00 4 2 5656
50 Ciflorette 2015/05/27 A 6 36 68 6 36 0 10 1 6 10 21 273.23 4 2 5804
51 Ciflorette 2015/05/27 A 7 45 94 6 42 0 10 2 10 13 28 110.00 4 3 5956
52 Ciflorette 2015/05/27 A 8 34 57 9 29 0 1 2 9 9 21 154.61 4 2 6144
53 Ciflorette 2015/05/27 A 9 39 62 7 35 0 6 0 10 10 23 128.87 4 2 6279
  • Example for Capriss

[12]:
# Extraction of data at plant scale
Capriss_data_extraction_at_plant_scale = analysis.extract_at_plant_scale(Clery)
Capriss_data_extraction_at_plant_scale
[12]:
Genotype date modality plant nb_total_leaves nb_total_flowers nb_stolons nb_visible_leaves nb_missing_leaves nb_vegetative_bud nb_initiated_bud nb_floral_bud nb_inflorescence type_of_crown leaf_area order_max nb_ramifications vid
0 Clery 2014/12/10 A 1 13 0 3 11 0 1 0 8 0 1 54.44 0 0 1
1 Clery 2014/12/10 A 2 14 0 3 11 0 5 2 4 0 1 57.66 0 0 101
2 Clery 2014/12/10 A 3 10 0 2 8 0 3 0 5 0 1 55.52 0 0 188
3 Clery 2014/12/10 A 4 8 0 3 6 0 0 0 4 1 3 50.24 1 0 254
4 Clery 2014/12/10 A 5 9 0 1 7 0 3 0 5 0 1 55.52 0 0 295
5 Clery 2014/12/10 A 6 11 0 3 9 0 2 0 6 0 1 87.03 0 0 383
6 Clery 2014/12/10 A 7 11 0 2 8 0 3 1 5 0 1 92.52 0 0 450
7 Clery 2014/12/10 A 8 10 0 2 7 0 5 0 2 1 3 59.87 1 0 536
8 Clery 2014/12/10 A 9 12 0 4 10 0 4 0 4 0 1 99.49 0 0 599
9 Clery 2015/01/07 A 1 11 9 2 11 0 0 4 5 1 1 56.59 0 0 676
10 Clery 2015/01/07 A 2 15 8 3 14 0 4 1 6 1 4 54.44 1 1 761
11 Clery 2015/01/07 A 3 17 0 0 11 0 7 1 2 1 6 17.51 1 1 864
12 Clery 2015/01/07 A 4 11 9 1 9 0 4 0 1 2 6 42.43 1 1 924
13 Clery 2015/01/07 A 5 16 0 3 13 0 3 0 8 0 4 46.29 1 1 974
14 Clery 2015/01/07 A 6 10 12 2 10 0 1 1 6 1 1 51.29 0 0 1072
15 Clery 2015/01/07 A 7 12 12 0 9 0 5 1 4 1 4 54.44 1 1 1153
16 Clery 2015/01/07 A 8 13 15 0 11 0 3 2 4 1 4 41.47 1 1 1235
17 Clery 2015/01/07 A 9 13 3 3 12 0 4 0 4 1 6 0.00 1 1 1308
18 Clery 2015/02/15 A 1 18 16 3 18 0 3 0 8 3 6 54.44 1 1 1377
19 Clery 2015/02/15 A 2 13 9 2 13 0 0 2 6 3 6 55.52 1 1 1494
20 Clery 2015/02/15 A 3 16 19 3 16 0 3 1 7 3 6 61.95 1 1 1575
21 Clery 2015/02/15 A 4 18 19 2 18 0 4 1 8 3 7 55.52 1 2 1670
22 Clery 2015/02/15 A 5 15 18 2 15 0 3 0 7 3 6 80.27 1 1 1780
23 Clery 2015/02/15 A 6 17 20 4 17 0 4 0 7 3 6 72.76 1 1 1865
24 Clery 2015/02/15 A 7 12 14 2 11 0 1 2 3 1 6 62.06 1 1 1964
25 Clery 2015/02/15 A 8 19 15 2 19 0 2 1 9 3 9 77.78 1 2 2021
26 Clery 2015/02/15 A 9 19 37 2 18 0 3 0 9 3 9 79.11 1 2 2136
27 Clery 2015/03/02 A 1 22 35 0 20 0 3 1 12 5 13 98.09 2 2 2236
28 Clery 2015/03/02 A 2 16 29 2 16 0 2 1 7 3 6 81.51 1 1 2376
29 Clery 2015/03/02 A 3 16 26 3 16 0 1 0 9 3 6 122.52 1 1 2480
30 Clery 2015/03/02 A 4 24 30 1 19 0 8 2 3 5 12 96.70 3 1 2579
31 Clery 2015/03/02 A 5 13 21 0 13 0 1 3 7 3 6 114.50 1 1 2677
32 Clery 2015/03/02 A 6 16 26 1 16 0 2 0 10 3 6 101.07 1 1 2769
33 Clery 2015/03/02 A 7 27 21 1 24 0 9 0 9 2 14 39.64 2 3 2874
34 Clery 2015/03/02 A 8 17 24 2 13 0 4 1 5 3 11 84.26 2 2 3011
35 Clery 2015/03/02 A 9 18 24 4 18 0 1 0 10 3 6 71.60 1 1 3093
36 Clery 2015/04/03 A 1 27 24 2 22 0 8 1 5 5 17 99.49 3 2 3216
37 Clery 2015/04/03 A 2 30 33 1 27 0 9 4 7 4 15 103.99 2 2 3333
38 Clery 2015/04/03 A 3 43 49 1 35 0 15 2 8 5 23 66.24 2 4 3478
39 Clery 2015/04/03 A 4 33 40 1 28 0 10 2 9 8 20 71.50 3 3 3651
40 Clery 2015/04/03 A 5 18 23 0 16 0 6 0 4 3 10 44.36 2 1 3809
41 Clery 2015/04/03 A 6 14 24 2 14 0 2 1 3 4 7 85.55 3 0 3880
42 Clery 2015/04/03 A 7 33 62 1 31 0 7 3 12 8 20 106.46 3 3 3948
43 Clery 2015/04/03 A 8 24 48 3 23 0 6 2 8 6 13 88.12 2 2 4131
44 Clery 2015/04/03 A 9 24 28 0 22 0 5 2 8 4 15 54.44 2 2 4255
45 Clery 2015/05/27 A 1 44 40 8 38 0 7 1 5 8 29 132.39 4 6 4358
46 Clery 2015/05/27 A 2 37 50 4 37 0 9 1 8 10 22 179.52 4 3 4516
47 Clery 2015/05/27 A 3 34 62 2 34 0 8 0 9 12 26 82.89 4 3 4670
48 Clery 2015/05/27 A 4 38 43 1 34 0 8 3 4 11 29 147.62 4 4 4818
49 Clery 2015/05/27 A 5 26 53 0 26 0 4 1 8 8 16 152.19 4 1 4951
50 Clery 2015/05/27 A 6 21 30 3 19 0 6 0 1 5 12 131.34 3 1 5071
51 Clery 2015/05/27 A 7 31 38 3 31 0 9 1 2 11 24 113.00 4 3 5146
52 Clery 2015/05/27 A 8 57 43 9 48 0 13 1 4 10 34 147.75 4 5 5260
53 Clery 2015/05/27 A 9 45 70 6 45 0 13 3 1 14 30 178.75 4 3 5453

2.5.2.2. Calcul of the most central individual for each date using analysis.median_individuals function from extraction_at_plant_scale

  • Example with Gariguette

[14]:
# Function to select the most central individual with all variable
Gariguette_most_central_individual = analysis.median_individuals(Gariguette_data_extraction_at_plant_scale)
Gariguette_most_central_individual
[14]:
Genotype date modality plant nb_total_leaves nb_total_flowers nb_stolons nb_visible_leaves nb_missing_leaves nb_vegetative_bud nb_initiated_bud nb_floral_bud nb_inflorescence type_of_crown leaf_area order_max nb_ramifications vid
4 Ciflorette 2014/12/04 A 5 9 0 2 6 0 0 2 5 0 1 91.12 0 0 235
9 Ciflorette 2015/01/07 A 1 10 10 2 10 0 0 1 6 1 1 58.73 0 0 590
25 Ciflorette 2015/02/13 A 8 19 32 1 17 0 4 2 9 4 9 76.47 1 2 2300
34 Ciflorette 2015/03/02 A 8 21 34 2 19 0 5 0 8 4 11 108.50 2 2 3510
42 Ciflorette 2015/03/30 A 7 27 39 1 26 0 7 0 8 5 19 81.68 2 4 4588
53 Ciflorette 2015/05/27 A 9 39 62 7 35 0 6 0 10 10 23 128.87 4 2 6279
[15]:
Capriss_most_central_individual = analysis.median_individuals(Capriss_data_extraction_at_plant_scale)
Capriss_most_central_individual
[15]:
Genotype date modality plant nb_total_leaves nb_total_flowers nb_stolons nb_visible_leaves nb_missing_leaves nb_vegetative_bud nb_initiated_bud nb_floral_bud nb_inflorescence type_of_crown leaf_area order_max nb_ramifications vid
5 Clery 2014/12/10 A 6 11 0 3 9 0 2 0 6 0 1 87.03 0 0 383
15 Clery 2015/01/07 A 7 12 12 0 9 0 5 1 4 1 4 54.44 1 1 1153
22 Clery 2015/02/15 A 5 15 18 2 15 0 3 0 7 3 6 80.27 1 1 1780
32 Clery 2015/03/02 A 6 16 26 1 16 0 2 0 10 3 6 101.07 1 1 2769
37 Clery 2015/04/03 A 2 30 33 1 27 0 9 4 7 4 15 103.99 2 2 3333
48 Clery 2015/05/27 A 4 38 43 1 34 0 8 3 4 11 29 147.62 4 4 4818

2.5.2.3. Vizualisation of the most central plant along time

  • Example for Gariguette

[32]:
# selection of vid of median individuals
%gui qt5
pids = list(Capriss_most_central_individual.vid)
n = len(pids)

# Plot 2D- visualisation of the most central plant
scene= visu2d.plot2d(Cir107, pids, dist=[12]*n, display=False)
PlantGL(scene, group_by_color= False)
[13]:
Capriss_data_extraction_at_plant_scale

[13]:
Genotype date modality plant nb_total_leaves nb_total_flowers nb_stolons nb_visible_leaves nb_missing_leaves nb_vegetative_bud nb_initiated_bud nb_floral_bud nb_inflorescence type_of_crown leaf_area order_max nb_ramifications vid
0 Capriss 2014/12/10 A 1 14 0 2 11 0 1 1 9 0 1 135.74 0 0 1
1 Capriss 2014/12/10 A 2 16 0 2 10 0 10 0 3 0 4 224.86 1 1 120
2 Capriss 2014/12/10 A 3 8 0 1 6 0 3 1 3 0 1 41.55 0 0 212
3 Capriss 2014/12/10 A 4 10 0 2 8 0 3 2 3 0 1 96.70 0 0 266
4 Capriss 2014/12/10 A 5 10 0 1 8 0 0 2 7 0 1 127.37 0 0 344
5 Capriss 2014/12/10 A 6 11 0 1 9 0 2 2 6 0 1 95.24 0 0 439
6 Capriss 2014/12/10 A 7 10 0 1 8 0 4 0 4 0 1 73.96 0 0 527
7 Capriss 2014/12/10 A 8 8 0 1 6 0 3 1 3 0 1 65.47 0 0 607
8 Capriss 2014/12/10 A 9 13 0 1 9 0 3 1 7 0 4 72.80 1 1 672
9 Capriss 2015/01/07 A 1 12 0 2 10 0 4 0 5 1 4 45.33 1 1 758
10 Capriss 2015/01/07 A 2 25 14 2 15 0 9 0 4 1 13 35.35 1 4 839
11 Capriss 2015/01/07 A 3 15 0 2 13 0 1 2 8 1 4 34.49 1 1 962
12 Capriss 2015/01/07 A 4 33 21 1 23 0 12 3 8 2 18 39.64 2 5 1080
13 Capriss 2015/01/07 A 5 16 13 2 11 0 5 0 5 1 7 33.55 1 2 1253
14 Capriss 2015/01/07 A 6 21 15 3 16 0 7 1 6 1 10 56.59 1 3 1352
15 Capriss 2015/01/07 A 7 26 14 2 17 0 7 2 5 1 13 56.54 1 4 1473
16 Capriss 2015/01/07 A 8 20 0 3 18 0 7 1 6 0 7 37.07 1 2 1592
17 Capriss 2015/01/07 A 9 17 13 1 13 0 6 2 5 1 7 38.83 1 2 1707
18 Capriss 2015/02/15 A 1 27 0 3 23 0 11 1 5 2 14 28.92 2 3 1803
19 Capriss 2015/02/15 A 2 30 13 2 27 0 8 0 9 6 18 45.33 1 5 1924
20 Capriss 2015/02/15 A 3 31 21 2 25 0 8 0 9 6 17 59.70 2 4 2088
21 Capriss 2015/02/15 A 4 17 7 3 13 0 9 1 2 1 6 64.44 1 1 2249
22 Capriss 2015/02/15 A 5 27 11 2 23 0 10 1 7 4 15 43.42 1 4 2325
23 Capriss 2015/02/15 A 6 25 26 2 21 0 10 1 6 3 11 48.14 2 2 2474
24 Capriss 2015/02/15 A 7 20 5 4 15 0 8 1 1 3 8 40.50 2 1 2606
25 Capriss 2015/02/15 A 8 29 16 2 22 0 15 1 2 4 17 72.67 2 4 2685
26 Capriss 2015/02/15 A 9 43 21 1 32 0 19 2 9 4 23 39.73 2 6 2808
27 Capriss 2015/03/02 A 1 24 24 1 21 0 8 2 6 4 11 96.70 2 2 3002
28 Capriss 2015/03/02 A 2 18 25 2 18 0 3 1 7 4 9 68.81 1 2 3130
29 Capriss 2015/03/02 A 3 31 17 3 25 0 11 4 5 3 17 56.54 2 4 3224
30 Capriss 2015/03/02 A 4 33 14 4 23 0 15 3 2 2 14 62.14 2 3 3359
31 Capriss 2015/03/02 A 5 36 20 4 28 0 15 3 6 3 16 86.94 2 3 3482
32 Capriss 2015/03/02 A 6 29 22 2 24 0 9 2 5 4 14 0.00 2 3 3638
33 Capriss 2015/03/02 A 7 45 26 2 35 0 23 3 8 5 21 75.51 2 4 3765
34 Capriss 2015/03/02 A 8 55 25 3 41 0 27 4 6 4 24 55.52 2 5 3975
35 Capriss 2015/03/02 A 9 50 25 1 31 0 24 5 2 5 26 60.77 2 5 4186
36 Capriss 2015/04/03 A 1 36 25 3 31 0 13 5 8 4 16 123.51 2 3 4357
37 Capriss 2015/04/03 A 2 45 24 0 34 0 23 1 5 6 28 43.40 2 5 4528
38 Capriss 2015/04/03 A 3 45 53 3 40 0 18 4 7 6 25 86.94 2 4 4682
39 Capriss 2015/04/03 A 4 45 37 3 39 0 16 7 6 7 26 83.01 2 5 4877
40 Capriss 2015/04/03 A 5 41 31 2 34 0 18 3 5 6 23 72.68 2 4 5062
41 Capriss 2015/04/03 A 6 35 27 2 34 0 13 2 9 7 18 100.99 2 3 5222
42 Capriss 2015/04/03 A 7 48 49 1 42 0 23 3 7 10 27 120.94 3 4 5384
43 Capriss 2015/04/03 A 8 36 31 1 31 0 17 0 7 5 20 114.59 2 3 5595
44 Capriss 2015/04/03 A 9 46 38 2 40 0 16 1 6 7 26 99.49 2 5 5737
45 Capriss 2015/05/27 A 1 69 71 4 65 0 16 3 16 16 38 138.63 3 5 5909
46 Capriss 2015/05/27 A 2 45 38 5 41 0 12 1 5 9 25 169.89 3 4 6175
47 Capriss 2015/05/27 A 3 45 40 5 42 0 11 1 7 11 28 133.94 3 3 6324
48 Capriss 2015/05/27 A 4 61 63 1 55 0 24 1 8 14 37 82.76 4 4 6488
49 Capriss 2015/05/27 A 5 40 40 2 37 0 16 0 4 10 23 184.32 4 2 6693
50 Capriss 2015/05/27 A 6 45 49 0 43 0 12 0 9 13 31 52.30 4 4 6826
51 Capriss 2015/05/27 A 7 70 63 3 60 0 19 1 10 15 41 86.83 3 6 7002
52 Capriss 2015/05/27 A 8 51 52 4 50 0 13 2 13 13 29 102.96 4 4 7223
53 Capriss 2015/05/27 A 9 49 55 1 47 0 17 0 12 11 26 129.52 3 3 7443
[14]:
df= Capriss_data_extraction_at_plant_scale
indices = []

for gd, dataf in df.groupby(["Genotype","date","modality"]):
        geno, date, mod = gd
        dg = dataf[
                ]
        print(dg)
        s=((dg-dg.median()).abs()/(dg-dg.median()).abs().mean()).sum(axis=1)
        print(s.idxmin())
  File "C:\Users\mlabadie\AppData\Local\Temp/ipykernel_11980/60726457.py", line 7
    ]
    ^
SyntaxError: invalid syntax

[ ]:
df= Capriss_data_extraction_at_plant_scale

df[['nb_total_leaves','nb_total_flowers', 'nb_stolons', 'nb_floral_bud', 'nb_inflorescence','type_of_crown', 'order_max']]