Created
June 8, 2021 16:01
-
-
Save Steboss89/963df2670f3a80eec39564653a0f02f6 to your computer and use it in GitHub Desktop.
Impl of HousingDataset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn new(v: Vec<&str>) -> HousingDataset { | |
// note we have declared a new vector of &strings, remember borrowship, which will be a struct HousingDatset | |
// as input we are receiving a string from the csv file. | |
// we are going to decode this as a f64 vector using the unwrap function | |
let unwrapped_text: Vec<f64> = v.iter().map(|r| r.parse().unwrap()).collect(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment