So I have a text full of x and y
coordinates in the for x_y new line delimited. Here is the first 3
lines:
68_1
153_16099247764943158
153_775041589
I'm massaging the data to run a liner regression on it. At the
moment the program I'm writing looks like this (still a work in
progress...):
module Main where
import qualified Data.Text as T
import qualified Data.Text.IO as TI
import Numeric.GSL.Fitting.Linear
import Data.Packed.Vector
buildList :: IO [[T.Text]]
buildList = TI.readFile "lin_reg_data.txt" >>= return . map
(T.split (=='_')) . T.lines
--main :: IO ()
--main = do
-- values <- buildList
-- let heads = fromList $ map (\x -> read (T.unpack . head $
x):: Double) values
-- let lasts = fromList $ map (\x -> read (T.unpack . last $
x):: Double) values
-- print linear heads lasts
I'm just trying to find a way to not iterate over "vaues" twice as
that seems like a waste of computing time to me. Of course any
advice on this would be appreciated.
Bryce
On 01/28/2013 10:42 AM, Ozgur Akgun wrote:
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners