@@ -6,18 +6,21 @@ use matplotlib as plt;
66
77fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
88 let ( fig, [ [ mut ax] ] ) = plt:: subplots ( ) ?;
9- let pseudacorus_sepal_length = Series :: new ( "Pseudacorus_Sepal_Length" ,
9+ let pseudacorus_sepal_length = Series :: new (
10+ "Pseudacorus_Sepal_Length" . into ( ) ,
1011 & [ 6.0 , 6.0 , 5.8 , 6.5 , 5.7 , 6.8 , 6.5 , 6.8 , 7.0 , 6.2 , 6.5 , 6.6 , 7.0 , 7.0 , 7.5 , 7.0 ,
1112 6.8 , 6.5 , 6.3 , 6.2 , 6.9 , 6.3 , 6.3 , 7.0 , 6.2 , 6.8 , 6.2 , 6.3 , 5.8 , 5.9 , 6.2 , 6.3 ,
1213 6.9 , 7.3 , 7.5 , 6.4 , 6.6 , 6.4 , 6.7 , 6.4 , 6.4 , 6.6 , 6.4 , 6.2 , 6.3 , 7.9 , 6.9 , 6.2 ,
1314 5.9 , 6.3 ] ) ;
14- let pseudacorus_sepal_width = Series :: new ( "Pseudacorus_Sepal_width" ,
15+ let pseudacorus_sepal_width = Series :: new (
16+ "Pseudacorus_Sepal_width" . into ( ) ,
1517 & [ 4.0 , 3.1 , 4.0 , 3.8 , 3.4 , 3.7 , 4.7 , 4.0 , 4.5 , 3.2 , 3.9 , 4.0 , 4.1 , 4.0 , 4.6 , 4.4 ,
1618 4.0 , 4.2 , 3.9 , 4.0 , 4.8 , 4.0 , 4.2 , 3.8 , 3.6 , 3.3 , 3.4 , 3.5 , 3.1 , 3.7 , 4.4 , 4.5 ,
1719 4.4 , 4.2 , 4.2 , 4.4 , 4.0 , 4.2 , 4.0 , 4.9 , 4.3 , 4.4 , 3.6 , 3.8 , 3.5 , 4.3 , 4.6 , 3.8 ,
1820 3.6 , 3.8 ] ) ;
19- let df = DataFrame :: new (
20- vec ! [ pseudacorus_sepal_length, pseudacorus_sepal_width] ) ?;
21+ let df = DataFrame :: new ( vec ! [
22+ Column :: Series ( pseudacorus_sepal_length) ,
23+ Column :: Series ( pseudacorus_sepal_width) ] ) ?;
2124 println ! ( "df is {:?}" , & df) ;
2225 let x_col = df. column ( "Pseudacorus_Sepal_Length" ) ?. f64 ( ) ?;
2326 let y_col = df. column ( "Pseudacorus_Sepal_width" ) ?. f64 ( ) ?;
0 commit comments