javelin (empty) → 0.1.0.0
raw patch · 30 files changed
+7641/−0 lines, 30 filesdep +HUnitdep +basedep +containers
Dependencies added: HUnit, base, containers, criterion, csv, deepseq, directory, foldl, hedgehog, ieee754, indexed-traversable, javelin, mono-traversable, random, statistics, tasty, tasty-hedgehog, tasty-hspec, tasty-hunit, vector, vector-algorithms
Files
- CHANGELOG.md +5/−0
- LICENSE +20/−0
- benchmarks/Comparison.hs +201/−0
- benchmarks/Operations.hs +70/−0
- files/aapl.txt +1/−0
- javelin.cabal +141/−0
- scripts/bench-report.hs +100/−0
- src/Data/Series.hs +1361/−0
- src/Data/Series/Generic.hs +86/−0
- src/Data/Series/Generic/Aggregation.hs +326/−0
- src/Data/Series/Generic/Definition.hs +832/−0
- src/Data/Series/Generic/Internal.hs +27/−0
- src/Data/Series/Generic/Numeric.hs +7/−0
- src/Data/Series/Generic/Scans.hs +112/−0
- src/Data/Series/Generic/View.hs +333/−0
- src/Data/Series/Generic/Zip.hs +463/−0
- src/Data/Series/Index.hs +107/−0
- src/Data/Series/Index/Definition.hs +503/−0
- src/Data/Series/Index/Internal.hs +39/−0
- src/Data/Series/Tutorial.hs +770/−0
- src/Data/Series/Unboxed.hs +1291/−0
- test/Main.hs +21/−0
- test/Test/Data/Series.hs +7/−0
- test/Test/Data/Series/Generic/Aggregation.hs +134/−0
- test/Test/Data/Series/Generic/Definition.hs +206/−0
- test/Test/Data/Series/Generic/Numeric.hs +62/−0
- test/Test/Data/Series/Generic/View.hs +143/−0
- test/Test/Data/Series/Generic/Zip.hs +147/−0
- test/Test/Data/Series/Index.hs +113/−0
- test/Test/Utils.hs +13/−0
+ CHANGELOG.md view
@@ -0,0 +1,5 @@+# Revision history for javelin++## Release 0.1.0.0++* This is the first version of `javelin` and associated packages.
+ LICENSE view
@@ -0,0 +1,20 @@+Copyright (c) Laurent P. René de Cotret++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ benchmarks/Comparison.hs view
@@ -0,0 +1,201 @@+-- This benchmarking script is forked from+-- https://github.com/haskell-perf/dictionaries/blob/master/Time.hs+{-# OPTIONS_GHC -fno-warn-orphans #-}+{-# LANGUAGE BangPatterns #-}+{-# LANGUAGE ExistentialQuantification #-}++module Main (main) where++import Control.DeepSeq ( NFData, force )+import qualified Control.Foldl as Fold+import Control.Monad ( when )+import Criterion.Main ( defaultMainWith, defaultConfig, bench, bgroup, env, nf )+import Criterion.Types ( Config(csvFile) )+import Data.List ( foldl' )+import qualified Data.Map.Lazy+import qualified Data.Map.Strict+import Data.MonoTraversable ( ofoldlUnwrap )+import Data.Set ( Set )+import qualified Data.Set as Set +import qualified Data.Series+import qualified Data.Series.Unboxed+import qualified Data.Series.Index as Index+import qualified Data.Vector+import qualified Data.Vector.Unboxed+import System.Directory ( doesFileExist, removeFile )+import System.Random ( mkStdGen, Random(randoms) )++data Lookup =+ forall f. (NFData (f Int)) =>+ Lookup String+ ([(Int, Int)] -> f Int)+ (Int -> f Int -> Maybe Int)++data Sum =+ forall f. (NFData (f Int)) =>+ Sum String ([(Int, Int)] -> f Int) (f Int -> Int)++data Fold =+ forall f. (NFData (f Double)) =>+ Fold String ([(Int, Double)] -> f Double) (f Double -> Double)++data Mappend = + forall f. (NFData (f Int), Monoid (f Int)) =>+ Mappend String + ([(Int, Int)] -> f Int)++data SliceByKeys =+ forall f. (NFData (f Int), Monoid (f Int)) =>+ SliceByKeys String + ([(Int, Int)] -> f Int)+ (Set Int -> f Int -> f Int)+++++main :: IO ()+main = do+ let fp = "out.csv"+ exists <- doesFileExist fp+ when exists (removeFile fp)+ defaultMainWith+ defaultConfig {csvFile = Just fp}+ [ bgroup+ "Lookup Int (Randomized)"+ (lookupRandomized+ [ Lookup "Data.Map.Lazy" Data.Map.Lazy.fromList Data.Map.Lazy.lookup+ , Lookup+ "Data.Map.Strict"+ Data.Map.Strict.fromList+ Data.Map.Strict.lookup+ , Lookup+ "Data.Series"+ Data.Series.fromList+ (flip Data.Series.at)+ , Lookup + "Data.Vector"+ (Data.Vector.fromList . map fst)+ (\ix -> Data.Vector.find (==ix))+ , Lookup+ "Data.Series.Unboxed"+ Data.Series.Unboxed.fromList+ (flip Data.Series.Unboxed.at)+ , Lookup + "Data.Vector.Unboxed"+ (Data.Vector.Unboxed.fromList . map fst)+ (\ix -> Data.Vector.Unboxed.find (==ix))+ ])+ , bgroup+ "Sum Int (Randomized)"+ (sumRandomized+ [ Sum "Data.Map.Lazy" Data.Map.Lazy.fromList sum+ , Sum "Data.Map.Strict" Data.Map.Strict.fromList sum+ , Sum "Data.Series" Data.Series.fromList sum+ , Sum "Data.Vector" (Data.Vector.fromList . map snd) sum+ , Sum "Data.Series.Unboxed" Data.Series.Unboxed.fromList Data.Series.Unboxed.sum+ , Sum "Data.Vector.Unboxed" (Data.Vector.Unboxed.fromList . map snd) Data.Vector.Unboxed.sum+ ])+ , bgroup+ "Fold mean (Randomized)"+ (foldRandomized+ [ Fold "Data.Map.Lazy" Data.Map.Lazy.fromList (Fold.fold Fold.mean)+ , Fold "Data.Map.Strict" Data.Map.Strict.fromList (Fold.fold Fold.mean)+ , Fold "Data.Series" Data.Series.fromList (Data.Series.fold Fold.mean)+ , Fold "Data.Vector" (Data.Vector.fromList . map snd) (Fold.fold Fold.mean)+ , Fold "Data.Series.Unboxed" Data.Series.Unboxed.fromList (Data.Series.Unboxed.fold Fold.mean)+ , Fold "Data.Vector.Unboxed" (Data.Vector.Unboxed.fromList . map snd) (Fold.purely ofoldlUnwrap Fold.mean)+ ])+ , bgroup+ "Mappend Int (Randomized)"+ ( mappendRandomized + [ Mappend "Data.Map.Lazy" Data.Map.Lazy.fromList+ , Mappend "Data.Map.Strict" Data.Map.Strict.fromList+ , Mappend "Data.Series" Data.Series.fromList+ , Mappend "Data.Vector" (Data.Vector.fromList . map snd)+ , Mappend "Data.Series.Unboxed" Data.Series.Unboxed.fromList+ , Mappend "Data.Vector.Unboxed" (Data.Vector.Unboxed.fromList . map snd)+ ])+ , bgroup+ "Slice by keys (Randomized)"+ ( sliceByKeyRandomized + [ SliceByKeys "Data.Map.Lazy" + Data.Map.Lazy.fromList+ (flip Data.Map.Lazy.restrictKeys)+ , SliceByKeys "Data.Map.Strict" + Data.Map.Strict.fromList+ (flip Data.Map.Strict.restrictKeys)+ , SliceByKeys "Data.Series" + Data.Series.fromList+ (\ks xs -> xs `Data.Series.select` Index.fromSet ks)+ , SliceByKeys "Data.Series.Unboxed" + Data.Series.Unboxed.fromList+ (\ks xs -> xs `Data.Series.Unboxed.select` Index.fromSet ks)+ ])+ ]++ where+ lookupRandomized funcs =+ [ env+ (let list = take i (zip (randoms (mkStdGen 0) :: [Int]) [1 ..])+ !elems = force (fromList list)+ in pure (list, elems))+ (\(~(list, elems)) ->+ bench (title ++ ":" ++ show i) $+ nf+ (foldl'+ (\_ k ->+ case func k elems of+ Just !v -> v+ Nothing -> 0)+ 0)+ (map fst list))+ | i <- [10, 100, 1000, 10000]+ , Lookup title fromList func <- funcs+ ]+ sumRandomized funcs =+ [ env+ (let list = take i (zip (randoms (mkStdGen 0) :: [Int]) [1 ..])+ !elems = force (fromList list)+ in pure (list, elems))+ (\(~(_, elems)) ->+ bench (title ++ ":" ++ show i) $+ nf func elems)+ | i <- [10, 100, 1000, 10000, 100000, 1000000]+ , Sum title fromList func <- funcs+ ]+ foldRandomized funcs =+ [ env+ (let list = take i (zip (randoms (mkStdGen 0) :: [Int]) [1 ..])+ !elems = force (fromList list)+ in pure (list, elems))+ (\(~(_, elems)) ->+ bench (title ++ ":" ++ show i) $+ nf func elems)+ | i <- [10, 100, 1000, 10000, 100000, 1000000]+ , Fold title fromList func <- funcs+ ]+ mappendRandomized funcs =+ [ env+ (let list1 = take i (zip (randoms (mkStdGen 0) :: [Int]) [1 ..])+ list2 = take i (zip (randoms (mkStdGen 0) :: [Int]) [1 ..])+ !elems1 = force (fromList list1)+ !elems2 = force (fromList list2)+ in pure (elems1, elems2))+ (\(~(elems1, elems2)) ->+ bench (title ++ ":" ++ show i) $+ nf mconcat [elems1, elems2])+ | i <- [10, 100, 1000, 10000, 100000, 1000000]+ , Mappend title fromList <- funcs+ ]+ sliceByKeyRandomized funcs = + [ env+ (let list = take i (zip (randoms (mkStdGen 0) :: [Int]) [1 ..])+ keys = Set.fromList $ take (round ((fromIntegral i / 10) :: Double)) (randoms (mkStdGen 0) :: [Int])+ !elems = force (fromList list)+ in pure (keys, elems))+ (\(~(keys, elems)) ->+ bench (title ++ ":" ++ show i) $+ nf (slice keys) elems)+ | i <- [10, 100, 1000, 10000, 100000, 1000000]+ , SliceByKeys title fromList slice <- funcs+ ]
+ benchmarks/Operations.hs view
@@ -0,0 +1,70 @@++import Control.DeepSeq ( rnf )+import Control.Exception ( evaluate )+import Criterion.Main ( bench, whnf, defaultMain )++import Data.Foldable ( Foldable(foldl') )+import Data.Set ( Set ) +import qualified Data.Set as Set+import Data.Series ( Series )+import qualified Data.Series as Series+import qualified Data.Series.Index as Index+++main :: IO ()+main = do+ let srs1 = Series.fromList $ zip [0..] [1::Int .. 2^(12::Int)]+ srs2 = Series.fromList $ zip [0,2..] [1::Int .. 2^(12::Int)]+ elems = Index.toSet $ Series.index srs1+ small = Set.fromAscList [1::Int .. 2^(8::Int)]+ elems_even = Set.fromDistinctAscList [2::Int, 4..2^(12::Int)]+ elems_odd = Set.fromDistinctAscList [1::Int, 3..2^(12::Int)]+ evaluate $ rnf [elems, small, elems_even, elems_odd]+ evaluate $ rnf [srs1, srs2]+ defaultMain+ [ bench "at" $ whnf (at elems_even) srs1+ , bench "iat" $ whnf (iat elems_even) srs1+ , bench "select" $ whnf (select elems_odd) srs1+ , bench "mappend" $ whnf (mappend' srs1) srs2+ , bench "zipWithMatched" $ whnf (zipWithMatched srs1) srs1+ , bench "group by ... aggregate with ..." $ whnf (groupbyagg small) srs1+ , bench "group by ... fold with ..." $ whnf (groupbyfold small) srs1+ ]++at :: Set Int -> Series Int Int -> Int+at xs s = foldl' go 0 xs+ where+ go n x = case s `Series.at` x of + Just _ -> n + 1+ Nothing -> n++iat :: Set Int -> Series Int Int -> Int+iat xs s = foldl' go 0 xs+ where+ go n x = case s `Series.iat` x of + Just _ -> n + 1+ Nothing -> n+ +select :: Set Int -> Series Int Int -> Int+select ks s = foldl' go 0 ks+ where+ go n k = n + length (s `Series.select` ((k-100) `Series.to` (k+100)))+++mappend' :: Series Int Int -> Series Int Int -> Int+mappend' xs ys = sum $ xs <> ys+++zipWithMatched :: Series Int Int -> Series Int Int -> Int+zipWithMatched xs ys = length $ Series.zipWithMatched (+) xs ys+++groupbyagg :: Set Int -> Series Int Int -> Int+groupbyagg ks s = foldl' go 0 ks+ where+ go n k = n + product (s `Series.groupBy` (`mod` (k + 1)) `Series.aggregateWith` sum)++groupbyfold :: Set Int -> Series Int Int -> Int+groupbyfold ks s = foldl' go 0 ks+ where+ go n k = n + product (s `Series.groupBy` (`mod` (k + 1)) `Series.foldWith` (+))
+ files/aapl.txt view
@@ -0,0 +1,1 @@+[("1980-12-12",0.1007),("1980-12-15",0.0954),("1980-12-16",0.0884),("1980-12-17",0.0906),("1980-12-18",0.0933),("1980-12-19",0.099),("1980-12-22",0.1038),("1980-12-23",0.1082),("1980-12-24",0.1138),("1980-12-26",0.1243),("1980-12-29",0.1261),("1980-12-30",0.123),("1980-12-31",0.1195),("1981-01-02",0.1208),("1981-01-05",0.1182),("1981-01-06",0.113),("1981-01-07",0.1082),("1981-01-08",0.106),("1981-01-09",0.1117),("1981-01-12",0.1108),("1981-01-13",0.1068),("1981-01-14",0.1073),("1981-01-15",0.1095),("1981-01-16",0.1086),("1981-01-19",0.1151),("1981-01-20",0.1117),("1981-01-21",0.1138),("1981-01-22",0.1151),("1981-01-23",0.1147),("1981-01-26",0.113),("1981-01-27",0.1121),("1981-01-28",0.1086),("1981-01-29",0.1046),("1981-01-30",0.099),("1981-02-02",0.0933),("1981-02-03",0.0967),("1981-02-04",0.1002),("1981-02-05",0.1002),("1981-02-06",0.1007),("1981-02-09",0.0954),("1981-02-10",0.0954),("1981-02-11",0.0924),("1981-02-12",0.0915),("1981-02-13",0.0893),("1981-02-17",0.0915),("1981-02-18",0.0954),("1981-02-19",0.0898),("1981-02-20",0.0849),("1981-02-23",0.0862),("1981-02-24",0.0832),("1981-02-25",0.0884),("1981-02-26",0.0898),("1981-02-27",0.0928),("1981-03-02",0.0933),("1981-03-03",0.0919),("1981-03-04",0.0911),("1981-03-05",0.0906),("1981-03-06",0.0898),("1981-03-09",0.0828),("1981-03-10",0.0788),("1981-03-11",0.0757),("1981-03-12",0.0788),("1981-03-13",0.0779),("1981-03-16",0.081),("1981-03-17",0.0849),("1981-03-18",0.0902),("1981-03-19",0.0893),("1981-03-20",0.0902),("1981-03-23",0.0937),("1981-03-24",0.0933),("1981-03-25",0.0915),("1981-03-26",0.0898),("1981-03-27",0.0867),("1981-03-30",0.0867),("1981-03-31",0.0858),("1981-04-01",0.0849),("1981-04-02",0.0924),("1981-04-03",0.0928),("1981-04-06",0.0911),("1981-04-07",0.0902),("1981-04-08",0.0946),("1981-04-09",0.0963),("1981-04-10",0.0977),("1981-04-13",0.0977),("1981-04-14",0.0977),("1981-04-15",0.0928),("1981-04-16",0.0876),("1981-04-20",0.0902),("1981-04-21",0.0963),("1981-04-22",0.0998),("1981-04-23",0.1025),("1981-04-24",0.1016),("1981-04-27",0.1007),("1981-04-28",0.099),("1981-04-29",0.0977),("1981-04-30",0.0994),("1981-05-01",0.0994),("1981-05-04",0.099),("1981-05-05",0.0985),("1981-05-06",0.0959),("1981-05-07",0.0972),("1981-05-08",0.0981),("1981-05-11",0.0959),("1981-05-12",0.0959),("1981-05-13",0.0954),("1981-05-14",0.0941),("1981-05-15",0.0963),("1981-05-18",0.0981),("1981-05-19",0.0963),("1981-05-20",0.0994),("1981-05-21",0.1051),("1981-05-22",0.1099),("1981-05-26",0.1095),("1981-05-27",0.1156),("1981-05-28",0.1156),("1981-05-29",0.116),("1981-06-01",0.116),("1981-06-02",0.1103),("1981-06-03",0.1103),("1981-06-04",0.1125),("1981-06-05",0.1108),("1981-06-08",0.1068),("1981-06-09",0.109),("1981-06-10",0.1103),("1981-06-11",0.1151),("1981-06-12",0.1138),("1981-06-15",0.1134),("1981-06-16",0.1112),("1981-06-17",0.1095),("1981-06-18",0.109),("1981-06-19",0.106),("1981-06-22",0.102),("1981-06-23",0.1038),("1981-06-24",0.1011),("1981-06-25",0.1033),("1981-06-26",0.102),("1981-06-29",0.0985),("1981-06-30",0.0911),("1981-07-01",0.0902),("1981-07-02",0.0902),("1981-07-06",0.0871),("1981-07-07",0.088),("1981-07-08",0.0915),("1981-07-09",0.0845),("1981-07-10",0.0779),("1981-07-13",0.0797),("1981-07-14",0.0832),("1981-07-15",0.0854),("1981-07-16",0.0876),("1981-07-17",0.0906),("1981-07-20",0.0845),("1981-07-21",0.0841),("1981-07-22",0.0793),("1981-07-23",0.0814),("1981-07-24",0.0841),("1981-07-27",0.0876),("1981-07-28",0.0845),("1981-07-29",0.0832),("1981-07-30",0.0862),("1981-07-31",0.0876),("1981-08-03",0.0867),("1981-08-04",0.088),("1981-08-05",0.0906),("1981-08-06",0.0884),("1981-08-07",0.0884),("1981-08-11",0.0858),("1981-08-12",0.0841),("1981-08-13",0.0814),("1981-08-14",0.0801),("1981-08-17",0.0775),("1981-08-18",0.0757),("1981-08-19",0.0749),("1981-08-20",0.0757),("1981-08-21",0.0705),("1981-08-24",0.0661),("1981-08-25",0.0678),("1981-08-26",0.0666),("1981-08-27",0.067),("1981-08-28",0.0705),("1981-08-31",0.0705),("1981-09-01",0.0749),("1981-09-02",0.0762),("1981-09-03",0.0722),("1981-09-04",0.0714),("1981-09-08",0.0692),("1981-09-09",0.0692),("1981-09-10",0.0696),("1981-09-11",0.0688),("1981-09-14",0.0666),("1981-09-15",0.0648),("1981-09-16",0.0635),("1981-09-17",0.0617),("1981-09-18",0.0622),("1981-09-21",0.0626),("1981-09-22",0.0591),("1981-09-23",0.0578),("1981-09-24",0.0573),("1981-09-25",0.0499),("1981-09-28",0.0504),("1981-09-29",0.053),("1981-09-30",0.0534),("1981-10-01",0.0534),("1981-10-02",0.0578),("1981-10-05",0.0595),("1981-10-06",0.0591),("1981-10-07",0.0626),("1981-10-08",0.0648),("1981-10-09",0.0653),("1981-10-12",0.0674),("1981-10-13",0.0674),("1981-10-14",0.0635),("1981-10-15",0.0648),("1981-10-16",0.0639),("1981-10-19",0.0653),("1981-10-20",0.0688),("1981-10-21",0.0688),("1981-10-22",0.0683),("1981-10-23",0.0666),("1981-10-26",0.0666),("1981-10-27",0.0678),("1981-10-28",0.0701),("1981-10-29",0.0692),("1981-10-30",0.0701),("1981-11-02",0.0701),("1981-11-03",0.0692),("1981-11-04",0.0674),("1981-11-05",0.0626),("1981-11-06",0.063),("1981-11-09",0.0639),("1981-11-10",0.0643),("1981-11-11",0.0661),("1981-11-12",0.0683),("1981-11-13",0.0635),("1981-11-16",0.0626),("1981-11-17",0.0639),("1981-11-18",0.0661),("1981-11-19",0.0661),("1981-11-20",0.0666),("1981-11-23",0.0635),("1981-11-24",0.063),("1981-11-25",0.0643),("1981-11-27",0.0661),("1981-11-30",0.0653),("1981-12-01",0.0653),("1981-12-02",0.0657),("1981-12-03",0.0648),("1981-12-04",0.0666),("1981-12-07",0.067),("1981-12-08",0.0657),("1981-12-09",0.0661),("1981-12-10",0.0661),("1981-12-11",0.0657),("1981-12-14",0.0635),("1981-12-15",0.0653),("1981-12-16",0.0683),("1981-12-17",0.074),("1981-12-18",0.0801),("1981-12-21",0.0766),("1981-12-22",0.0779),("1981-12-23",0.0762),("1981-12-24",0.0766),("1981-12-28",0.0731),("1981-12-29",0.0744),("1981-12-30",0.0775),("1981-12-31",0.0775),("1982-01-04",0.0771),("1982-01-05",0.0731),("1982-01-06",0.0722),("1982-01-07",0.0666),("1982-01-08",0.0696),("1982-01-11",0.0653),("1982-01-12",0.063),("1982-01-13",0.0626),("1982-01-14",0.0657),("1982-01-15",0.0701),("1982-01-18",0.0714),("1982-01-19",0.0696),("1982-01-20",0.0709),("1982-01-21",0.0722),("1982-01-22",0.0727),("1982-01-25",0.0705),("1982-01-26",0.0678),("1982-01-27",0.0683),("1982-01-28",0.0705),("1982-01-29",0.0714),("1982-02-01",0.0705),("1982-02-02",0.0709),("1982-02-03",0.0709),("1982-02-04",0.0692),("1982-02-05",0.0692),("1982-02-08",0.0648),("1982-02-09",0.0648),("1982-02-10",0.0657),("1982-02-11",0.0648),("1982-02-12",0.0657),("1982-02-16",0.0643),("1982-02-17",0.0653),("1982-02-18",0.0661),("1982-02-19",0.0657),("1982-02-22",0.0648),("1982-02-23",0.0639),("1982-02-24",0.0643),("1982-02-25",0.0639),("1982-02-26",0.0639),("1982-03-01",0.0643),("1982-03-02",0.0643),("1982-03-03",0.0643),("1982-03-04",0.063),("1982-03-05",0.0583),("1982-03-08",0.0573),("1982-03-09",0.0578),("1982-03-10",0.0569),("1982-03-11",0.0569),("1982-03-12",0.0534),("1982-03-15",0.053),("1982-03-16",0.0521),("1982-03-17",0.0495),("1982-03-18",0.0534),("1982-03-19",0.0583),("1982-03-22",0.0626),("1982-03-23",0.0617),("1982-03-24",0.0583),("1982-03-25",0.0578),("1982-03-26",0.0569),("1982-03-29",0.0583),("1982-03-30",0.0591),("1982-03-31",0.0591),("1982-04-01",0.0622),("1982-04-02",0.0622),("1982-04-05",0.0622),("1982-04-06",0.0617),("1982-04-07",0.0609),("1982-04-08",0.0613),("1982-04-12",0.0609),("1982-04-13",0.056),("1982-04-14",0.0565),("1982-04-15",0.0573),("1982-04-16",0.0591),("1982-04-19",0.0578),("1982-04-20",0.0552),("1982-04-21",0.0547),("1982-04-22",0.0538),("1982-04-23",0.0538),("1982-04-26",0.0552),("1982-04-27",0.0534),("1982-04-28",0.0512),("1982-04-29",0.0512),("1982-04-30",0.0517),("1982-05-03",0.0534),("1982-05-04",0.0552),("1982-05-05",0.0543),("1982-05-06",0.056),("1982-05-07",0.0569),("1982-05-10",0.056),("1982-05-11",0.0543),("1982-05-12",0.053),("1982-05-13",0.0534),("1982-05-14",0.0512),("1982-05-17",0.0504),("1982-05-18",0.0495),("1982-05-19",0.049),("1982-05-20",0.0495),("1982-05-21",0.0499),("1982-05-24",0.0504),("1982-05-25",0.0504),("1982-05-26",0.0499),("1982-05-27",0.049),("1982-05-28",0.049),("1982-06-01",0.0482),("1982-06-02",0.049),("1982-06-03",0.0473),("1982-06-04",0.046),("1982-06-07",0.046),("1982-06-08",0.0455),("1982-06-09",0.0447),("1982-06-10",0.0451),("1982-06-11",0.0469),("1982-06-14",0.0469),("1982-06-15",0.0469),("1982-06-16",0.0469),("1982-06-17",0.046),("1982-06-18",0.0451),("1982-06-21",0.0451),("1982-06-22",0.0469),("1982-06-23",0.0482),("1982-06-24",0.0482),("1982-06-25",0.0464),("1982-06-28",0.046),("1982-06-29",0.0447),("1982-06-30",0.0447),("1982-07-01",0.0442),("1982-07-02",0.042),("1982-07-06",0.0403),("1982-07-07",0.0403),("1982-07-08",0.0385),("1982-07-09",0.0398),("1982-07-12",0.0407),("1982-07-13",0.0433),("1982-07-14",0.0438),("1982-07-15",0.0447),("1982-07-16",0.0464),("1982-07-19",0.0469),("1982-07-20",0.0499),("1982-07-21",0.0499),("1982-07-22",0.0504),("1982-07-23",0.0495),("1982-07-26",0.0473),("1982-07-27",0.0473),("1982-07-28",0.0451),("1982-07-29",0.0469),("1982-07-30",0.0473),("1982-08-02",0.0486),("1982-08-03",0.0455),("1982-08-04",0.0451),("1982-08-05",0.0433),("1982-08-06",0.0429),("1982-08-09",0.0433),("1982-08-10",0.046),("1982-08-11",0.0464),("1982-08-12",0.046),("1982-08-13",0.046),("1982-08-16",0.0469),("1982-08-17",0.0499),("1982-08-18",0.0499),("1982-08-19",0.0504),("1982-08-20",0.0517),("1982-08-23",0.0538),("1982-08-24",0.0565),("1982-08-25",0.0604),("1982-08-26",0.0622),("1982-08-27",0.0591),("1982-08-30",0.06),("1982-08-31",0.063),("1982-09-01",0.0613),("1982-09-02",0.0639),("1982-09-03",0.0643),("1982-09-07",0.0609),("1982-09-08",0.063),("1982-09-09",0.0617),("1982-09-10",0.0635),("1982-09-13",0.0639),("1982-09-14",0.0661),("1982-09-15",0.0657),("1982-09-16",0.0635),("1982-09-17",0.0622),("1982-09-20",0.0626),("1982-09-21",0.0639),("1982-09-22",0.0657),("1982-09-23",0.0657),("1982-09-24",0.0635),("1982-09-27",0.0635),("1982-09-28",0.0643),("1982-09-29",0.0643),("1982-09-30",0.0639),("1982-10-01",0.0648),("1982-10-04",0.0657),("1982-10-05",0.0661),("1982-10-06",0.0709),("1982-10-07",0.0766),("1982-10-08",0.0823),("1982-10-11",0.0841),("1982-10-12",0.0814),("1982-10-13",0.0823),("1982-10-14",0.0828),("1982-10-15",0.0806),("1982-10-18",0.0823),("1982-10-19",0.0841),("1982-10-20",0.0889),("1982-10-21",0.0911),("1982-10-22",0.0906),("1982-10-25",0.0854),("1982-10-26",0.0858),("1982-10-27",0.088),("1982-10-28",0.088),("1982-10-29",0.0889),("1982-11-01",0.0937),("1982-11-02",0.1002),("1982-11-03",0.1077),("1982-11-04",0.1086),("1982-11-05",0.1055),("1982-11-08",0.1011),("1982-11-09",0.1046),("1982-11-10",0.1086),("1982-11-11",0.1156),("1982-11-12",0.1134),("1982-11-15",0.1108),("1982-11-16",0.1051),("1982-11-17",0.1099),("1982-11-18",0.1099),("1982-11-19",0.1082),("1982-11-22",0.0985),("1982-11-23",0.1011),("1982-11-24",0.1033),("1982-11-26",0.1016),("1982-11-29",0.1011),("1982-11-30",0.1117),("1982-12-01",0.1138),("1982-12-02",0.1138),("1982-12-03",0.1112),("1982-12-06",0.1173),("1982-12-07",0.1186),("1982-12-08",0.116),("1982-12-09",0.1103),("1982-12-10",0.1025),("1982-12-13",0.1002),("1982-12-14",0.0994),("1982-12-15",0.099),("1982-12-16",0.1007),("1982-12-17",0.1055),("1982-12-20",0.1051),("1982-12-21",0.106),("1982-12-22",0.109),("1982-12-23",0.1121),("1982-12-27",0.1147),("1982-12-28",0.1138),("1982-12-29",0.1099),("1982-12-30",0.1051),("1982-12-31",0.1046),("1983-01-03",0.0998),("1983-01-04",0.1055),("1983-01-05",0.106),("1983-01-06",0.102),("1983-01-07",0.0963),("1983-01-10",0.1007),("1983-01-11",0.102),("1983-01-12",0.1077),("1983-01-13",0.1077),("1983-01-14",0.1156),("1983-01-17",0.1195),("1983-01-18",0.1169),("1983-01-19",0.1178),("1983-01-20",0.1309),("1983-01-21",0.1309),("1983-01-24",0.1235),("1983-01-25",0.1283),("1983-01-26",0.1335),("1983-01-27",0.1427),("1983-01-28",0.1436),("1983-01-31",0.1432),("1983-02-01",0.1462),("1983-02-02",0.1502),("1983-02-03",0.1563),("1983-02-04",0.1541),("1983-02-07",0.148),("1983-02-08",0.1467),("1983-02-09",0.148),("1983-02-10",0.1576),("1983-02-11",0.1629),("1983-02-14",0.162),("1983-02-15",0.159),("1983-02-16",0.1559),("1983-02-17",0.1541),("1983-02-18",0.159),("1983-02-22",0.1629),("1983-02-23",0.1642),("1983-02-24",0.1686),("1983-02-25",0.1638),("1983-02-28",0.1598),("1983-03-01",0.1624),("1983-03-02",0.1638),("1983-03-03",0.1585),("1983-03-04",0.1563),("1983-03-07",0.1532),("1983-03-08",0.1484),("1983-03-09",0.1528),("1983-03-10",0.1506),("1983-03-11",0.1484),("1983-03-14",0.1449),("1983-03-15",0.1471),("1983-03-16",0.1471),("1983-03-17",0.1484),("1983-03-18",0.1506),("1983-03-21",0.1541),("1983-03-22",0.1559),("1983-03-23",0.1484),("1983-03-24",0.1511),("1983-03-25",0.1511),("1983-03-28",0.1489),("1983-03-29",0.1532),("1983-03-30",0.155),("1983-03-31",0.148),("1983-04-04",0.1441),("1983-04-05",0.1414),("1983-04-06",0.1401),("1983-04-07",0.1388),("1983-04-08",0.1379),("1983-04-11",0.1458),("1983-04-12",0.1489),("1983-04-13",0.1541),("1983-04-14",0.1576),("1983-04-15",0.1602),("1983-04-18",0.1646),("1983-04-19",0.1629),("1983-04-20",0.1773),("1983-04-21",0.1821),("1983-04-22",0.1786),("1983-04-25",0.1703),("1983-04-26",0.1751),("1983-04-27",0.1734),("1983-04-28",0.1751),("1983-04-29",0.1769),("1983-05-02",0.1716),("1983-05-03",0.1699),("1983-05-04",0.1804),("1983-05-05",0.1922),("1983-05-06",0.1931),("1983-05-09",0.1904),("1983-05-10",0.1918),("1983-05-11",0.1869),("1983-05-12",0.1852),("1983-05-13",0.1861),("1983-05-16",0.1813),("1983-05-17",0.1817),("1983-05-18",0.1839),("1983-05-19",0.1896),("1983-05-20",0.1992),("1983-05-23",0.2014),("1983-05-24",0.2119),("1983-05-25",0.2102),("1983-05-26",0.208),("1983-05-27",0.208),("1983-05-31",0.2023),("1983-06-01",0.2036),("1983-06-02",0.2049),("1983-06-03",0.215),("1983-06-06",0.2198),("1983-06-07",0.2124),("1983-06-08",0.2097),("1983-06-09",0.2084),("1983-06-10",0.2075),("1983-06-13",0.2005),("1983-06-14",0.1962),("1983-06-15",0.1904),("1983-06-16",0.2005),("1983-06-17",0.1966),("1983-06-20",0.1869),("1983-06-21",0.1883),("1983-06-22",0.194),("1983-06-23",0.1879),("1983-06-24",0.1865),("1983-06-27",0.1764),("1983-06-28",0.1642),("1983-06-29",0.1721),("1983-06-30",0.1712),("1983-07-01",0.1725),("1983-07-05",0.1655),("1983-07-06",0.1659),("1983-07-07",0.1638),("1983-07-08",0.162),("1983-07-11",0.1664),("1983-07-12",0.1624),("1983-07-13",0.1615),("1983-07-14",0.1611),("1983-07-15",0.1554),("1983-07-18",0.155),("1983-07-19",0.1532),("1983-07-20",0.1445),("1983-07-21",0.1519),("1983-07-22",0.1532),("1983-07-25",0.1511),("1983-07-26",0.137),("1983-07-27",0.127),("1983-07-28",0.1191),("1983-07-29",0.1222),("1983-08-01",0.1208),("1983-08-02",0.1204),("1983-08-03",0.1222),("1983-08-04",0.1165),("1983-08-05",0.1186),("1983-08-08",0.1191),("1983-08-09",0.1204),("1983-08-10",0.12),("1983-08-11",0.1182),("1983-08-12",0.1173),("1983-08-15",0.1204),("1983-08-16",0.1186),("1983-08-17",0.116),("1983-08-18",0.1173),("1983-08-19",0.1182),("1983-08-22",0.1178),("1983-08-23",0.1117),("1983-08-24",0.106),("1983-08-25",0.1068),("1983-08-26",0.1082),("1983-08-29",0.1095),("1983-08-30",0.1151),("1983-08-31",0.1305),("1983-09-01",0.1274),("1983-09-02",0.1331),("1983-09-06",0.1379),("1983-09-07",0.1213),("1983-09-08",0.1112),("1983-09-09",0.1073),("1983-09-12",0.1073),("1983-09-13",0.1121),("1983-09-14",0.1108),("1983-09-15",0.1055),("1983-09-16",0.1029),("1983-09-19",0.1121),("1983-09-20",0.1125),("1983-09-21",0.1103),("1983-09-22",0.1138),("1983-09-26",0.0871),("1983-09-27",0.0823),("1983-09-28",0.0801),("1983-09-29",0.0797),("1983-09-30",0.081),("1983-10-03",0.081),("1983-10-04",0.0801),("1983-10-05",0.0788),("1983-10-06",0.0779),("1983-10-07",0.0714),("1983-10-10",0.0692),("1983-10-11",0.0678),("1983-10-12",0.074),("1983-10-13",0.0806),("1983-10-14",0.0797),("1983-10-17",0.0736),("1983-10-18",0.0678),("1983-10-19",0.0753),("1983-10-20",0.0714),("1983-10-21",0.0696),("1983-10-24",0.074),("1983-10-25",0.0744),("1983-10-26",0.0705),("1983-10-27",0.074),("1983-10-28",0.0731),("1983-10-31",0.0793),("1983-11-01",0.0806),("1983-11-02",0.0823),("1983-11-03",0.0766),("1983-11-04",0.074),("1983-11-07",0.0736),("1983-11-08",0.0626),("1983-11-09",0.0674),("1983-11-10",0.0688),("1983-11-11",0.0701),("1983-11-14",0.0692),("1983-11-15",0.0692),("1983-11-16",0.0701),("1983-11-17",0.0718),("1983-11-18",0.0722),("1983-11-21",0.0753),("1983-11-22",0.0753),("1983-11-23",0.0714),("1983-11-25",0.0718),("1983-11-28",0.0736),("1983-11-29",0.0727),("1983-11-30",0.0714),("1983-12-01",0.0709),("1983-12-02",0.0696),("1983-12-05",0.0714),("1983-12-06",0.0718),("1983-12-07",0.0736),("1983-12-08",0.0753),("1983-12-09",0.0757),("1983-12-12",0.0753),("1983-12-13",0.0788),("1983-12-14",0.0819),("1983-12-15",0.0854),("1983-12-16",0.0867),("1983-12-19",0.0841),("1983-12-20",0.0819),("1983-12-21",0.0849),("1983-12-22",0.0867),("1983-12-23",0.0862),("1983-12-27",0.0867),("1983-12-28",0.0876),("1983-12-29",0.0854),("1983-12-30",0.0854),("1984-01-03",0.0898),("1984-01-04",0.0977),("1984-01-05",0.099),("1984-01-06",0.0972),("1984-01-09",0.0919),("1984-01-10",0.0967),("1984-01-11",0.0981),("1984-01-12",0.0977),("1984-01-13",0.0954),("1984-01-16",0.0977),("1984-01-17",0.1002),("1984-01-18",0.1007),("1984-01-19",0.1016),("1984-01-20",0.1002),("1984-01-23",0.1011),("1984-01-24",0.0954),("1984-01-25",0.0946),("1984-01-26",0.0967),("1984-01-27",0.0915),("1984-01-30",0.0867),("1984-01-31",0.0867),("1984-02-01",0.0862),("1984-02-02",0.0871),("1984-02-03",0.0858),("1984-02-06",0.0814),("1984-02-07",0.0845),("1984-02-08",0.0814),("1984-02-09",0.0828),("1984-02-10",0.0854),("1984-02-13",0.0849),("1984-02-14",0.0898),("1984-02-15",0.088),("1984-02-16",0.0889),("1984-02-17",0.0876),("1984-02-21",0.0915),("1984-02-22",0.0959),("1984-02-23",0.0941),("1984-02-24",0.095),("1984-02-27",0.0946),("1984-02-28",0.0893),("1984-02-29",0.0919),("1984-03-01",0.0946),("1984-03-02",0.0954),("1984-03-05",0.0937),("1984-03-06",0.0902),("1984-03-07",0.0928),("1984-03-08",0.0941),("1984-03-09",0.0924),("1984-03-12",0.0959),("1984-03-13",0.0946),("1984-03-14",0.0933),("1984-03-15",0.0937),("1984-03-16",0.0933),("1984-03-19",0.0919),("1984-03-20",0.0911),("1984-03-21",0.0911),("1984-03-22",0.0893),("1984-03-23",0.0893),("1984-03-26",0.0902),("1984-03-27",0.0876),("1984-03-28",0.0893),("1984-03-29",0.0889),("1984-03-30",0.0867),("1984-04-02",0.0871),("1984-04-03",0.0876),("1984-04-04",0.0858),("1984-04-05",0.0845),("1984-04-06",0.0823),("1984-04-09",0.0823),("1984-04-10",0.0867),("1984-04-11",0.0858),("1984-04-12",0.0902),("1984-04-13",0.0902),("1984-04-16",0.0919),("1984-04-17",0.0963),("1984-04-18",0.0981),("1984-04-19",0.099),("1984-04-23",0.0994),("1984-04-24",0.0977),("1984-04-25",0.0967),("1984-04-26",0.1042),("1984-04-27",0.1055),("1984-04-30",0.1099),("1984-05-01",0.1165),("1984-05-02",0.1156),("1984-05-03",0.1108),("1984-05-04",0.1055),("1984-05-07",0.109),("1984-05-08",0.1151),("1984-05-09",0.116),("1984-05-10",0.116),("1984-05-11",0.113),("1984-05-14",0.1108),("1984-05-15",0.1117),("1984-05-16",0.1068),("1984-05-17",0.102),("1984-05-18",0.1042),("1984-05-21",0.1117),("1984-05-22",0.1082),("1984-05-23",0.106),("1984-05-24",0.1029),("1984-05-25",0.1033),("1984-05-29",0.1029),("1984-05-30",0.1016),("1984-05-31",0.1029),("1984-06-01",0.1064),("1984-06-04",0.1038),("1984-06-05",0.0977),("1984-06-06",0.1016),("1984-06-07",0.1007),("1984-06-08",0.1002),("1984-06-11",0.1002),("1984-06-12",0.102),("1984-06-13",0.1042),("1984-06-14",0.1011),("1984-06-15",0.1016),("1984-06-18",0.1038),("1984-06-19",0.1029),("1984-06-20",0.106),("1984-06-21",0.1016),("1984-06-22",0.1002),("1984-06-25",0.0954),("1984-06-26",0.0911),("1984-06-27",0.0884),("1984-06-28",0.0924),("1984-06-29",0.0928),("1984-07-02",0.0898),("1984-07-03",0.0884),("1984-07-05",0.0867),("1984-07-06",0.088),("1984-07-09",0.0919),("1984-07-10",0.0941),("1984-07-11",0.0928),("1984-07-12",0.0933),("1984-07-13",0.0924),("1984-07-16",0.0902),("1984-07-17",0.0902),("1984-07-18",0.0889),("1984-07-19",0.0889),("1984-07-20",0.0889),("1984-07-23",0.088),("1984-07-24",0.0933),("1984-07-25",0.0937),("1984-07-26",0.0954),("1984-07-27",0.095),("1984-07-30",0.0893),("1984-07-31",0.0893),("1984-08-01",0.0876),("1984-08-02",0.0845),("1984-08-03",0.0959),("1984-08-06",0.1025),("1984-08-07",0.1038),("1984-08-08",0.0998),("1984-08-09",0.1042),("1984-08-10",0.0998),("1984-08-13",0.1051),("1984-08-14",0.1011),("1984-08-15",0.0977),("1984-08-16",0.0985),("1984-08-17",0.0963),("1984-08-20",0.0959),("1984-08-21",0.0998),("1984-08-22",0.0981),("1984-08-23",0.0985),("1984-08-24",0.0985),("1984-08-27",0.0977),("1984-08-28",0.099),("1984-08-29",0.0963),("1984-08-30",0.0946),("1984-08-31",0.0928),("1984-09-04",0.0919),("1984-09-05",0.0919),("1984-09-06",0.0928),("1984-09-07",0.0928),("1984-09-10",0.0924),("1984-09-11",0.0941),("1984-09-12",0.0915),("1984-09-13",0.0963),("1984-09-14",0.0976),("1984-09-17",0.1002),("1984-09-18",0.0967),("1984-09-19",0.0946),("1984-09-20",0.095),("1984-09-21",0.0941),("1984-09-24",0.0932),("1984-09-25",0.0915),("1984-09-26",0.0902),("1984-09-27",0.0902),("1984-09-28",0.088),("1984-10-01",0.0858),("1984-10-02",0.0867),("1984-10-03",0.088),("1984-10-04",0.0889),("1984-10-05",0.0871),("1984-10-08",0.0871),("1984-10-09",0.0862),("1984-10-10",0.0836),("1984-10-11",0.0832),("1984-10-12",0.0797),("1984-10-15",0.0841),("1984-10-16",0.0836),("1984-10-17",0.0871),("1984-10-18",0.0897),("1984-10-19",0.0897),("1984-10-22",0.0889),("1984-10-23",0.0911),("1984-10-24",0.0919),("1984-10-25",0.0884),("1984-10-26",0.0862),("1984-10-29",0.0867),("1984-10-30",0.0876),("1984-10-31",0.0871),("1984-11-01",0.0876),("1984-11-02",0.0871),("1984-11-05",0.0867),("1984-11-06",0.0919),("1984-11-07",0.0902),("1984-11-08",0.0867),("1984-11-09",0.0814),("1984-11-12",0.0845),("1984-11-13",0.0823),("1984-11-14",0.0832),("1984-11-15",0.0832),("1984-11-16",0.0814),("1984-11-19",0.0766),("1984-11-20",0.0792),("1984-11-21",0.081),("1984-11-23",0.0832),("1984-11-26",0.0841),("1984-11-27",0.0862),("1984-11-28",0.0906),("1984-11-29",0.0889),("1984-11-30",0.0867),("1984-12-03",0.0854),("1984-12-04",0.0871),("1984-12-05",0.0915),("1984-12-06",0.0959),("1984-12-07",0.0954),("1984-12-10",0.0937),("1984-12-11",0.0924),("1984-12-12",0.0893),("1984-12-13",0.0902),("1984-12-14",0.0924),("1984-12-17",0.0946),("1984-12-18",0.1002),("1984-12-19",0.0963),("1984-12-20",0.0959),("1984-12-21",0.0946),("1984-12-24",0.0963),("1984-12-26",0.0967),("1984-12-27",0.0972),("1984-12-28",0.1007),("1984-12-31",0.102),("1985-01-02",0.0976),("1985-01-03",0.0994),("1985-01-04",0.0994),("1985-01-07",0.099),("1985-01-08",0.0981),("1985-01-09",0.1007),("1985-01-10",0.1051),("1985-01-11",0.1042),("1985-01-14",0.1073),("1985-01-15",0.1051),("1985-01-16",0.106),("1985-01-17",0.0985),("1985-01-18",0.1002),("1985-01-21",0.1025),("1985-01-22",0.1055),("1985-01-23",0.1038),("1985-01-24",0.1016),("1985-01-25",0.1038),("1985-01-28",0.106),("1985-01-29",0.1046),("1985-01-30",0.1046),("1985-01-31",0.1016),("1985-02-01",0.1002),("1985-02-04",0.1025),("1985-02-05",0.1033),("1985-02-06",0.1051),("1985-02-07",0.1046),("1985-02-08",0.1046),("1985-02-11",0.1068),("1985-02-12",0.1042),("1985-02-13",0.0994),("1985-02-14",0.0967),("1985-02-15",0.0981),("1985-02-19",0.0967),("1985-02-20",0.0924),("1985-02-21",0.0941),("1985-02-22",0.0967),("1985-02-25",0.0954),("1985-02-26",0.0937),("1985-02-27",0.088),("1985-02-28",0.0867),("1985-03-01",0.0871),("1985-03-04",0.0884),("1985-03-05",0.0906),("1985-03-06",0.0862),("1985-03-07",0.0775),("1985-03-08",0.0753),("1985-03-11",0.0779),("1985-03-12",0.0806),("1985-03-13",0.0762),("1985-03-14",0.0762),("1985-03-15",0.0792),("1985-03-18",0.0801),("1985-03-19",0.0771),("1985-03-20",0.0779),("1985-03-21",0.0792),("1985-03-22",0.0779),("1985-03-25",0.0757),("1985-03-26",0.0788),("1985-03-27",0.0766),("1985-03-28",0.0766),("1985-03-29",0.0775),("1985-04-01",0.0757),("1985-04-02",0.0736),("1985-04-03",0.0736),("1985-04-04",0.0731),("1985-04-08",0.0687),("1985-04-09",0.0687),("1985-04-10",0.0736),("1985-04-11",0.0749),("1985-04-12",0.0731),("1985-04-15",0.0749),("1985-04-16",0.0757),("1985-04-17",0.0792),("1985-04-18",0.0801),("1985-04-19",0.0788),("1985-04-22",0.0757),("1985-04-23",0.0775),("1985-04-24",0.0771),("1985-04-25",0.0771),("1985-04-26",0.0766),("1985-04-29",0.074),("1985-04-30",0.0744),("1985-05-01",0.0731),("1985-05-02",0.0674),("1985-05-03",0.0701),("1985-05-06",0.0692),("1985-05-07",0.0701),("1985-05-08",0.0696),("1985-05-09",0.0701),("1985-05-10",0.0709),("1985-05-13",0.0701),("1985-05-14",0.0692),("1985-05-15",0.0701),("1985-05-16",0.0749),("1985-05-17",0.0762),("1985-05-20",0.0749),("1985-05-21",0.0727),("1985-05-22",0.0722),("1985-05-23",0.0692),("1985-05-24",0.0635),("1985-05-28",0.0591),("1985-05-29",0.06),("1985-05-30",0.0617),("1985-05-31",0.0608),("1985-06-03",0.056),("1985-06-04",0.0604),("1985-06-05",0.0591),("1985-06-06",0.0595),("1985-06-07",0.0573),("1985-06-10",0.0565),("1985-06-11",0.0565),("1985-06-12",0.0552),("1985-06-13",0.0521),("1985-06-14",0.0517),("1985-06-17",0.0521),("1985-06-18",0.0534),("1985-06-19",0.0547),("1985-06-20",0.0552),("1985-06-21",0.0565),("1985-06-24",0.0604),("1985-06-25",0.0613),("1985-06-26",0.0635),("1985-06-27",0.0643),("1985-06-28",0.063),("1985-07-01",0.0635),("1985-07-02",0.0604),("1985-07-03",0.0613),("1985-07-05",0.0617),("1985-07-08",0.0617),("1985-07-09",0.0617),("1985-07-10",0.063),("1985-07-11",0.063),("1985-07-12",0.0626),("1985-07-15",0.0622),("1985-07-16",0.0613),("1985-07-17",0.0617),("1985-07-18",0.0604),("1985-07-19",0.0608),("1985-07-22",0.0591),("1985-07-23",0.0578),("1985-07-24",0.0569),("1985-07-25",0.0582),("1985-07-26",0.0582),("1985-07-29",0.056),("1985-07-30",0.0569),("1985-07-31",0.0556),("1985-08-01",0.0556),("1985-08-02",0.0552),("1985-08-05",0.0539),("1985-08-06",0.0534),("1985-08-07",0.0521),("1985-08-08",0.053),("1985-08-09",0.0534),("1985-08-12",0.0525),("1985-08-13",0.0534),("1985-08-14",0.0512),("1985-08-15",0.0508),("1985-08-16",0.0512),("1985-08-19",0.0525),("1985-08-20",0.0534),("1985-08-21",0.0534),("1985-08-22",0.0521),("1985-08-23",0.0517),("1985-08-26",0.053),("1985-08-27",0.0534),("1985-08-28",0.0534),("1985-08-29",0.0521),("1985-08-30",0.0525),("1985-09-03",0.0517),("1985-09-04",0.0521),("1985-09-05",0.0521),("1985-09-06",0.0525),("1985-09-09",0.0534),("1985-09-10",0.0539),("1985-09-11",0.0543),("1985-09-12",0.0565),("1985-09-13",0.0552),("1985-09-16",0.0534),("1985-09-17",0.0534),("1985-09-18",0.0569),("1985-09-19",0.0595),("1985-09-20",0.0587),("1985-09-23",0.0591),("1985-09-24",0.0578),("1985-09-25",0.0556),("1985-09-26",0.0556),("1985-09-27",0.0556),("1985-09-30",0.0552),("1985-10-01",0.0552),("1985-10-02",0.0547),("1985-10-03",0.0543),("1985-10-04",0.0525),("1985-10-07",0.0525),("1985-10-08",0.053),("1985-10-09",0.0525),("1985-10-10",0.0556),("1985-10-11",0.056),("1985-10-14",0.0582),("1985-10-15",0.0595),("1985-10-16",0.063),("1985-10-17",0.0639),("1985-10-18",0.0622),("1985-10-21",0.0604),("1985-10-22",0.063),("1985-10-23",0.063),("1985-10-24",0.0643),("1985-10-25",0.063),("1985-10-28",0.063),("1985-10-29",0.0626),("1985-10-30",0.0666),("1985-10-31",0.0652),("1985-11-01",0.0652),("1985-11-04",0.0657),("1985-11-05",0.0652),("1985-11-06",0.0674),("1985-11-07",0.0687),("1985-11-08",0.0718),("1985-11-11",0.0701),("1985-11-12",0.0696),("1985-11-13",0.0678),("1985-11-14",0.0701),("1985-11-15",0.0696),("1985-11-18",0.0696),("1985-11-19",0.0674),("1985-11-20",0.0666),("1985-11-21",0.0666),("1985-11-22",0.0666),("1985-11-25",0.067),("1985-11-26",0.0678),("1985-11-27",0.0701),("1985-11-29",0.0705),("1985-12-02",0.0709),("1985-12-03",0.0705),("1985-12-04",0.0718),("1985-12-05",0.0705),("1985-12-06",0.0692),("1985-12-09",0.0678),("1985-12-10",0.0683),("1985-12-11",0.0692),("1985-12-12",0.0701),("1985-12-13",0.0701),("1985-12-16",0.0731),("1985-12-17",0.0722),("1985-12-18",0.0779),("1985-12-19",0.0788),("1985-12-20",0.0784),("1985-12-23",0.0766),("1985-12-24",0.0762),("1985-12-26",0.0762),("1985-12-27",0.0784),("1985-12-30",0.0779),("1985-12-31",0.0771),("1986-01-02",0.0779),("1986-01-03",0.0784),("1986-01-06",0.0779),("1986-01-07",0.0806),("1986-01-08",0.0801),("1986-01-09",0.0792),("1986-01-10",0.0797),("1986-01-13",0.0806),("1986-01-14",0.0814),("1986-01-15",0.0836),("1986-01-16",0.0858),("1986-01-17",0.0841),("1986-01-20",0.0836),("1986-01-21",0.0841),("1986-01-22",0.0819),("1986-01-23",0.0806),("1986-01-24",0.0792),("1986-01-27",0.0775),("1986-01-28",0.0779),("1986-01-29",0.0827),("1986-01-30",0.0806),("1986-01-31",0.081),("1986-02-03",0.0836),("1986-02-04",0.0832),("1986-02-05",0.0832),("1986-02-06",0.0845),("1986-02-07",0.0841),("1986-02-10",0.0836),("1986-02-11",0.0836),("1986-02-12",0.0841),("1986-02-13",0.0836),("1986-02-14",0.0832),("1986-02-18",0.0836),("1986-02-19",0.0876),("1986-02-20",0.088),("1986-02-21",0.0884),("1986-02-24",0.0902),("1986-02-25",0.0924),("1986-02-26",0.0911),("1986-02-27",0.0897),("1986-02-28",0.0876),("1986-03-03",0.0862),("1986-03-04",0.0862),("1986-03-05",0.0884),("1986-03-06",0.0889),("1986-03-07",0.0867),("1986-03-10",0.0862),("1986-03-11",0.0871),("1986-03-12",0.0867),("1986-03-13",0.0867),("1986-03-14",0.0915),("1986-03-17",0.0911),("1986-03-18",0.0941),("1986-03-19",0.0928),("1986-03-20",0.099),("1986-03-21",0.0967),("1986-03-24",0.0937),("1986-03-25",0.0976),("1986-03-26",0.099),("1986-03-27",0.099),("1986-03-31",0.099),("1986-04-01",0.0954),("1986-04-02",0.0954),("1986-04-03",0.0946),("1986-04-04",0.0937),("1986-04-07",0.0954),("1986-04-08",0.0967),("1986-04-09",0.095),("1986-04-10",0.0954),("1986-04-11",0.0946),("1986-04-14",0.0941),("1986-04-15",0.0959),("1986-04-16",0.099),("1986-04-17",0.1016),("1986-04-18",0.1042),("1986-04-21",0.1064),("1986-04-22",0.1046),("1986-04-23",0.1038),("1986-04-24",0.1099),("1986-04-25",0.113),("1986-04-28",0.1121),("1986-04-29",0.1095),("1986-04-30",0.106),("1986-05-01",0.106),("1986-05-02",0.1068),("1986-05-05",0.1125),("1986-05-06",0.1143),("1986-05-07",0.1103),("1986-05-08",0.1156),("1986-05-09",0.1169),("1986-05-12",0.1274),("1986-05-13",0.1261),("1986-05-14",0.1292),("1986-05-15",0.1261),("1986-05-16",0.1261),("1986-05-19",0.1248),("1986-05-20",0.1239),("1986-05-21",0.1296),("1986-05-22",0.1287),("1986-05-23",0.1296),("1986-05-27",0.1292),("1986-05-28",0.1305),("1986-05-29",0.1296),("1986-05-30",0.1296),("1986-06-02",0.1301),("1986-06-03",0.1327),("1986-06-04",0.1357),("1986-06-05",0.1362),("1986-06-06",0.1322),("1986-06-09",0.1261),("1986-06-10",0.1261),("1986-06-11",0.1266),("1986-06-12",0.1261),("1986-06-13",0.1274),("1986-06-16",0.1257),("1986-06-17",0.12),("1986-06-18",0.12),("1986-06-19",0.1226),("1986-06-20",0.1261),("1986-06-23",0.1217),("1986-06-24",0.1222),("1986-06-25",0.1257),("1986-06-26",0.127),("1986-06-27",0.1257),("1986-06-30",0.1257),("1986-07-01",0.1239),("1986-07-02",0.1266),("1986-07-03",0.1318),("1986-07-07",0.1248),("1986-07-08",0.12),("1986-07-09",0.1213),("1986-07-10",0.1239),("1986-07-11",0.1301),("1986-07-14",0.127),("1986-07-15",0.1222),("1986-07-16",0.1173),("1986-07-17",0.113),("1986-07-18",0.1112),("1986-07-21",0.1173),("1986-07-22",0.1213),("1986-07-23",0.1195),("1986-07-24",0.116),("1986-07-25",0.1191),("1986-07-28",0.1134),("1986-07-29",0.1095),("1986-07-30",0.1068),("1986-07-31",0.1095),("1986-08-01",0.1099),("1986-08-04",0.1103),("1986-08-05",0.1125),("1986-08-06",0.109),("1986-08-07",0.1112),("1986-08-08",0.1108),("1986-08-11",0.1173),("1986-08-12",0.12),("1986-08-13",0.1261),("1986-08-14",0.1261),("1986-08-15",0.1252),("1986-08-18",0.1239),("1986-08-19",0.1239),("1986-08-20",0.127),("1986-08-21",0.1252),("1986-08-22",0.127),("1986-08-25",0.1274),("1986-08-26",0.1283),("1986-08-27",0.1296),("1986-08-28",0.1322),("1986-08-29",0.1296),("1986-09-02",0.1217),("1986-09-03",0.1217),("1986-09-04",0.1243),("1986-09-05",0.1231),("1986-09-08",0.1217),("1986-09-09",0.1252),("1986-09-10",0.1226),("1986-09-11",0.1143),("1986-09-12",0.1112),("1986-09-15",0.116),("1986-09-16",0.1222),("1986-09-17",0.12),("1986-09-18",0.1191),("1986-09-19",0.1178),("1986-09-22",0.1235),("1986-09-23",0.1266),("1986-09-24",0.1231),("1986-09-25",0.1208),("1986-09-26",0.12),("1986-09-29",0.1138),("1986-09-30",0.1173),("1986-10-01",0.1195),("1986-10-02",0.1195),("1986-10-03",0.1182),("1986-10-06",0.1195),("1986-10-07",0.1156),("1986-10-08",0.1147),("1986-10-09",0.1156),("1986-10-10",0.1165),("1986-10-13",0.1213),("1986-10-14",0.1191),("1986-10-15",0.1169),("1986-10-16",0.1178),("1986-10-17",0.1178),("1986-10-20",0.1152),("1986-10-21",0.1147),("1986-10-22",0.1138),("1986-10-23",0.116),("1986-10-24",0.1156),("1986-10-27",0.1191),("1986-10-28",0.1169),("1986-10-29",0.1169),("1986-10-30",0.12),("1986-10-31",0.1213),("1986-11-03",0.1226),("1986-11-04",0.1252),("1986-11-05",0.1296),("1986-11-06",0.1266),("1986-11-07",0.1252),("1986-11-10",0.1239),("1986-11-11",0.1243),("1986-11-12",0.1283),("1986-11-13",0.1243),("1986-11-14",0.1235),("1986-11-17",0.1274),("1986-11-18",0.1239),("1986-11-19",0.1226),("1986-11-20",0.1235),("1986-11-21",0.1261),("1986-11-24",0.1331),("1986-11-25",0.141),("1986-11-26",0.1419),("1986-11-28",0.1401),("1986-12-01",0.1406),("1986-12-02",0.1454),("1986-12-03",0.1497),("1986-12-04",0.1489),("1986-12-05",0.1532),("1986-12-08",0.1489),("1986-12-09",0.1484),("1986-12-10",0.1524),("1986-12-11",0.1502),("1986-12-12",0.1445),("1986-12-15",0.1462),("1986-12-16",0.1489),("1986-12-17",0.1445),("1986-12-18",0.1449),("1986-12-19",0.1476),("1986-12-22",0.1476),("1986-12-23",0.1476),("1986-12-24",0.1467),("1986-12-26",0.1436),("1986-12-29",0.1419),("1986-12-30",0.1436),("1986-12-31",0.1419),("1987-01-02",0.1432),("1987-01-05",0.1506),("1987-01-06",0.1532),("1987-01-07",0.1567),("1987-01-08",0.1567),("1987-01-09",0.159),("1987-01-12",0.1594),("1987-01-13",0.1563),("1987-01-14",0.1686),("1987-01-15",0.1747),("1987-01-16",0.1708),("1987-01-19",0.1861),("1987-01-20",0.1808),("1987-01-21",0.1716),("1987-01-22",0.1839),("1987-01-23",0.176),("1987-01-26",0.1743),("1987-01-27",0.1848),("1987-01-28",0.194),("1987-01-29",0.1896),("1987-01-30",0.1944),("1987-02-02",0.1957),("1987-02-03",0.1944),("1987-02-04",0.1926),("1987-02-05",0.1887),("1987-02-06",0.1891),("1987-02-09",0.1843),("1987-02-10",0.1848),("1987-02-11",0.1979),("1987-02-12",0.2054),("1987-02-13",0.2176),("1987-02-17",0.2325),("1987-02-18",0.2224),("1987-02-19",0.2185),("1987-02-20",0.2145),("1987-02-23",0.2211),("1987-02-24",0.2294),("1987-02-25",0.2421),("1987-02-26",0.2421),("1987-02-27",0.2452),("1987-03-02",0.2364),("1987-03-03",0.2277),("1987-03-04",0.2369),("1987-03-05",0.2399),("1987-03-06",0.2356),("1987-03-09",0.2263),("1987-03-10",0.2338),("1987-03-11",0.2321),("1987-03-12",0.2286),("1987-03-13",0.2224),("1987-03-16",0.2286),("1987-03-17",0.2347),("1987-03-18",0.2312),("1987-03-19",0.2395),("1987-03-20",0.2391),("1987-03-23",0.2364),("1987-03-24",0.2321),("1987-03-25",0.2338),("1987-03-26",0.2356),("1987-03-27",0.2277),("1987-03-30",0.2189),("1987-03-31",0.2259),("1987-04-01",0.2338),("1987-04-02",0.2513),("1987-04-03",0.2513),("1987-04-06",0.2452),("1987-04-07",0.2373),("1987-04-08",0.2417),("1987-04-09",0.2487),("1987-04-10",0.2461),("1987-04-13",0.2364),("1987-04-14",0.2382),("1987-04-15",0.2487),("1987-04-16",0.2504),("1987-04-20",0.2491),("1987-04-21",0.2618),("1987-04-22",0.2601),("1987-04-23",0.2662),("1987-04-24",0.2618),("1987-04-27",0.2627),("1987-04-28",0.2697),("1987-04-29",0.2723),("1987-04-30",0.2776),("1987-05-01",0.2802),("1987-05-04",0.2793),("1987-05-05",0.2811),("1987-05-06",0.2802),("1987-05-07",0.2811),("1987-05-08",0.2767),("1987-05-11",0.2697),("1987-05-12",0.2645),("1987-05-13",0.275),("1987-05-14",0.2776),("1987-05-15",0.2741),("1987-05-18",0.2653),("1987-05-19",0.2566),("1987-05-20",0.261),("1987-05-21",0.261),("1987-05-22",0.2596),("1987-05-26",0.2732),("1987-05-27",0.2785),("1987-05-28",0.2802),("1987-05-29",0.2767),("1987-06-01",0.2723),("1987-06-02",0.2706),("1987-06-03",0.2723),("1987-06-04",0.275),("1987-06-05",0.2723),("1987-06-08",0.2723),("1987-06-09",0.275),("1987-06-10",0.275),("1987-06-11",0.2767),("1987-06-12",0.2767),("1987-06-15",0.275),("1987-06-16",0.2907),("1987-06-17",0.2837),("1987-06-18",0.2907),("1987-06-19",0.2872),("1987-06-22",0.2942),("1987-06-23",0.289),("1987-06-24",0.2942),("1987-06-25",0.2837),("1987-06-26",0.2837),("1987-06-29",0.2855),("1987-06-30",0.2837),("1987-07-01",0.2802),("1987-07-02",0.2846),("1987-07-06",0.2855),("1987-07-07",0.275),("1987-07-08",0.261),("1987-07-09",0.2645),("1987-07-10",0.2662),("1987-07-13",0.2837),("1987-07-14",0.3012),("1987-07-15",0.3082),("1987-07-16",0.3082),("1987-07-17",0.303),("1987-07-20",0.2925),("1987-07-21",0.2899),("1987-07-22",0.2977),("1987-07-23",0.2925),("1987-07-24",0.2977),("1987-07-27",0.296),("1987-07-28",0.2934),("1987-07-29",0.2872),("1987-07-30",0.2907),("1987-07-31",0.289),("1987-08-03",0.282),("1987-08-04",0.296),("1987-08-05",0.303),("1987-08-06",0.324),("1987-08-07",0.3258),("1987-08-10",0.338),("1987-08-11",0.3468),("1987-08-12",0.3415),("1987-08-13",0.3433),("1987-08-14",0.3433),("1987-08-17",0.3468),("1987-08-18",0.3415),("1987-08-19",0.3503),("1987-08-20",0.3625),("1987-08-21",0.3713),("1987-08-24",0.366),("1987-08-25",0.3643),("1987-08-26",0.3643),("1987-08-27",0.3643),("1987-08-28",0.3643),("1987-08-31",0.3783),("1987-09-01",0.3678),("1987-09-02",0.3643),("1987-09-03",0.359),("1987-09-04",0.3538),("1987-09-08",0.3494),("1987-09-09",0.3695),("1987-09-10",0.3765),("1987-09-11",0.3818),("1987-09-14",0.3713),("1987-09-15",0.3625),("1987-09-16",0.3625),("1987-09-17",0.3643),("1987-09-18",0.3625),("1987-09-21",0.352),("1987-09-22",0.3792),("1987-09-23",0.3871),("1987-09-24",0.3958),("1987-09-25",0.4028),("1987-09-28",0.3906),("1987-09-29",0.3818),("1987-09-30",0.3958),("1987-10-01",0.4081),("1987-10-02",0.4098),("1987-10-05",0.4151),("1987-10-06",0.3906),("1987-10-07",0.3888),("1987-10-08",0.38),("1987-10-09",0.3792),("1987-10-12",0.373),("1987-10-13",0.3818),("1987-10-14",0.373),("1987-10-15",0.3643),("1987-10-16",0.338),("1987-10-19",0.2557),("1987-10-20",0.2417),("1987-10-21",0.2837),("1987-10-22",0.2575),("1987-10-23",0.2487),("1987-10-26",0.1962),("1987-10-27",0.2119),("1987-10-28",0.2347),("1987-10-29",0.2767),("1987-10-30",0.2706),("1987-11-02",0.2715),("1987-11-03",0.2539),("1987-11-04",0.2522),("1987-11-05",0.2662),("1987-11-06",0.2645),("1987-11-09",0.261),("1987-11-10",0.2539),("1987-11-11",0.261),("1987-11-12",0.2715),("1987-11-13",0.261),("1987-11-16",0.2575),("1987-11-17",0.2458),("1987-11-18",0.2545),("1987-11-19",0.2422),("1987-11-20",0.2493),("1987-11-23",0.2545),("1987-11-24",0.2598),("1987-11-25",0.2563),("1987-11-27",0.2458),("1987-11-30",0.2317),("1987-12-01",0.2335),("1987-12-02",0.2282),("1987-12-03",0.2142),("1987-12-04",0.2159),("1987-12-07",0.2317),("1987-12-08",0.2422),("1987-12-09",0.2458),("1987-12-10",0.244),("1987-12-11",0.2387),("1987-12-14",0.2615),("1987-12-15",0.2633),("1987-12-16",0.2756),("1987-12-17",0.2756),("1987-12-18",0.2844),("1987-12-21",0.2931),("1987-12-22",0.2914),("1987-12-23",0.2967),("1987-12-24",0.2993),("1987-12-28",0.2826),("1987-12-29",0.2958),("1987-12-30",0.3046),("1987-12-31",0.2949),("1988-01-04",0.3142),("1988-01-05",0.3134),("1988-01-06",0.3072),("1988-01-07",0.3125),("1988-01-08",0.2809),("1988-01-11",0.2984),("1988-01-12",0.2949),("1988-01-13",0.2967),("1988-01-14",0.2967),("1988-01-15",0.3011),("1988-01-18",0.3002),("1988-01-19",0.3002),("1988-01-20",0.2791),("1988-01-21",0.2818),("1988-01-22",0.2756),("1988-01-25",0.287),("1988-01-26",0.2791),("1988-01-27",0.2791),("1988-01-28",0.2896),("1988-01-29",0.2914),("1988-02-01",0.2931),("1988-02-02",0.2896),("1988-02-03",0.2773),("1988-02-04",0.2791),("1988-02-05",0.2712),("1988-02-08",0.2721),("1988-02-09",0.2791),("1988-02-10",0.2879),("1988-02-11",0.2853),("1988-02-12",0.2884),("1988-02-16",0.2902),("1988-02-17",0.2946),("1988-02-18",0.2937),("1988-02-19",0.2937),("1988-02-22",0.3043),("1988-02-23",0.3008),("1988-02-24",0.2972),("1988-02-25",0.2937),("1988-02-26",0.2937),("1988-02-29",0.3025),("1988-03-01",0.3043),("1988-03-02",0.3148),("1988-03-03",0.3271),("1988-03-04",0.3298),("1988-03-07",0.3298),("1988-03-08",0.3254),("1988-03-09",0.3289),("1988-03-10",0.3183),("1988-03-11",0.3219),("1988-03-14",0.3254),("1988-03-15",0.3166),("1988-03-16",0.3245),("1988-03-17",0.3166),("1988-03-18",0.3148),("1988-03-21",0.3087),("1988-03-22",0.3095),("1988-03-23",0.299),("1988-03-24",0.2876),("1988-03-25",0.2823),("1988-03-28",0.292),("1988-03-29",0.2884),("1988-03-30",0.2779),("1988-03-31",0.2814),("1988-04-04",0.2726),("1988-04-05",0.2761),("1988-04-06",0.2937),("1988-04-07",0.2867),("1988-04-08",0.2884),("1988-04-11",0.292),("1988-04-12",0.2937),("1988-04-13",0.2902),("1988-04-14",0.2779),("1988-04-15",0.2779),("1988-04-18",0.2814),("1988-04-19",0.2832),("1988-04-20",0.2796),("1988-04-21",0.2779),("1988-04-22",0.2823),("1988-04-25",0.2876),("1988-04-26",0.292),("1988-04-27",0.2937),("1988-04-28",0.2911),("1988-04-29",0.2884),("1988-05-02",0.2884),("1988-05-03",0.2937),("1988-05-04",0.2955),("1988-05-05",0.2937),("1988-05-06",0.2902),("1988-05-09",0.2867),("1988-05-10",0.2876),("1988-05-11",0.2779),("1988-05-12",0.2796),("1988-05-13",0.2849),("1988-05-16",0.2908),("1988-05-17",0.2855),("1988-05-18",0.2802),("1988-05-19",0.2749),("1988-05-20",0.2731),("1988-05-23",0.2679),("1988-05-24",0.2741),("1988-05-25",0.2714),("1988-05-26",0.2776),("1988-05-27",0.2802),("1988-05-31",0.2925),("1988-06-01",0.2996),("1988-06-02",0.2943),("1988-06-03",0.3031),("1988-06-06",0.3101),("1988-06-07",0.3101),("1988-06-08",0.3172),("1988-06-09",0.3066),("1988-06-10",0.3137),("1988-06-13",0.3172),("1988-06-14",0.319),("1988-06-15",0.3225),("1988-06-16",0.3137),("1988-06-17",0.3154),("1988-06-20",0.3111),("1988-06-21",0.3164),("1988-06-22",0.3216),("1988-06-23",0.3172),("1988-06-24",0.3172),("1988-06-27",0.3137),("1988-06-28",0.326),("1988-06-29",0.3269),("1988-06-30",0.326),("1988-07-01",0.3278),("1988-07-05",0.3331),("1988-07-06",0.3278),("1988-07-07",0.3234),("1988-07-08",0.319),("1988-07-11",0.3181),("1988-07-12",0.3154),("1988-07-13",0.3154),("1988-07-14",0.3172),("1988-07-15",0.3172),("1988-07-18",0.3207),("1988-07-19",0.3154),("1988-07-20",0.3119),("1988-07-21",0.3031),("1988-07-22",0.2996),("1988-07-25",0.3013),("1988-07-26",0.3013),("1988-07-27",0.3013),("1988-07-28",0.3005),("1988-07-29",0.3128),("1988-08-01",0.3172),("1988-08-02",0.3146),("1988-08-03",0.3154),("1988-08-04",0.3146),("1988-08-05",0.3119),("1988-08-08",0.3101),("1988-08-09",0.3066),("1988-08-10",0.2952),("1988-08-11",0.3049),("1988-08-12",0.2996),("1988-08-15",0.2913),("1988-08-16",0.3002),("1988-08-17",0.2966),("1988-08-18",0.3002),("1988-08-19",0.2878),("1988-08-22",0.2807),("1988-08-23",0.279),("1988-08-24",0.2878),("1988-08-25",0.2834),("1988-08-26",0.2843),("1988-08-29",0.2887),("1988-08-30",0.2887),("1988-08-31",0.2817),("1988-09-01",0.2746),("1988-09-02",0.2807),("1988-09-06",0.2746),("1988-09-07",0.2701),("1988-09-08",0.2737),("1988-09-09",0.286),("1988-09-12",0.2896),("1988-09-13",0.2896),("1988-09-14",0.2966),("1988-09-15",0.294),("1988-09-16",0.2984),("1988-09-19",0.2949),("1988-09-20",0.2931),("1988-09-21",0.3019),("1988-09-22",0.3107),("1988-09-23",0.309),("1988-09-26",0.3019),("1988-09-27",0.3064),("1988-09-28",0.3072),("1988-09-29",0.3107),("1988-09-30",0.3055),("1988-10-03",0.3002),("1988-10-04",0.2931),("1988-10-05",0.2887),("1988-10-06",0.2807),("1988-10-07",0.2807),("1988-10-10",0.2719),("1988-10-11",0.2754),("1988-10-12",0.2737),("1988-10-13",0.2754),("1988-10-14",0.2737),("1988-10-17",0.2719),("1988-10-18",0.2781),("1988-10-19",0.2825),("1988-10-20",0.2931),("1988-10-21",0.2896),("1988-10-24",0.2825),("1988-10-25",0.2817),("1988-10-26",0.2772),("1988-10-27",0.2754),("1988-10-28",0.2719),("1988-10-31",0.2728),("1988-11-01",0.2684),("1988-11-02",0.2631),("1988-11-03",0.2622),("1988-11-04",0.2666),("1988-11-07",0.2648),("1988-11-08",0.2719),("1988-11-09",0.2772),("1988-11-10",0.279),("1988-11-11",0.2719),("1988-11-14",0.2746),("1988-11-15",0.2754),("1988-11-16",0.2684),("1988-11-17",0.2701),("1988-11-18",0.2684),("1988-11-21",0.2594),("1988-11-22",0.2559),("1988-11-23",0.2612),("1988-11-25",0.2585),("1988-11-28",0.2585),("1988-11-29",0.2603),("1988-11-30",0.2665),("1988-12-01",0.2744),("1988-12-02",0.278),("1988-12-05",0.2797),("1988-12-06",0.2797),("1988-12-07",0.2789),("1988-12-08",0.2771),("1988-12-09",0.2771),("1988-12-12",0.2726),("1988-12-13",0.2744),("1988-12-14",0.2815),("1988-12-15",0.2797),("1988-12-16",0.2842),("1988-12-19",0.2886),("1988-12-20",0.2904),("1988-12-21",0.2957),("1988-12-22",0.2904),("1988-12-23",0.2913),("1988-12-27",0.2868),("1988-12-28",0.285),("1988-12-29",0.2868),("1988-12-30",0.285),("1989-01-03",0.286),("1989-01-04",0.2974),("1989-01-05",0.2992),("1989-01-06",0.3019),("1989-01-09",0.3045),("1989-01-10",0.3019),("1989-01-11",0.2984),("1989-01-12",0.3027),("1989-01-13",0.3063),("1989-01-16",0.3098),("1989-01-17",0.286),("1989-01-18",0.2815),("1989-01-19",0.2868),("1989-01-20",0.2904),("1989-01-23",0.2904),("1989-01-24",0.2948),("1989-01-25",0.2939),("1989-01-26",0.2957),("1989-01-27",0.2665),("1989-01-30",0.2647),("1989-01-31",0.2673),("1989-02-01",0.278),("1989-02-02",0.2815),("1989-02-03",0.278),("1989-02-06",0.2726),("1989-02-07",0.2762),("1989-02-08",0.2709),("1989-02-09",0.2709),("1989-02-10",0.2638),("1989-02-13",0.262),("1989-02-14",0.2532),("1989-02-15",0.2567),("1989-02-16",0.2576),("1989-02-17",0.261),("1989-02-21",0.2663),("1989-02-22",0.261),("1989-02-23",0.261),("1989-02-24",0.2556),("1989-02-27",0.2592),("1989-02-28",0.2574),("1989-03-01",0.2556),("1989-03-02",0.2485),("1989-03-03",0.2468),("1989-03-06",0.2521),("1989-03-07",0.2539),("1989-03-08",0.2503),("1989-03-09",0.245),("1989-03-10",0.2485),("1989-03-13",0.2485),("1989-03-14",0.2503),("1989-03-15",0.2485),("1989-03-16",0.2503),("1989-03-17",0.2477),("1989-03-20",0.2477),("1989-03-21",0.2477),("1989-03-22",0.2406),("1989-03-23",0.2441),("1989-03-27",0.2397),("1989-03-28",0.2414),("1989-03-29",0.2432),("1989-03-30",0.2468),("1989-03-31",0.253),("1989-04-03",0.2485),("1989-04-04",0.245),("1989-04-05",0.2485),("1989-04-06",0.2556),("1989-04-07",0.2654),("1989-04-10",0.2627),("1989-04-11",0.2681),("1989-04-12",0.2734),("1989-04-13",0.2734),("1989-04-14",0.2752),("1989-04-17",0.2787),("1989-04-18",0.285),("1989-04-19",0.2903),("1989-04-20",0.2894),("1989-04-21",0.285),("1989-04-24",0.285),("1989-04-25",0.284),("1989-04-26",0.2823),("1989-04-27",0.2796),("1989-04-28",0.2769),("1989-05-01",0.2769),("1989-05-02",0.2832),("1989-05-03",0.2858),("1989-05-04",0.2911),("1989-05-05",0.2947),("1989-05-08",0.3),("1989-05-09",0.3018),("1989-05-10",0.3071),("1989-05-11",0.3116),("1989-05-12",0.3195),("1989-05-15",0.3266),("1989-05-16",0.3222),("1989-05-17",0.3213),("1989-05-18",0.3178),("1989-05-19",0.3249),("1989-05-22",0.3274),("1989-05-23",0.3238),("1989-05-24",0.3398),("1989-05-25",0.3434),("1989-05-26",0.3451),("1989-05-30",0.338),("1989-05-31",0.3398),("1989-06-01",0.3469),("1989-06-02",0.3487),("1989-06-05",0.3345),("1989-06-06",0.3327),("1989-06-07",0.3434),("1989-06-08",0.339),("1989-06-09",0.3345),("1989-06-12",0.338),("1989-06-13",0.3451),("1989-06-14",0.3532),("1989-06-15",0.338),("1989-06-16",0.3167),("1989-06-19",0.3131),("1989-06-20",0.306),("1989-06-21",0.3024),("1989-06-22",0.3078),("1989-06-23",0.3123),("1989-06-26",0.3096),("1989-06-27",0.3034),("1989-06-28",0.2971),("1989-06-29",0.2891),("1989-06-30",0.2936),("1989-07-03",0.29),("1989-07-05",0.2882),("1989-07-06",0.2936),("1989-07-07",0.2936),("1989-07-10",0.2882),("1989-07-11",0.2829),("1989-07-12",0.2847),("1989-07-13",0.2891),("1989-07-14",0.29),("1989-07-17",0.29),("1989-07-18",0.2793),("1989-07-19",0.2882),("1989-07-20",0.2847),("1989-07-21",0.2847),("1989-07-24",0.2793),("1989-07-25",0.2758),("1989-07-26",0.2722),("1989-07-27",0.2793),("1989-07-28",0.2802),("1989-07-31",0.2829),("1989-08-01",0.2838),("1989-08-02",0.2882),("1989-08-03",0.2936),("1989-08-04",0.3042),("1989-08-07",0.3113),("1989-08-08",0.314),("1989-08-09",0.3131),("1989-08-10",0.3078),("1989-08-11",0.298),("1989-08-14",0.29),("1989-08-15",0.2945),("1989-08-16",0.2874),("1989-08-17",0.2918),("1989-08-18",0.3007),("1989-08-21",0.3014),("1989-08-22",0.3059),("1989-08-23",0.3121),("1989-08-24",0.3148),("1989-08-25",0.3192),("1989-08-28",0.3192),("1989-08-29",0.3148),("1989-08-30",0.3174),("1989-08-31",0.3174),("1989-09-01",0.3184),("1989-09-05",0.3192),("1989-09-06",0.3192),("1989-09-07",0.3192),("1989-09-08",0.321),("1989-09-11",0.3263),("1989-09-12",0.3281),("1989-09-13",0.321),("1989-09-14",0.3192),("1989-09-15",0.321),("1989-09-18",0.3139),("1989-09-19",0.3085),("1989-09-20",0.3184),("1989-09-21",0.3192),("1989-09-22",0.3201),("1989-09-25",0.3228),("1989-09-26",0.3228),("1989-09-27",0.3192),("1989-09-28",0.3246),("1989-09-29",0.3174),("1989-10-02",0.3166),("1989-10-03",0.3112),("1989-10-04",0.3156),("1989-10-05",0.3246),("1989-10-06",0.3433),("1989-10-09",0.3531),("1989-10-10",0.3531),("1989-10-11",0.3487),("1989-10-12",0.3477),("1989-10-13",0.3263),("1989-10-16",0.3335),("1989-10-17",0.337),("1989-10-18",0.3442),("1989-10-19",0.3477),("1989-10-20",0.3424),("1989-10-23",0.3335),("1989-10-24",0.3398),("1989-10-25",0.3317),("1989-10-26",0.3228),("1989-10-27",0.3228),("1989-10-30",0.3263),("1989-10-31",0.3317),("1989-11-01",0.3291),("1989-11-02",0.3139),("1989-11-03",0.3085),("1989-11-06",0.3085),("1989-11-07",0.3139),("1989-11-08",0.321),("1989-11-09",0.3281),("1989-11-10",0.3335),("1989-11-13",0.3317),("1989-11-14",0.3192),("1989-11-15",0.3156),("1989-11-16",0.3192),("1989-11-17",0.32),("1989-11-20",0.3236),("1989-11-21",0.3236),("1989-11-22",0.32),("1989-11-24",0.32),("1989-11-27",0.3146),("1989-11-28",0.3156),("1989-11-29",0.3146),("1989-11-30",0.3164),("1989-12-01",0.3146),("1989-12-04",0.3236),("1989-12-05",0.3218),("1989-12-06",0.3057),("1989-12-07",0.3057),("1989-12-08",0.2985),("1989-12-11",0.2807),("1989-12-12",0.2574),("1989-12-13",0.2574),("1989-12-14",0.2494),("1989-12-15",0.2413),("1989-12-18",0.2485),("1989-12-19",0.2503),("1989-12-20",0.2556),("1989-12-21",0.2592),("1989-12-22",0.261),("1989-12-26",0.2539),("1989-12-27",0.2512),("1989-12-28",0.2476),("1989-12-29",0.2521),("1990-01-02",0.2664),("1990-01-03",0.2682),("1990-01-04",0.2691),("1990-01-05",0.2699),("1990-01-08",0.2717),("1990-01-09",0.2691),("1990-01-10",0.2574),("1990-01-11",0.2467),("1990-01-12",0.2467),("1990-01-15",0.2449),("1990-01-16",0.2494),("1990-01-17",0.2378),("1990-01-18",0.2315),("1990-01-19",0.2449),("1990-01-22",0.2378),("1990-01-23",0.2413),("1990-01-24",0.2431),("1990-01-25",0.2441),("1990-01-26",0.2342),("1990-01-29",0.2378),("1990-01-30",0.2431),("1990-01-31",0.2431),("1990-02-01",0.2405),("1990-02-02",0.2449),("1990-02-05",0.2503),("1990-02-06",0.2485),("1990-02-07",0.2378),("1990-02-08",0.236),("1990-02-09",0.2449),("1990-02-12",0.2431),("1990-02-13",0.2467),("1990-02-14",0.2449),("1990-02-15",0.2449),("1990-02-16",0.2421),("1990-02-20",0.2403),("1990-02-21",0.2439),("1990-02-22",0.2367),("1990-02-23",0.2385),("1990-02-26",0.2439),("1990-02-27",0.2403),("1990-02-28",0.2439),("1990-03-01",0.2457),("1990-03-02",0.2421),("1990-03-05",0.2475),("1990-03-06",0.2529),("1990-03-07",0.2538),("1990-03-08",0.2636),("1990-03-09",0.2646),("1990-03-12",0.2628),("1990-03-13",0.2646),("1990-03-14",0.2654),("1990-03-15",0.2636),("1990-03-16",0.2888),("1990-03-19",0.304),("1990-03-20",0.2969),("1990-03-21",0.2987),("1990-03-22",0.2923),("1990-03-23",0.3031),("1990-03-26",0.3031),("1990-03-27",0.3013),("1990-03-28",0.2959),("1990-03-29",0.2951),("1990-03-30",0.2888),("1990-04-02",0.2888),("1990-04-03",0.2995),("1990-04-04",0.2959),("1990-04-05",0.2888),("1990-04-06",0.2861),("1990-04-09",0.2951),("1990-04-10",0.2959),("1990-04-11",0.3049),("1990-04-12",0.3103),("1990-04-16",0.3139),("1990-04-17",0.3103),("1990-04-18",0.3103),("1990-04-19",0.2888),("1990-04-20",0.2888),("1990-04-23",0.2852),("1990-04-24",0.278),("1990-04-25",0.278),("1990-04-26",0.2789),("1990-04-27",0.2807),("1990-04-30",0.2825),("1990-05-01",0.2843),("1990-05-02",0.2852),("1990-05-03",0.287),("1990-05-04",0.287),("1990-05-07",0.2977),("1990-05-08",0.2995),("1990-05-09",0.3005),("1990-05-10",0.2969),("1990-05-11",0.3058),("1990-05-14",0.2995),("1990-05-15",0.2995),("1990-05-16",0.2987),("1990-05-17",0.2977),("1990-05-18",0.2852),("1990-05-21",0.2842),("1990-05-22",0.2977),("1990-05-23",0.3022),("1990-05-24",0.3022),("1990-05-25",0.2878),("1990-05-29",0.295),("1990-05-30",0.2977),("1990-05-31",0.2968),("1990-06-01",0.2932),("1990-06-04",0.2932),("1990-06-05",0.2842),("1990-06-06",0.2842),("1990-06-07",0.2806),("1990-06-08",0.2752),("1990-06-11",0.2806),("1990-06-12",0.2914),("1990-06-13",0.286),("1990-06-14",0.286),("1990-06-15",0.2842),("1990-06-18",0.2824),("1990-06-19",0.2851),("1990-06-20",0.2878),("1990-06-21",0.3013),("1990-06-22",0.2986),("1990-06-25",0.2968),("1990-06-26",0.2923),("1990-06-27",0.2986),("1990-06-28",0.3093),("1990-06-29",0.3219),("1990-07-02",0.3165),("1990-07-03",0.3165),("1990-07-05",0.3129),("1990-07-06",0.3219),("1990-07-09",0.3355),("1990-07-10",0.3381),("1990-07-11",0.3381),("1990-07-12",0.3409),("1990-07-13",0.3363),("1990-07-16",0.3283),("1990-07-17",0.3183),("1990-07-18",0.3211),("1990-07-19",0.3004),("1990-07-20",0.295),("1990-07-23",0.2986),("1990-07-24",0.3031),("1990-07-25",0.304),("1990-07-26",0.2977),("1990-07-27",0.2977),("1990-07-30",0.3049),("1990-07-31",0.3022),("1990-08-01",0.3049),("1990-08-02",0.3129),("1990-08-03",0.2968),("1990-08-06",0.2842),("1990-08-07",0.2842),("1990-08-08",0.2887),("1990-08-09",0.2842),("1990-08-10",0.2788),("1990-08-13",0.2869),("1990-08-14",0.286),("1990-08-15",0.2824),("1990-08-16",0.277),("1990-08-17",0.2626),("1990-08-20",0.2652),("1990-08-21",0.2616),("1990-08-22",0.2535),("1990-08-23",0.2489),("1990-08-24",0.2562),("1990-08-27",0.2724),("1990-08-28",0.2751),("1990-08-29",0.2688),("1990-08-30",0.2616),("1990-08-31",0.267),("1990-09-04",0.267),("1990-09-05",0.2598),("1990-09-06",0.258),("1990-09-07",0.2625),("1990-09-10",0.258),("1990-09-11",0.2453),("1990-09-12",0.2453),("1990-09-13",0.2435),("1990-09-14",0.2453),("1990-09-17",0.2435),("1990-09-18",0.2409),("1990-09-19",0.2345),("1990-09-20",0.2282),("1990-09-21",0.2273),("1990-09-24",0.2183),("1990-09-25",0.2165),("1990-09-26",0.2147),("1990-09-27",0.2038),("1990-09-28",0.2093),("1990-10-01",0.2201),("1990-10-02",0.2137),("1990-10-03",0.1948),("1990-10-04",0.202),("1990-10-05",0.202),("1990-10-08",0.2101),("1990-10-09",0.202),("1990-10-10",0.1912),("1990-10-11",0.2002),("1990-10-12",0.2038),("1990-10-15",0.2002),("1990-10-16",0.1804),("1990-10-17",0.1912),("1990-10-18",0.2056),("1990-10-19",0.2264),("1990-10-22",0.2246),("1990-10-23",0.2237),("1990-10-24",0.2201),("1990-10-25",0.2165),("1990-10-26",0.2165),("1990-10-29",0.2155),("1990-10-30",0.2191),("1990-10-31",0.2219),("1990-11-01",0.2201),("1990-11-02",0.2291),("1990-11-05",0.2399),("1990-11-06",0.2417),("1990-11-07",0.2399),("1990-11-08",0.2489),("1990-11-09",0.2562),("1990-11-12",0.2616),("1990-11-13",0.2598),("1990-11-14",0.267),("1990-11-15",0.2598),("1990-11-16",0.2544),("1990-11-19",0.2634),("1990-11-20",0.257),("1990-11-21",0.2616),("1990-11-23",0.2634),("1990-11-26",0.2661),("1990-11-27",0.2715),("1990-11-28",0.2661),("1990-11-29",0.2661),("1990-11-30",0.2661),("1990-12-03",0.2761),("1990-12-04",0.2788),("1990-12-05",0.2906),("1990-12-06",0.2987),("1990-12-07",0.3077),("1990-12-10",0.3023),("1990-12-11",0.2896),("1990-12-12",0.2869),("1990-12-13",0.295),("1990-12-14",0.2887),("1990-12-17",0.2906),("1990-12-18",0.3059),("1990-12-19",0.3032),("1990-12-20",0.3186),("1990-12-21",0.3258),("1990-12-24",0.3186),("1990-12-26",0.3168),("1990-12-27",0.315),("1990-12-28",0.3113),("1990-12-31",0.3113),("1991-01-02",0.315),("1991-01-03",0.3113),("1991-01-04",0.3131),("1991-01-07",0.3131),("1991-01-08",0.3131),("1991-01-09",0.3276),("1991-01-10",0.3412),("1991-01-11",0.3403),("1991-01-14",0.3349),("1991-01-15",0.3385),("1991-01-16",0.3602),("1991-01-17",0.3711),("1991-01-18",0.3638),("1991-01-21",0.3674),("1991-01-22",0.3711),("1991-01-23",0.3747),("1991-01-24",0.3774),("1991-01-25",0.3874),("1991-01-28",0.3946),("1991-01-29",0.3892),("1991-01-30",0.4018),("1991-01-31",0.4018),("1991-02-01",0.4036),("1991-02-04",0.4),("1991-02-05",0.4181),("1991-02-06",0.4118),("1991-02-07",0.4181),("1991-02-08",0.4335),("1991-02-11",0.4444),("1991-02-12",0.4344),("1991-02-13",0.4344),("1991-02-14",0.4136),("1991-02-15",0.4181),("1991-02-19",0.4353),("1991-02-20",0.4426),("1991-02-21",0.4281),("1991-02-22",0.4335),("1991-02-25",0.4208),("1991-02-26",0.4226),("1991-02-27",0.4226),("1991-02-28",0.4154),("1991-03-01",0.419),("1991-03-04",0.4236),("1991-03-05",0.458),("1991-03-06",0.4571),("1991-03-07",0.4879),("1991-03-08",0.4716),("1991-03-11",0.4607),("1991-03-12",0.4562),("1991-03-13",0.4807),("1991-03-14",0.4734),("1991-03-15",0.4807),("1991-03-18",0.4916),("1991-03-19",0.5042),("1991-03-20",0.4916),("1991-03-21",0.4698),("1991-03-22",0.4589),("1991-03-25",0.468),("1991-03-26",0.5079),("1991-03-27",0.5024),("1991-03-28",0.4934),("1991-04-01",0.497),("1991-04-02",0.5278),("1991-04-03",0.5079),("1991-04-04",0.5188),("1991-04-05",0.5033),("1991-04-08",0.5079),("1991-04-09",0.4988),("1991-04-10",0.4852),("1991-04-11",0.5151),("1991-04-12",0.5206),("1991-04-15",0.4516),("1991-04-16",0.4662),("1991-04-17",0.4589),("1991-04-18",0.4426),("1991-04-19",0.4326),("1991-04-22",0.4462),("1991-04-23",0.4462),("1991-04-24",0.4408),("1991-04-25",0.4244),("1991-04-26",0.4254),("1991-04-29",0.4226),("1991-04-30",0.399),("1991-05-01",0.3428),("1991-05-02",0.3555),("1991-05-03",0.3555),("1991-05-06",0.3646),("1991-05-07",0.3673),("1991-05-08",0.361),("1991-05-09",0.3682),("1991-05-10",0.3718),("1991-05-13",0.3827),("1991-05-14",0.3882),("1991-05-15",0.3664),("1991-05-16",0.3555),("1991-05-17",0.341),("1991-05-20",0.3219),("1991-05-21",0.3292),("1991-05-22",0.3365),("1991-05-23",0.3283),("1991-05-24",0.3338),("1991-05-28",0.3347),("1991-05-29",0.3419),("1991-05-30",0.3465),("1991-05-31",0.3419),("1991-06-03",0.3583),("1991-06-04",0.3574),("1991-06-05",0.3492),("1991-06-06",0.3392),("1991-06-07",0.3356),("1991-06-10",0.3347),("1991-06-11",0.3247),("1991-06-12",0.3083),("1991-06-13",0.3065),("1991-06-14",0.2992),("1991-06-17",0.3056),("1991-06-18",0.3065),("1991-06-19",0.3037),("1991-06-20",0.3056),("1991-06-21",0.3056),("1991-06-24",0.3037),("1991-06-25",0.3083),("1991-06-26",0.3128),("1991-06-27",0.3092),("1991-06-28",0.3019),("1991-07-01",0.3092),("1991-07-02",0.3074),("1991-07-03",0.3138),("1991-07-05",0.332),("1991-07-08",0.3401),("1991-07-09",0.3411),("1991-07-10",0.3437),("1991-07-11",0.3401),("1991-07-12",0.3401),("1991-07-15",0.331),("1991-07-16",0.3183),("1991-07-17",0.3092),("1991-07-18",0.3265),("1991-07-19",0.3347),("1991-07-22",0.3347),("1991-07-23",0.3274),("1991-07-24",0.3274),("1991-07-25",0.3292),("1991-07-26",0.3265),("1991-07-29",0.331),("1991-07-30",0.3383),("1991-07-31",0.3365),("1991-08-01",0.3574),("1991-08-02",0.3638),("1991-08-05",0.3528),("1991-08-06",0.3601),("1991-08-07",0.3665),("1991-08-08",0.3674),("1991-08-09",0.3692),("1991-08-12",0.3765),("1991-08-13",0.3892),("1991-08-14",0.3993),("1991-08-15",0.3874),("1991-08-16",0.3874),("1991-08-19",0.3683),("1991-08-20",0.3719),("1991-08-21",0.392),("1991-08-22",0.3956),("1991-08-23",0.3865),("1991-08-26",0.3865),("1991-08-27",0.3938),("1991-08-28",0.3883),("1991-08-29",0.3865),("1991-08-30",0.3865),("1991-09-03",0.3828),("1991-09-04",0.3756),("1991-09-05",0.3719),("1991-09-06",0.3756),("1991-09-09",0.3883),("1991-09-10",0.3656),("1991-09-11",0.3683),("1991-09-12",0.3692),("1991-09-13",0.3546),("1991-09-16",0.3446),("1991-09-17",0.3573),("1991-09-18",0.3656),("1991-09-19",0.3628),("1991-09-20",0.3692),("1991-09-23",0.361),("1991-09-24",0.3664),("1991-09-25",0.3683),("1991-09-26",0.3646),("1991-09-27",0.3573),("1991-09-30",0.361),("1991-10-01",0.3701),("1991-10-02",0.3628),("1991-10-03",0.3482),("1991-10-04",0.3519),("1991-10-07",0.351),("1991-10-08",0.3519),("1991-10-09",0.35),("1991-10-10",0.3482),("1991-10-11",0.3537),("1991-10-14",0.3637),("1991-10-15",0.3828),("1991-10-16",0.3901),("1991-10-17",0.382),("1991-10-18",0.4011),("1991-10-21",0.3993),("1991-10-22",0.3974),("1991-10-23",0.3874),("1991-10-24",0.3801),("1991-10-25",0.3737),("1991-10-28",0.3756),("1991-10-29",0.3774),("1991-10-30",0.3628),("1991-10-31",0.3756),("1991-11-01",0.3719),("1991-11-04",0.3628),("1991-11-05",0.3555),("1991-11-06",0.35),("1991-11-07",0.3628),("1991-11-08",0.3883),("1991-11-11",0.392),("1991-11-12",0.3974),("1991-11-13",0.3947),("1991-11-14",0.3993),("1991-11-15",0.3646),("1991-11-18",0.381),("1991-11-19",0.3746),("1991-11-20",0.3691),("1991-11-21",0.3728),("1991-11-22",0.3746),("1991-11-25",0.3746),("1991-11-26",0.3764),("1991-11-27",0.3728),("1991-11-29",0.3709),("1991-12-02",0.3782),("1991-12-03",0.3691),("1991-12-04",0.3691),("1991-12-05",0.3655),("1991-12-06",0.3563),("1991-12-09",0.3591),("1991-12-10",0.3591),("1991-12-11",0.3581),("1991-12-12",0.3609),("1991-12-13",0.3682),("1991-12-16",0.3691),("1991-12-17",0.3691),("1991-12-18",0.3782),("1991-12-19",0.3709),("1991-12-20",0.3673),("1991-12-23",0.3764),("1991-12-24",0.3819),("1991-12-26",0.4011),("1991-12-27",0.402),("1991-12-30",0.4148),("1991-12-31",0.4121),("1992-01-02",0.4349),("1992-01-03",0.4312),("1992-01-06",0.4239),("1992-01-07",0.4322),("1992-01-08",0.4422),("1992-01-09",0.455),("1992-01-10",0.455),("1992-01-13",0.4532),("1992-01-14",0.4714),("1992-01-15",0.4641),("1992-01-16",0.4586),("1992-01-17",0.4733),("1992-01-20",0.4678),("1992-01-21",0.4468),("1992-01-22",0.4641),("1992-01-23",0.4714),("1992-01-24",0.4723),("1992-01-27",0.4714),("1992-01-28",0.4769),("1992-01-29",0.4623),("1992-01-30",0.466),("1992-01-31",0.4733),("1992-02-03",0.4806),("1992-02-04",0.4806),("1992-02-05",0.4833),("1992-02-06",0.4687),("1992-02-07",0.4678),("1992-02-10",0.4614),("1992-02-11",0.4596),("1992-02-12",0.4769),("1992-02-13",0.4696),("1992-02-14",0.4695),("1992-02-18",0.4595),("1992-02-19",0.454),("1992-02-20",0.4732),("1992-02-21",0.476),("1992-02-24",0.4842),("1992-02-25",0.5016),("1992-02-26",0.5116),("1992-02-27",0.5016),("1992-02-28",0.4943),("1992-03-02",0.4925),("1992-03-03",0.486),("1992-03-04",0.476),("1992-03-05",0.465),("1992-03-06",0.4687),("1992-03-09",0.4668),("1992-03-10",0.4668),("1992-03-11",0.4632),("1992-03-12",0.4595),("1992-03-13",0.4623),("1992-03-16",0.4641),("1992-03-17",0.4605),("1992-03-18",0.4668),("1992-03-19",0.4613),("1992-03-20",0.4632),("1992-03-23",0.4613),("1992-03-24",0.476),("1992-03-25",0.4723),("1992-03-26",0.4687),("1992-03-27",0.4467),("1992-03-30",0.4257),("1992-03-31",0.4266),("1992-04-01",0.432),("1992-04-02",0.4302),("1992-04-03",0.432),("1992-04-06",0.4449),("1992-04-07",0.4192),("1992-04-08",0.4092),("1992-04-09",0.4192),("1992-04-10",0.4064),("1992-04-13",0.4137),("1992-04-14",0.4302),("1992-04-15",0.443),("1992-04-16",0.432),("1992-04-20",0.4156),("1992-04-21",0.4119),("1992-04-22",0.422),("1992-04-23",0.4174),("1992-04-24",0.4137),("1992-04-27",0.4082),("1992-04-28",0.3973),("1992-04-29",0.4174),("1992-04-30",0.4403),("1992-05-01",0.4339),("1992-05-04",0.443),("1992-05-05",0.443),("1992-05-06",0.4522),("1992-05-07",0.4449),("1992-05-08",0.454),("1992-05-11",0.4558),("1992-05-12",0.4558),("1992-05-13",0.4595),("1992-05-14",0.4495),("1992-05-15",0.444),("1992-05-18",0.4422),("1992-05-19",0.4348),("1992-05-20",0.4394),("1992-05-21",0.433),("1992-05-22",0.4357),("1992-05-26",0.4339),("1992-05-27",0.4412),("1992-05-28",0.4357),("1992-05-29",0.4375),("1992-06-01",0.4219),("1992-06-02",0.4146),("1992-06-03",0.3972),("1992-06-04",0.3999),("1992-06-05",0.4027),("1992-06-08",0.3981),("1992-06-09",0.3963),("1992-06-10",0.3944),("1992-06-11",0.3954),("1992-06-12",0.4009),("1992-06-15",0.3862),("1992-06-16",0.3614),("1992-06-17",0.3486),("1992-06-18",0.332),("1992-06-19",0.3284),("1992-06-22",0.3247),("1992-06-23",0.332),("1992-06-24",0.3376),("1992-06-25",0.3348),("1992-06-26",0.332),("1992-06-29",0.3431),("1992-06-30",0.3522),("1992-07-01",0.3596),("1992-07-02",0.3394),("1992-07-06",0.3394),("1992-07-07",0.3247),("1992-07-08",0.3357),("1992-07-09",0.3367),("1992-07-10",0.3357),("1992-07-13",0.3449),("1992-07-14",0.3486),("1992-07-15",0.3522),("1992-07-16",0.3577),("1992-07-17",0.3302),("1992-07-20",0.3284),("1992-07-21",0.3357),("1992-07-22",0.3247),("1992-07-23",0.3284),("1992-07-24",0.3367),("1992-07-27",0.332),("1992-07-28",0.3412),("1992-07-29",0.3467),("1992-07-30",0.3467),("1992-07-31",0.3431),("1992-08-03",0.3357),("1992-08-04",0.3339),("1992-08-05",0.3284),("1992-08-06",0.3229),("1992-08-07",0.3183),("1992-08-10",0.3238),("1992-08-11",0.3192),("1992-08-12",0.3238),("1992-08-13",0.3284),("1992-08-14",0.3284),("1992-08-17",0.3293),("1992-08-18",0.3293),("1992-08-19",0.3274),("1992-08-20",0.3293),("1992-08-21",0.3284),("1992-08-24",0.3182),("1992-08-25",0.3265),("1992-08-26",0.3256),("1992-08-27",0.3274),("1992-08-28",0.3311),("1992-08-31",0.3385),("1992-09-01",0.3421),("1992-09-02",0.3569),("1992-09-03",0.3513),("1992-09-04",0.3477),("1992-09-08",0.3513),("1992-09-09",0.3605),("1992-09-10",0.3624),("1992-09-11",0.3505),("1992-09-14",0.3642),("1992-09-15",0.355),("1992-09-16",0.3458),("1992-09-17",0.3385),("1992-09-18",0.3421),("1992-09-21",0.3421),("1992-09-22",0.3366),("1992-09-23",0.3495),("1992-09-24",0.3403),("1992-09-25",0.3348),("1992-09-28",0.3293),("1992-09-29",0.3302),("1992-09-30",0.3321),("1992-10-01",0.3256),("1992-10-02",0.3219),("1992-10-05",0.3201),("1992-10-06",0.3293),("1992-10-07",0.3219),("1992-10-08",0.3201),("1992-10-09",0.3192),("1992-10-12",0.3237),("1992-10-13",0.3339),("1992-10-14",0.3385),("1992-10-15",0.3348),("1992-10-16",0.3605),("1992-10-19",0.3605),("1992-10-20",0.3615),("1992-10-21",0.3569),("1992-10-22",0.3587),("1992-10-23",0.3587),("1992-10-26",0.3789),("1992-10-27",0.3789),("1992-10-28",0.3844),("1992-10-29",0.3918),("1992-10-30",0.3863),("1992-11-02",0.3844),("1992-11-03",0.3826),("1992-11-04",0.3863),("1992-11-05",0.4047),("1992-11-06",0.4102),("1992-11-09",0.4065),("1992-11-10",0.4139),("1992-11-11",0.4176),("1992-11-12",0.4185),("1992-11-13",0.4139),("1992-11-16",0.4222),("1992-11-17",0.4065),("1992-11-18",0.4249),("1992-11-19",0.4286),("1992-11-20",0.4231),("1992-11-23",0.4176),("1992-11-24",0.4231),("1992-11-25",0.4157),("1992-11-27",0.4157),("1992-11-30",0.424),("1992-12-01",0.4295),("1992-12-02",0.4221),("1992-12-03",0.424),("1992-12-04",0.4194),("1992-12-07",0.4258),("1992-12-08",0.4286),("1992-12-09",0.4249),("1992-12-10",0.4221),("1992-12-11",0.424),("1992-12-14",0.4221),("1992-12-15",0.4157),("1992-12-16",0.4055),("1992-12-17",0.4194),("1992-12-18",0.4295),("1992-12-21",0.4397),("1992-12-22",0.447),("1992-12-23",0.4405),("1992-12-24",0.435),("1992-12-28",0.4387),("1992-12-29",0.4397),("1992-12-30",0.4332),("1992-12-31",0.4405),("1993-01-04",0.4295),("1993-01-05",0.4369),("1993-01-06",0.4553),("1993-01-07",0.4498),("1993-01-08",0.459),("1993-01-11",0.4728),("1993-01-12",0.4534),("1993-01-13",0.4682),("1993-01-14",0.4793),("1993-01-15",0.4442),("1993-01-18",0.4387),("1993-01-19",0.4405),("1993-01-20",0.4424),("1993-01-21",0.4424),("1993-01-22",0.4387),("1993-01-25",0.4424),("1993-01-26",0.4479),("1993-01-27",0.4442),("1993-01-28",0.4415),("1993-01-29",0.4387),("1993-02-01",0.4516),("1993-02-02",0.4442),("1993-02-03",0.4424),("1993-02-04",0.4387),("1993-02-05",0.4221),("1993-02-08",0.4166),("1993-02-09",0.4194),("1993-02-10",0.4111),("1993-02-11",0.4065),("1993-02-12",0.3981),("1993-02-16",0.3916),("1993-02-17",0.3981),("1993-02-18",0.4064),("1993-02-19",0.4064),("1993-02-22",0.4074),("1993-02-23",0.4009),("1993-02-24",0.3963),("1993-02-25",0.4046),("1993-02-26",0.3916),("1993-03-01",0.3935),("1993-03-02",0.4009),("1993-03-03",0.4037),("1993-03-04",0.4064),("1993-03-05",0.4064),("1993-03-08",0.4175),("1993-03-09",0.4194),("1993-03-10",0.4194),("1993-03-11",0.4203),("1993-03-12",0.4157),("1993-03-15",0.4212),("1993-03-16",0.4175),("1993-03-17",0.4074),("1993-03-18",0.4027),("1993-03-19",0.3972),("1993-03-22",0.3935),("1993-03-23",0.3898),("1993-03-24",0.3972),("1993-03-25",0.4046),("1993-03-26",0.3935),("1993-03-29",0.3769),("1993-03-30",0.3861),("1993-03-31",0.3806),("1993-04-01",0.3824),("1993-04-02",0.3704),("1993-04-05",0.3695),("1993-04-06",0.3602),("1993-04-07",0.3732),("1993-04-08",0.3676),("1993-04-12",0.3695),("1993-04-13",0.3584),("1993-04-14",0.3602),("1993-04-15",0.3492),("1993-04-16",0.3557),("1993-04-19",0.3584),("1993-04-20",0.3695),("1993-04-21",0.3667),("1993-04-22",0.3695),("1993-04-23",0.3639),("1993-04-26",0.3621),("1993-04-27",0.3713),("1993-04-28",0.3797),("1993-04-29",0.375),("1993-04-30",0.3787),("1993-05-03",0.3834),("1993-05-04",0.3945),("1993-05-05",0.4027),("1993-05-06",0.3972),("1993-05-07",0.4046),("1993-05-10",0.4064),("1993-05-11",0.4027),("1993-05-12",0.3935),("1993-05-13",0.4101),("1993-05-14",0.4101),("1993-05-17",0.412),("1993-05-18",0.4101),("1993-05-19",0.4231),("1993-05-20",0.4341),("1993-05-21",0.4249),("1993-05-24",0.4259),("1993-05-25",0.4166),("1993-05-26",0.4267),("1993-05-27",0.4249),("1993-05-28",0.4194),("1993-06-01",0.4221),("1993-06-02",0.4221),("1993-06-03",0.4175),("1993-06-04",0.4064),("1993-06-07",0.3758),("1993-06-08",0.3666),("1993-06-09",0.3277),("1993-06-10",0.3295),("1993-06-11",0.324),("1993-06-14",0.3305),("1993-06-15",0.311),("1993-06-16",0.3129),("1993-06-17",0.3055),("1993-06-18",0.3036),("1993-06-21",0.2935),("1993-06-22",0.3064),("1993-06-23",0.2999),("1993-06-24",0.3092),("1993-06-25",0.2962),("1993-06-28",0.2972),("1993-06-29",0.2888),("1993-06-30",0.2925),("1993-07-01",0.2814),("1993-07-02",0.2851),("1993-07-06",0.2795),("1993-07-07",0.2703),("1993-07-08",0.2703),("1993-07-09",0.2721),("1993-07-12",0.2814),("1993-07-13",0.2758),("1993-07-14",0.2758),("1993-07-15",0.2647),("1993-07-16",0.2036),("1993-07-19",0.1897),("1993-07-20",0.199),("1993-07-21",0.1944),("1993-07-22",0.1962),("1993-07-23",0.1944),("1993-07-26",0.199),("1993-07-27",0.1962),("1993-07-28",0.199),("1993-07-29",0.2018),("1993-07-30",0.2055),("1993-08-02",0.211),("1993-08-03",0.2148),("1993-08-04",0.224),("1993-08-05",0.2185),("1993-08-06",0.2166),("1993-08-09",0.2203),("1993-08-10",0.211),("1993-08-11",0.2036),("1993-08-12",0.1962),("1993-08-13",0.2027),("1993-08-16",0.2045),("1993-08-17",0.211),("1993-08-18",0.212),("1993-08-19",0.2045),("1993-08-20",0.2083),("1993-08-23",0.211),("1993-08-24",0.2083),("1993-08-25",0.2027),("1993-08-26",0.1998),("1993-08-27",0.1971),("1993-08-30",0.1934),("1993-08-31",0.1971),("1993-09-01",0.1943),("1993-09-02",0.1915),("1993-09-03",0.1915),("1993-09-07",0.1952),("1993-09-08",0.199),("1993-09-09",0.1934),("1993-09-10",0.1952),("1993-09-13",0.1878),("1993-09-14",0.1804),("1993-09-15",0.1822),("1993-09-16",0.1841),("1993-09-17",0.1878),("1993-09-20",0.185),("1993-09-21",0.1822),("1993-09-22",0.1897),("1993-09-23",0.1841),("1993-09-24",0.1859),("1993-09-27",0.1841),("1993-09-28",0.1841),("1993-09-29",0.1775),("1993-09-30",0.1738),("1993-10-01",0.1692),("1993-10-04",0.1692),("1993-10-05",0.1748),("1993-10-06",0.1757),("1993-10-07",0.1711),("1993-10-08",0.1682),("1993-10-11",0.1766),("1993-10-12",0.1785),("1993-10-13",0.1785),("1993-10-14",0.1766),("1993-10-15",0.2101),("1993-10-18",0.211),("1993-10-19",0.2064),("1993-10-20",0.2064),("1993-10-21",0.225),("1993-10-22",0.225),("1993-10-25",0.2231),("1993-10-26",0.2213),("1993-10-27",0.2361),("1993-10-28",0.2306),("1993-10-29",0.2287),("1993-11-01",0.2343),("1993-11-02",0.2436),("1993-11-03",0.2352),("1993-11-04",0.2399),("1993-11-05",0.237),("1993-11-08",0.2287),("1993-11-09",0.224),("1993-11-10",0.2287),("1993-11-11",0.2333),("1993-11-12",0.2361),("1993-11-15",0.238),("1993-11-16",0.2529),("1993-11-17",0.2492),("1993-11-18",0.2492),("1993-11-19",0.2463),("1993-11-22",0.2426),("1993-11-23",0.2463),("1993-11-24",0.2463),("1993-11-26",0.2436),("1993-11-29",0.237),("1993-11-30",0.2351),("1993-12-01",0.2351),("1993-12-02",0.237),("1993-12-03",0.2351),("1993-12-06",0.2407),("1993-12-07",0.2407),("1993-12-08",0.2379),("1993-12-09",0.2239),("1993-12-10",0.2109),("1993-12-13",0.2202),("1993-12-14",0.2174),("1993-12-15",0.2221),("1993-12-16",0.2192),("1993-12-17",0.2202),("1993-12-20",0.2127),("1993-12-21",0.2053),("1993-12-22",0.209),("1993-12-23",0.2034),("1993-12-27",0.2127),("1993-12-28",0.2174),("1993-12-29",0.2127),("1993-12-30",0.2221),("1993-12-31",0.2183),("1994-01-03",0.223),("1994-01-04",0.2351),("1994-01-05",0.2519),("1994-01-06",0.2445),("1994-01-07",0.2473),("1994-01-10",0.251),("1994-01-11",0.2379),("1994-01-12",0.2277),("1994-01-13",0.2286),("1994-01-14",0.2314),("1994-01-17",0.2267),("1994-01-18",0.2192),("1994-01-19",0.2183),("1994-01-20",0.223),("1994-01-21",0.2492),("1994-01-24",0.2613),("1994-01-25",0.2529),("1994-01-26",0.2501),("1994-01-27",0.2548),("1994-01-28",0.2538),("1994-01-31",0.2445),("1994-02-01",0.2482),("1994-02-02",0.2463),("1994-02-03",0.2501),("1994-02-04",0.2501),("1994-02-07",0.2734),("1994-02-08",0.2677),("1994-02-09",0.2715),("1994-02-10",0.2734),("1994-02-11",0.2771),("1994-02-14",0.2771),("1994-02-15",0.2781),("1994-02-16",0.2752),("1994-02-17",0.2771),("1994-02-18",0.2715),("1994-02-22",0.279),("1994-02-23",0.279),("1994-02-24",0.2743),("1994-02-25",0.2696),("1994-02-28",0.2734),("1994-03-01",0.2715),("1994-03-02",0.2668),("1994-03-03",0.2677),("1994-03-04",0.2752),("1994-03-07",0.2837),("1994-03-08",0.2771),("1994-03-09",0.2808),("1994-03-10",0.279),("1994-03-11",0.279),("1994-03-14",0.2856),("1994-03-15",0.2818),("1994-03-16",0.2752),("1994-03-17",0.2734),("1994-03-18",0.2725),("1994-03-21",0.2659),("1994-03-22",0.2621),("1994-03-23",0.2631),("1994-03-24",0.2593),("1994-03-25",0.2453),("1994-03-28",0.249),("1994-03-29",0.2453),("1994-03-30",0.2434),("1994-03-31",0.249),("1994-04-04",0.249),("1994-04-05",0.2509),("1994-04-06",0.2509),("1994-04-07",0.25),("1994-04-08",0.2509),("1994-04-11",0.2509),("1994-04-12",0.2397),("1994-04-13",0.2378),("1994-04-14",0.2359),("1994-04-15",0.2265),("1994-04-18",0.2218),("1994-04-19",0.2172),("1994-04-20",0.2116),("1994-04-21",0.2218),("1994-04-22",0.2228),("1994-04-25",0.2322),("1994-04-26",0.234),("1994-04-28",0.2265),("1994-04-29",0.2247),("1994-05-02",0.2322),("1994-05-03",0.2265),("1994-05-04",0.2471),("1994-05-05",0.2462),("1994-05-06",0.242),("1994-05-09",0.234),("1994-05-10",0.2322),("1994-05-11",0.2265),("1994-05-12",0.2224),("1994-05-13",0.2247),("1994-05-16",0.2209),("1994-05-17",0.22),("1994-05-18",0.2293),("1994-05-19",0.2406),("1994-05-20",0.2326),("1994-05-23",0.2284),("1994-05-24",0.2303),("1994-05-25",0.234),("1994-05-26",0.2284),("1994-05-27",0.2251),("1994-05-31",0.2199),("1994-06-01",0.2124),("1994-06-02",0.2058),("1994-06-03",0.2077),("1994-06-06",0.2058),("1994-06-07",0.2068),("1994-06-08",0.1964),("1994-06-09",0.203),("1994-06-10",0.1993),("1994-06-13",0.203),("1994-06-14",0.2035),("1994-06-15",0.2091),("1994-06-16",0.1983),("1994-06-17",0.1993),("1994-06-20",0.2039),("1994-06-21",0.1955),("1994-06-22",0.1974),("1994-06-23",0.1889),("1994-06-24",0.1926),("1994-06-27",0.1974),("1994-06-28",0.2011),("1994-06-29",0.1964),("1994-06-30",0.1993),("1994-07-01",0.1936),("1994-07-05",0.1993),("1994-07-06",0.1964),("1994-07-07",0.2016),("1994-07-08",0.2035),("1994-07-11",0.203),("1994-07-12",0.2133),("1994-07-13",0.2232),("1994-07-14",0.2152),("1994-07-15",0.2124),("1994-07-18",0.2133),("1994-07-19",0.2082),("1994-07-20",0.2002),("1994-07-21",0.2105),("1994-07-22",0.2331),("1994-07-25",0.2383),("1994-07-26",0.2359),("1994-07-27",0.2335),("1994-07-28",0.2396),("1994-07-29",0.2533),("1994-08-01",0.251),("1994-08-02",0.2448),("1994-08-03",0.2491),("1994-08-04",0.25),("1994-08-05",0.25),("1994-08-08",0.2538),("1994-08-09",0.2529),("1994-08-10",0.2604),("1994-08-11",0.258),("1994-08-12",0.2613),("1994-08-15",0.2613),("1994-08-16",0.2622),("1994-08-17",0.2641),("1994-08-18",0.2613),("1994-08-19",0.2632),("1994-08-22",0.2632),("1994-08-23",0.2641),("1994-08-24",0.2632),("1994-08-25",0.2645),("1994-08-26",0.2697),("1994-08-29",0.2669),("1994-08-30",0.2735),("1994-08-31",0.2731),("1994-09-01",0.2641),("1994-09-02",0.2669),("1994-09-06",0.2683),("1994-09-07",0.2726),("1994-09-08",0.2726),("1994-09-09",0.2697),("1994-09-12",0.2697),("1994-09-13",0.2702),("1994-09-14",0.2651),("1994-09-15",0.2716),("1994-09-16",0.2745),("1994-09-19",0.2679),("1994-09-20",0.2608),("1994-09-21",0.2575),("1994-09-22",0.2556),("1994-09-23",0.2561),("1994-09-26",0.2561),("1994-09-27",0.2556),("1994-09-28",0.2556),("1994-09-29",0.2575),("1994-09-30",0.2542),("1994-10-03",0.25),("1994-10-04",0.2546),("1994-10-05",0.2858),("1994-10-06",0.2735),("1994-10-07",0.2792),("1994-10-10",0.2934),("1994-10-11",0.299),("1994-10-12",0.3179),("1994-10-13",0.3103),("1994-10-14",0.3103),("1994-10-17",0.2999),("1994-10-18",0.3112),("1994-10-19",0.3112),("1994-10-20",0.3094),("1994-10-21",0.3217),("1994-10-24",0.3188),("1994-10-25",0.3217),("1994-10-26",0.3263),("1994-10-27",0.3226),("1994-10-28",0.3179),("1994-10-31",0.3259),("1994-11-01",0.3254),("1994-11-02",0.3122),("1994-11-03",0.3131),("1994-11-04",0.3047),("1994-11-07",0.3075),("1994-11-08",0.3188),("1994-11-09",0.3141),("1994-11-10",0.3117),("1994-11-11",0.3103),("1994-11-14",0.3207),("1994-11-15",0.3122),("1994-11-16",0.3089),("1994-11-17",0.3018),("1994-11-18",0.3027),("1994-11-21",0.2886),("1994-11-22",0.2829),("1994-11-23",0.2791),("1994-11-25",0.2857),("1994-11-28",0.2861),("1994-11-29",0.2895),("1994-11-30",0.2819),("1994-12-01",0.2739),("1994-12-02",0.2767),("1994-12-05",0.2814),("1994-12-06",0.2842),("1994-12-07",0.2772),("1994-12-08",0.2715),("1994-12-09",0.2743),("1994-12-12",0.2762),("1994-12-13",0.2753),("1994-12-14",0.2867),("1994-12-15",0.281),("1994-12-16",0.2819),("1994-12-19",0.2961),("1994-12-20",0.2914),("1994-12-21",0.2905),("1994-12-22",0.2923),("1994-12-23",0.2942),("1994-12-27",0.2961),("1994-12-28",0.2961),("1994-12-29",0.2989),("1994-12-30",0.2951),("1995-01-03",0.2905),("1995-01-04",0.298),("1995-01-05",0.2942),("1995-01-06",0.3178),("1995-01-09",0.3118),("1995-01-10",0.3306),("1995-01-11",0.3538),("1995-01-12",0.3434),("1995-01-13",0.3396),("1995-01-16",0.3368),("1995-01-17",0.3406),("1995-01-18",0.3453),("1995-01-19",0.3472),("1995-01-20",0.3226),("1995-01-23",0.3197),("1995-01-24",0.315),("1995-01-25",0.3101),("1995-01-26",0.2989),("1995-01-27",0.3018),("1995-01-30",0.3037),("1995-01-31",0.3056),("1995-02-01",0.3037),("1995-02-02",0.315),("1995-02-03",0.3065),("1995-02-06",0.3065),("1995-02-07",0.3088),("1995-02-08",0.3202),("1995-02-09",0.3302),("1995-02-10",0.3311),("1995-02-13",0.332),("1995-02-14",0.3259),("1995-02-15",0.323),("1995-02-16",0.3278),("1995-02-17",0.3225),("1995-02-21",0.3111),("1995-02-22",0.3097),("1995-02-23",0.305),("1995-02-24",0.296),("1995-02-27",0.2903),("1995-02-28",0.2997),("1995-03-01",0.3035),("1995-03-02",0.3035),("1995-03-03",0.3054),("1995-03-06",0.3016),("1995-03-07",0.2907),("1995-03-08",0.3002),("1995-03-09",0.3016),("1995-03-10",0.2997),("1995-03-13",0.2894),("1995-03-14",0.2656),("1995-03-15",0.2656),("1995-03-16",0.2675),("1995-03-17",0.2666),("1995-03-20",0.2675),("1995-03-21",0.2751),("1995-03-22",0.2888),("1995-03-23",0.2818),("1995-03-24",0.2865),("1995-03-27",0.2822),("1995-03-28",0.2609),("1995-03-29",0.2609),("1995-03-30",0.2685),("1995-03-31",0.2675),("1995-04-03",0.2694),("1995-04-04",0.2571),("1995-04-05",0.2637),("1995-04-06",0.2789),("1995-04-07",0.2789),("1995-04-10",0.278),("1995-04-11",0.2865),("1995-04-12",0.296),("1995-04-13",0.2903),("1995-04-17",0.2912),("1995-04-18",0.2846),("1995-04-19",0.2761),("1995-04-20",0.2856),("1995-04-21",0.2969),("1995-04-24",0.296),("1995-04-25",0.2865),("1995-04-26",0.2903),("1995-04-27",0.2875),("1995-04-28",0.2903),("1995-05-01",0.2903),("1995-05-02",0.2894),("1995-05-03",0.2894),("1995-05-04",0.2922),("1995-05-05",0.295),("1995-05-08",0.3073),("1995-05-09",0.313),("1995-05-10",0.3145),("1995-05-11",0.3111),("1995-05-12",0.3311),("1995-05-15",0.3311),("1995-05-16",0.332),("1995-05-17",0.3339),("1995-05-18",0.3292),("1995-05-19",0.3244),("1995-05-22",0.3349),("1995-05-23",0.333),("1995-05-24",0.3301),("1995-05-25",0.3292),("1995-05-26",0.3249),("1995-05-30",0.3196),("1995-05-31",0.3163),("1995-06-01",0.3211),("1995-06-02",0.3206),("1995-06-05",0.331),("1995-06-06",0.3348),("1995-06-07",0.3282),("1995-06-08",0.3268),("1995-06-09",0.331),("1995-06-12",0.3361),("1995-06-13",0.3348),("1995-06-14",0.332),("1995-06-15",0.332),("1995-06-16",0.3339),("1995-06-19",0.3377),("1995-06-20",0.3606),("1995-06-21",0.3758),("1995-06-22",0.3739),("1995-06-23",0.371),("1995-06-26",0.3663),("1995-06-27",0.3529),("1995-06-28",0.3548),("1995-06-29",0.3596),("1995-06-30",0.3534),("1995-07-03",0.3572),("1995-07-05",0.3539),("1995-07-06",0.3577),("1995-07-07",0.3701),("1995-07-10",0.3701),("1995-07-11",0.3587),("1995-07-12",0.3577),("1995-07-13",0.3625),("1995-07-14",0.371),("1995-07-17",0.3729),("1995-07-18",0.3663),("1995-07-19",0.3463),("1995-07-20",0.3581),("1995-07-21",0.3329),("1995-07-24",0.3453),("1995-07-25",0.3482),("1995-07-26",0.3453),("1995-07-27",0.3562),("1995-07-28",0.3463),("1995-07-31",0.3424),("1995-08-01",0.331),("1995-08-02",0.3377),("1995-08-03",0.3424),("1995-08-04",0.3367),("1995-08-07",0.3301),("1995-08-08",0.3234),("1995-08-09",0.3282),("1995-08-10",0.3253),("1995-08-11",0.3277),("1995-08-14",0.3301),("1995-08-15",0.3353),("1995-08-16",0.3396),("1995-08-17",0.3405),("1995-08-18",0.3425),("1995-08-21",0.3367),("1995-08-22",0.3415),("1995-08-23",0.3472),("1995-08-24",0.3491),("1995-08-25",0.3415),("1995-08-28",0.3281),("1995-08-29",0.3291),("1995-08-30",0.331),("1995-08-31",0.3281),("1995-09-01",0.3277),("1995-09-05",0.3319),("1995-09-06",0.3338),("1995-09-07",0.3415),("1995-09-08",0.3415),("1995-09-11",0.3376),("1995-09-12",0.3277),("1995-09-13",0.3234),("1995-09-14",0.3052),("1995-09-15",0.2738),("1995-09-18",0.28),("1995-09-19",0.2804),("1995-09-20",0.2795),("1995-09-21",0.2823),("1995-09-22",0.2828),("1995-09-25",0.2863),("1995-09-26",0.2852),("1995-09-27",0.2766),("1995-09-28",0.288),("1995-09-29",0.2842),("1995-10-02",0.2871),("1995-10-03",0.2871),("1995-10-04",0.2776),("1995-10-05",0.2785),("1995-10-06",0.2723),("1995-10-09",0.2656),("1995-10-10",0.2647),("1995-10-11",0.2661),("1995-10-12",0.2694),("1995-10-13",0.2747),("1995-10-16",0.2757),("1995-10-17",0.2795),("1995-10-18",0.2852),("1995-10-19",0.2652),("1995-10-20",0.2681),("1995-10-23",0.2681),("1995-10-24",0.2681),("1995-10-25",0.2652),("1995-10-26",0.2661),("1995-10-27",0.2652),("1995-10-30",0.269),("1995-10-31",0.2771),("1995-11-01",0.2795),("1995-11-02",0.2795),("1995-11-03",0.2785),("1995-11-06",0.2909),("1995-11-07",0.3024),("1995-11-08",0.2967),("1995-11-09",0.3005),("1995-11-10",0.3033),("1995-11-13",0.3119),("1995-11-14",0.3167),("1995-11-15",0.3128),("1995-11-16",0.3048),("1995-11-17",0.3062),("1995-11-20",0.2948),("1995-11-21",0.2957),("1995-11-22",0.2957),("1995-11-24",0.3076),("1995-11-27",0.3014),("1995-11-28",0.3062),("1995-11-29",0.3004),("1995-11-30",0.2919),("1995-12-01",0.288),("1995-12-04",0.3023),("1995-12-05",0.3023),("1995-12-06",0.2966),("1995-12-07",0.2951),("1995-12-08",0.3014),("1995-12-11",0.2957),("1995-12-12",0.2909),("1995-12-13",0.2938),("1995-12-14",0.2928),("1995-12-15",0.2698),("1995-12-18",0.2468),("1995-12-19",0.2507),("1995-12-20",0.2498),("1995-12-21",0.2488),("1995-12-22",0.2468),("1995-12-26",0.2454),("1995-12-27",0.2478),("1995-12-28",0.2449),("1995-12-29",0.2439),("1996-01-02",0.2459),("1996-01-03",0.2459),("1996-01-04",0.2416),("1996-01-05",0.2622),("1996-01-08",0.2651),("1996-01-09",0.2507),("1996-01-10",0.2622),("1996-01-11",0.2679),("1996-01-12",0.2593),("1996-01-15",0.2612),("1996-01-16",0.2645),("1996-01-17",0.2602),("1996-01-18",0.2445),("1996-01-19",0.2286),("1996-01-22",0.2335),("1996-01-23",0.242),("1996-01-24",0.2468),("1996-01-25",0.2315),("1996-01-26",0.2344),("1996-01-29",0.2229),("1996-01-30",0.209),("1996-01-31",0.2114),("1996-02-01",0.2171),("1996-02-02",0.2239),("1996-02-05",0.2239),("1996-02-06",0.2267),("1996-02-07",0.2162),("1996-02-08",0.2133),("1996-02-09",0.2124),("1996-02-12",0.2171),("1996-02-13",0.2152),("1996-02-14",0.2114),("1996-02-15",0.2143),("1996-02-16",0.2105),("1996-02-20",0.222),("1996-02-21",0.2267),("1996-02-22",0.2286),("1996-02-23",0.2286),("1996-02-26",0.2258),("1996-02-27",0.2191),("1996-02-28",0.2124),("1996-02-29",0.2105),("1996-03-01",0.2057),("1996-03-04",0.2009),("1996-03-05",0.2038),("1996-03-06",0.2005),("1996-03-07",0.1976),("1996-03-08",0.199),("1996-03-11",0.198),("1996-03-12",0.1976),("1996-03-13",0.1971),("1996-03-14",0.1961),("1996-03-15",0.198),("1996-03-18",0.1999),("1996-03-19",0.1971),("1996-03-20",0.1933),("1996-03-21",0.1923),("1996-03-22",0.1942),("1996-03-25",0.1837),("1996-03-26",0.1827),("1996-03-27",0.1933),("1996-03-28",0.1852),("1996-03-29",0.188),("1996-04-01",0.1952),("1996-04-02",0.1914),("1996-04-03",0.188),("1996-04-04",0.1846),("1996-04-08",0.1865),("1996-04-09",0.199),("1996-04-10",0.199),("1996-04-11",0.1971),("1996-04-12",0.1952),("1996-04-15",0.1971),("1996-04-16",0.198),("1996-04-17",0.1933),("1996-04-18",0.1894),("1996-04-19",0.1918),("1996-04-22",0.1923),("1996-04-23",0.1894),("1996-04-24",0.1856),("1996-04-25",0.1904),("1996-04-26",0.1894),("1996-04-29",0.1894),("1996-04-30",0.1865),("1996-05-01",0.1865),("1996-05-02",0.1818),("1996-05-03",0.1827),("1996-05-06",0.1961),("1996-05-07",0.2057),("1996-05-08",0.2047),("1996-05-09",0.1999),("1996-05-10",0.2086),("1996-05-13",0.2071),("1996-05-14",0.2105),("1996-05-15",0.2181),("1996-05-16",0.2171),("1996-05-17",0.2114),("1996-05-20",0.2139),("1996-05-21",0.2076),("1996-05-22",0.1995),("1996-05-23",0.2009),("1996-05-24",0.2047),("1996-05-28",0.2018),("1996-05-29",0.1904),("1996-05-30",0.1952),("1996-05-31",0.1999),("1996-06-03",0.1894),("1996-06-04",0.1852),("1996-06-05",0.1923),("1996-06-06",0.1856),("1996-06-07",0.1865),("1996-06-10",0.1846),("1996-06-11",0.1837),("1996-06-12",0.1856),("1996-06-13",0.1884),("1996-06-14",0.1832),("1996-06-17",0.1808),("1996-06-18",0.1741),("1996-06-19",0.177),("1996-06-20",0.1741),("1996-06-21",0.1731),("1996-06-24",0.1703),("1996-06-25",0.1578),("1996-06-26",0.1521),("1996-06-27",0.1578),("1996-06-28",0.1607),("1996-07-01",0.1646),("1996-07-02",0.1607),("1996-07-03",0.1483),("1996-07-05",0.1493),("1996-07-08",0.1463),("1996-07-09",0.1454),("1996-07-10",0.1435),("1996-07-11",0.1368),("1996-07-12",0.1382),("1996-07-15",0.1316),("1996-07-16",0.1291),("1996-07-17",0.1291),("1996-07-18",0.1597),("1996-07-19",0.1588),("1996-07-22",0.155),("1996-07-23",0.1569),("1996-07-24",0.1593),("1996-07-25",0.1607),("1996-07-26",0.1684),("1996-07-29",0.1703),("1996-07-30",0.1636),("1996-07-31",0.1684),("1996-08-01",0.1627),("1996-08-02",0.1655),("1996-08-05",0.1607),("1996-08-06",0.1646),("1996-08-07",0.1712),("1996-08-08",0.1693),("1996-08-09",0.177),("1996-08-12",0.176),("1996-08-13",0.1722),("1996-08-14",0.1741),("1996-08-15",0.1703),("1996-08-16",0.1722),("1996-08-19",0.1808),("1996-08-20",0.1799),("1996-08-21",0.176),("1996-08-22",0.178),("1996-08-23",0.1827),("1996-08-26",0.1846),("1996-08-27",0.1903),("1996-08-28",0.1904),("1996-08-29",0.1875),("1996-08-30",0.1856),("1996-09-03",0.1846),("1996-09-04",0.1846),("1996-09-05",0.175),("1996-09-06",0.176),("1996-09-09",0.1684),("1996-09-10",0.1646),("1996-09-11",0.1617),("1996-09-12",0.1559),("1996-09-13",0.1607),("1996-09-16",0.1712),("1996-09-17",0.176),("1996-09-18",0.1799),("1996-09-19",0.1789),("1996-09-20",0.175),("1996-09-23",0.1712),("1996-09-24",0.1722),("1996-09-25",0.1712),("1996-09-26",0.1712),("1996-09-27",0.1708),("1996-09-30",0.1698),("1996-10-01",0.1884),("1996-10-02",0.1808),("1996-10-03",0.1712),("1996-10-04",0.1746),("1996-10-07",0.177),("1996-10-08",0.178),("1996-10-09",0.176),("1996-10-10",0.1852),("1996-10-11",0.1856),("1996-10-14",0.1933),("1996-10-15",0.1933),("1996-10-16",0.1971),("1996-10-17",0.2018),("1996-10-18",0.2033),("1996-10-21",0.1961),("1996-10-22",0.1904),("1996-10-23",0.1894),("1996-10-24",0.1894),("1996-10-25",0.1875),("1996-10-28",0.1875),("1996-10-29",0.178),("1996-10-30",0.175),("1996-10-31",0.176),("1996-11-01",0.1856),("1996-11-04",0.1865),("1996-11-05",0.1952),("1996-11-06",0.1952),("1996-11-07",0.198),("1996-11-08",0.2009),("1996-11-11",0.199),("1996-11-12",0.1933),("1996-11-13",0.1956),("1996-11-14",0.1961),("1996-11-15",0.1914),("1996-11-18",0.1894),("1996-11-19",0.1904),("1996-11-20",0.1914),("1996-11-21",0.1875),("1996-11-22",0.1933),("1996-11-25",0.1914),("1996-11-26",0.1856),("1996-11-27",0.1875),("1996-11-29",0.1846),("1996-12-02",0.1923),("1996-12-03",0.1923),("1996-12-04",0.1914),("1996-12-05",0.1914),("1996-12-06",0.1923),("1996-12-09",0.1914),("1996-12-10",0.1875),("1996-12-11",0.1837),("1996-12-12",0.1827),("1996-12-13",0.178),("1996-12-16",0.1731),("1996-12-17",0.1722),("1996-12-18",0.177),("1996-12-19",0.1703),("1996-12-20",0.1799),("1996-12-23",0.178),("1996-12-24",0.177),("1996-12-26",0.176),("1996-12-27",0.177),("1996-12-30",0.1665),("1996-12-31",0.1597),("1997-01-02",0.1607),("1997-01-03",0.1665),("1997-01-06",0.1368),("1997-01-07",0.1339),("1997-01-08",0.1349),("1997-01-09",0.1359),("1997-01-10",0.1397),("1997-01-13",0.1387),("1997-01-14",0.1368),("1997-01-15",0.132),("1997-01-16",0.1282),("1997-01-17",0.1282),("1997-01-20",0.1297),("1997-01-21",0.132),("1997-01-22",0.1316),("1997-01-23",0.132),("1997-01-24",0.1291),("1997-01-27",0.1272),("1997-01-28",0.1272),("1997-01-29",0.1272),("1997-01-30",0.1282),("1997-01-31",0.1272),("1997-02-03",0.1248),("1997-02-04",0.1177),("1997-02-05",0.1167),("1997-02-06",0.1225),("1997-02-07",0.121),("1997-02-10",0.1196),("1997-02-11",0.1201),("1997-02-12",0.1206),("1997-02-13",0.1234),("1997-02-14",0.1248),("1997-02-18",0.1368),("1997-02-19",0.1349),("1997-02-20",0.1301),("1997-02-21",0.1253),("1997-02-24",0.1272),("1997-02-25",0.1291),("1997-02-26",0.131),("1997-02-27",0.1301),("1997-02-28",0.1244),("1997-03-03",0.1234),("1997-03-04",0.1263),("1997-03-05",0.1301),("1997-03-06",0.1272),("1997-03-07",0.1263),("1997-03-10",0.1272),("1997-03-11",0.1253),("1997-03-12",0.1244),("1997-03-13",0.1253),("1997-03-14",0.1268),("1997-03-17",0.1263),("1997-03-18",0.1244),("1997-03-19",0.1234),("1997-03-20",0.132),("1997-03-21",0.1272),("1997-03-24",0.1263),("1997-03-25",0.1263),("1997-03-26",0.1282),("1997-03-27",0.1425),("1997-03-31",0.1397),("1997-04-01",0.1339),("1997-04-02",0.1378),("1997-04-03",0.1444),("1997-04-04",0.1473),("1997-04-07",0.1493),("1997-04-08",0.1463),("1997-04-09",0.1454),("1997-04-10",0.1444),("1997-04-11",0.1397),("1997-04-14",0.1435),("1997-04-15",0.1411),("1997-04-16",0.1421),("1997-04-17",0.1454),("1997-04-18",0.1406),("1997-04-21",0.1378),("1997-04-22",0.1416),("1997-04-23",0.1387),("1997-04-24",0.1368),("1997-04-25",0.1339),("1997-04-28",0.1349),("1997-04-29",0.1354),("1997-04-30",0.1301),("1997-05-01",0.1301),("1997-05-02",0.1301),("1997-05-05",0.1301),("1997-05-06",0.1291),("1997-05-07",0.1263),("1997-05-08",0.1301),("1997-05-09",0.1306),("1997-05-12",0.1344),("1997-05-13",0.1344),("1997-05-14",0.1354),("1997-05-15",0.1359),("1997-05-16",0.132),("1997-05-19",0.1301),("1997-05-20",0.132),("1997-05-21",0.1291),("1997-05-22",0.1272),("1997-05-23",0.1291),("1997-05-27",0.132),("1997-05-28",0.1301),("1997-05-29",0.1272),("1997-05-30",0.1272),("1997-06-02",0.1297),("1997-06-03",0.1277),("1997-06-04",0.1272),("1997-06-05",0.1277),("1997-06-06",0.1282),("1997-06-09",0.1272),("1997-06-10",0.1244),("1997-06-11",0.1248),("1997-06-12",0.1229),("1997-06-13",0.121),("1997-06-16",0.1186),("1997-06-17",0.1251),("1997-06-18",0.122),("1997-06-19",0.1206),("1997-06-20",0.1191),("1997-06-23",0.1177),("1997-06-24",0.1172),("1997-06-25",0.1158),("1997-06-26",0.1124),("1997-06-27",0.1124),("1997-06-30",0.1091),("1997-07-01",0.101),("1997-07-02",0.1),("1997-07-03",0.1048),("1997-07-07",0.1057),("1997-07-08",0.1052),("1997-07-09",0.1048),("1997-07-10",0.1014),("1997-07-11",0.1163),("1997-07-14",0.1196),("1997-07-15",0.122),("1997-07-16",0.1258),("1997-07-17",0.1339),("1997-07-18",0.1327),("1997-07-21",0.1237),("1997-07-22",0.1268),("1997-07-23",0.1234),("1997-07-24",0.121),("1997-07-25",0.1244),("1997-07-28",0.1258),("1997-07-29",0.1263),("1997-07-30",0.133),("1997-07-31",0.1339),("1997-08-01",0.1469),("1997-08-04",0.1512),("1997-08-05",0.1512),("1997-08-06",0.2014),("1997-08-07",0.2234),("1997-08-08",0.2052),("1997-08-11",0.188),("1997-08-12",0.1688),("1997-08-13",0.1808),("1997-08-14",0.176),("1997-08-15",0.178),("1997-08-18",0.1808),("1997-08-19",0.1871),("1997-08-20",0.1884),("1997-08-21",0.1837),("1997-08-22",0.1808),("1997-08-25",0.1765),("1997-08-26",0.1703),("1997-08-27",0.1737),("1997-08-28",0.1684),("1997-08-29",0.1665),("1997-09-02",0.1712),("1997-09-03",0.1722),("1997-09-04",0.1722),("1997-09-05",0.1698),("1997-09-08",0.1646),("1997-09-09",0.1669),("1997-09-10",0.1756),("1997-09-11",0.1712),("1997-09-12",0.1688),("1997-09-15",0.1646),("1997-09-16",0.1679),("1997-09-17",0.1669),("1997-09-18",0.1708),("1997-09-19",0.1679),("1997-09-22",0.1746),("1997-09-23",0.1665),("1997-09-24",0.1646),("1997-09-25",0.1617),("1997-09-26",0.1631),("1997-09-29",0.1688),("1997-09-30",0.166),("1997-10-01",0.1648),("1997-10-02",0.1679),("1997-10-03",0.1693),("1997-10-06",0.1679),("1997-10-07",0.1669),("1997-10-08",0.1646),("1997-10-09",0.1665),("1997-10-10",0.1737),("1997-10-13",0.1737),("1997-10-14",0.1737),("1997-10-15",0.1822),("1997-10-16",0.1646),("1997-10-17",0.154),("1997-10-20",0.1431),("1997-10-21",0.1459),("1997-10-22",0.1421),("1997-10-23",0.1359),("1997-10-24",0.1268),("1997-10-27",0.1282),("1997-10-28",0.1387),("1997-10-29",0.1339),("1997-10-30",0.1263),("1997-10-31",0.1303),("1997-11-03",0.133),("1997-11-04",0.1373),("1997-11-05",0.1406),("1997-11-06",0.1454),("1997-11-07",0.1512),("1997-11-10",0.1431),("1997-11-11",0.1406),("1997-11-12",0.1349),("1997-11-13",0.1378),("1997-11-14",0.1411),("1997-11-17",0.1416),("1997-11-18",0.1382),("1997-11-19",0.1397),("1997-11-20",0.1416),("1997-11-21",0.1392),("1997-11-24",0.1349),("1997-11-25",0.133),("1997-11-26",0.1339),("1997-11-28",0.1359),("1997-12-01",0.1359),("1997-12-02",0.1215),("1997-12-03",0.1206),("1997-12-04",0.1196),("1997-12-05",0.121),("1997-12-08",0.1191),("1997-12-09",0.1167),("1997-12-10",0.1129),("1997-12-11",0.1114),("1997-12-12",0.1082),("1997-12-15",0.1067),("1997-12-16",0.1095),("1997-12-17",0.1067),("1997-12-18",0.1057),("1997-12-19",0.1048),("1997-12-22",0.1019),("1997-12-23",0.099),("1997-12-24",0.1005),("1997-12-26",0.1019),("1997-12-29",0.1005),("1997-12-30",0.101),("1997-12-31",0.1005),("1998-01-02",0.1244),("1998-01-05",0.1215),("1998-01-06",0.145),("1998-01-07",0.1339),("1998-01-08",0.1392),("1998-01-09",0.1392),("1998-01-12",0.1397),("1998-01-13",0.1493),("1998-01-14",0.1512),("1998-01-15",0.1469),("1998-01-16",0.144),("1998-01-20",0.1459),("1998-01-21",0.1447),("1998-01-22",0.1473),("1998-01-23",0.1493),("1998-01-26",0.1488),("1998-01-27",0.1463),("1998-01-28",0.1469),("1998-01-29",0.1416),("1998-01-30",0.1401),("1998-02-02",0.1354),("1998-02-03",0.1401),("1998-02-04",0.1397),("1998-02-05",0.1401),("1998-02-06",0.1416),("1998-02-09",0.1469),("1998-02-10",0.1488),("1998-02-11",0.1454),("1998-02-12",0.1483),("1998-02-13",0.1493),("1998-02-17",0.1502),("1998-02-18",0.1574),("1998-02-19",0.1565),("1998-02-20",0.1531),("1998-02-23",0.1627),("1998-02-24",0.1631),("1998-02-25",0.1708),("1998-02-26",0.1799),("1998-02-27",0.1808),("1998-03-02",0.1741),("1998-03-03",0.177),("1998-03-04",0.1871),("1998-03-05",0.1842),("1998-03-06",0.1871),("1998-03-09",0.1741),("1998-03-10",0.1842),("1998-03-11",0.1999),("1998-03-12",0.2067),("1998-03-13",0.2076),("1998-03-16",0.2043),("1998-03-17",0.2016),("1998-03-18",0.2062),("1998-03-19",0.2047),("1998-03-20",0.2018),("1998-03-23",0.1999),("1998-03-24",0.2143),("1998-03-25",0.2079),("1998-03-26",0.2033),("1998-03-27",0.2062),("1998-03-30",0.21),("1998-03-31",0.2105),("1998-04-01",0.2105),("1998-04-02",0.209),("1998-04-03",0.2071),("1998-04-06",0.2009),("1998-04-07",0.1952),("1998-04-08",0.1914),("1998-04-09",0.1961),("1998-04-13",0.2024),("1998-04-14",0.2062),("1998-04-15",0.21),("1998-04-16",0.2191),("1998-04-17",0.2139),("1998-04-20",0.222),("1998-04-21",0.222),("1998-04-22",0.2105),("1998-04-23",0.2119),("1998-04-24",0.2139),("1998-04-27",0.2124),("1998-04-28",0.2062),("1998-04-29",0.2067),("1998-04-30",0.2095),("1998-05-01",0.2143),("1998-05-04",0.2224),("1998-05-05",0.2273),("1998-05-06",0.232),("1998-05-07",0.2311),("1998-05-08",0.233),("1998-05-11",0.2368),("1998-05-12",0.2305),("1998-05-13",0.233),("1998-05-14",0.2301),("1998-05-15",0.2263),("1998-05-18",0.2181),("1998-05-19",0.2248),("1998-05-20",0.2263),("1998-05-21",0.221),("1998-05-22",0.2133),("1998-05-26",0.2043),("1998-05-27",0.2047),("1998-05-28",0.21),("1998-05-29",0.2038),("1998-06-01",0.2009),("1998-06-02",0.2057),("1998-06-03",0.2014),("1998-06-04",0.2052),("1998-06-05",0.2057),("1998-06-08",0.2086),("1998-06-09",0.2162),("1998-06-10",0.2148),("1998-06-11",0.2129),("1998-06-12",0.2152),("1998-06-15",0.2105),("1998-06-16",0.2143),("1998-06-17",0.2152),("1998-06-18",0.209),("1998-06-19",0.2071),("1998-06-22",0.2095),("1998-06-23",0.2129),("1998-06-24",0.2162),("1998-06-25",0.2186),("1998-06-26",0.2158),("1998-06-29",0.2196),("1998-06-30",0.2196),("1998-07-01",0.2292),("1998-07-02",0.222),("1998-07-06",0.2325),("1998-07-07",0.2335),("1998-07-08",0.2492),("1998-07-09",0.2426),("1998-07-10",0.2454),("1998-07-13",0.2598),("1998-07-14",0.256),("1998-07-15",0.2636),("1998-07-16",0.287),("1998-07-17",0.2823),("1998-07-20",0.2775),("1998-07-21",0.2727),("1998-07-22",0.2679),("1998-07-23",0.2674),("1998-07-24",0.2655),("1998-07-27",0.2636),("1998-07-28",0.2574),("1998-07-29",0.2689),("1998-07-30",0.2794),("1998-07-31",0.2651),("1998-08-03",0.2689),("1998-08-04",0.2617),("1998-08-05",0.2755),("1998-08-06",0.2823),("1998-08-07",0.2794),("1998-08-10",0.2904),("1998-08-11",0.2985),("1998-08-12",0.3066),("1998-08-13",0.3019),("1998-08-14",0.31),("1998-08-17",0.321),("1998-08-18",0.3258),("1998-08-19",0.3138),("1998-08-20",0.311),("1998-08-21",0.3291),("1998-08-24",0.3153),("1998-08-25",0.3124),("1998-08-26",0.3091),("1998-08-27",0.287),("1998-08-28",0.2617),("1998-08-31",0.2387),("1998-09-01",0.2612),("1998-09-02",0.2722),("1998-09-03",0.2651),("1998-09-04",0.2689),("1998-09-08",0.2928),("1998-09-09",0.2861),("1998-09-10",0.2919),("1998-09-11",0.288),("1998-09-14",0.2847),("1998-09-15",0.2923),("1998-09-16",0.2856),("1998-09-17",0.2755),("1998-09-18",0.2813),("1998-09-21",0.2827),("1998-09-22",0.2832),("1998-09-23",0.2932),("1998-09-24",0.2947),("1998-09-25",0.2966),("1998-09-28",0.299),("1998-09-29",0.3023),("1998-09-30",0.2919),("1998-10-01",0.2732),("1998-10-02",0.2684),("1998-10-05",0.2464),("1998-10-06",0.2492),("1998-10-07",0.2445),("1998-10-08",0.2358),("1998-10-09",0.2689),("1998-10-12",0.2866),("1998-10-13",0.2966),("1998-10-14",0.2861),("1998-10-15",0.2804),("1998-10-16",0.2808),("1998-10-19",0.287),("1998-10-20",0.276),("1998-10-21",0.2842),("1998-10-22",0.2813),("1998-10-23",0.2717),("1998-10-26",0.2866),("1998-10-27",0.2698),("1998-10-28",0.2817),("1998-10-29",0.2789),("1998-10-30",0.2842),("1998-11-02",0.288),("1998-11-03",0.2894),("1998-11-04",0.2961),("1998-11-05",0.2923),("1998-11-06",0.2913),("1998-11-09",0.2804),("1998-11-10",0.2689),("1998-11-11",0.2569),("1998-11-12",0.2602),("1998-11-13",0.2732),("1998-11-16",0.2755),("1998-11-17",0.2664),("1998-11-18",0.2713),("1998-11-19",0.2736),("1998-11-20",0.2703),("1998-11-23",0.2775),("1998-11-24",0.2751),("1998-11-25",0.2689),("1998-11-27",0.2684),("1998-11-30",0.2445),("1998-12-01",0.2612),("1998-12-02",0.2755),("1998-12-03",0.2579),("1998-12-04",0.2507),("1998-12-07",0.2583),("1998-12-08",0.2454),("1998-12-09",0.2449),("1998-12-10",0.2449),("1998-12-11",0.2583),("1998-12-14",0.2488),("1998-12-15",0.2569),("1998-12-16",0.2511),("1998-12-17",0.256),("1998-12-18",0.2693),("1998-12-21",0.2684),("1998-12-22",0.2909),("1998-12-23",0.3047),("1998-12-24",0.3004),("1998-12-28",0.3129),("1998-12-29",0.3124),("1998-12-30",0.3066),("1998-12-31",0.3134),("1999-01-04",0.3157),("1999-01-05",0.3315),("1999-01-06",0.3196),("1999-01-07",0.3444),("1999-01-08",0.3444),("1999-01-11",0.3512),("1999-01-12",0.3531),("1999-01-13",0.3559),("1999-01-14",0.3167),("1999-01-15",0.3162),("1999-01-19",0.3129),("1999-01-20",0.3105),("1999-01-21",0.2971),("1999-01-22",0.2966),("1999-01-25",0.3014),("1999-01-26",0.31),("1999-01-27",0.3072),("1999-01-28",0.3129),("1999-01-29",0.3153),("1999-02-01",0.3134),("1999-02-02",0.3),("1999-02-03",0.3076),("1999-02-04",0.2899),("1999-02-05",0.2779),("1999-02-08",0.2889),("1999-02-09",0.2847),("1999-02-10",0.2932),("1999-02-11",0.3033),("1999-02-12",0.2885),("1999-02-16",0.2932),("1999-02-17",0.2832),("1999-02-18",0.2755),("1999-02-19",0.2847),("1999-02-22",0.2942),("1999-02-23",0.2942),("1999-02-24",0.2866),("1999-02-25",0.2827),("1999-02-26",0.2664),("1999-03-01",0.2583),("1999-03-02",0.2651),("1999-03-03",0.2617),("1999-03-04",0.256),("1999-03-05",0.254),("1999-03-08",0.2631),("1999-03-09",0.2612),("1999-03-10",0.2492),("1999-03-11",0.2464),("1999-03-12",0.254),("1999-03-15",0.2607),("1999-03-16",0.2717),("1999-03-17",0.2607),("1999-03-18",0.2717),("1999-03-19",0.2564),("1999-03-22",0.2684),("1999-03-23",0.2526),("1999-03-24",0.2579),("1999-03-25",0.2588),("1999-03-26",0.2545),("1999-03-29",0.2708),("1999-03-30",0.2746),("1999-03-31",0.2751),("1999-04-01",0.276),("1999-04-05",0.2837),("1999-04-06",0.2909),("1999-04-07",0.2842),("1999-04-08",0.2823),("1999-04-09",0.2813),("1999-04-12",0.2775),("1999-04-13",0.2651),("1999-04-14",0.272),("1999-04-15",0.2736),("1999-04-16",0.2713),("1999-04-19",0.2593),("1999-04-20",0.2607),("1999-04-21",0.2631),("1999-04-22",0.2785),("1999-04-23",0.3),("1999-04-26",0.3134),("1999-04-27",0.3502),("1999-04-28",0.3372),("1999-04-29",0.3291),("1999-04-30",0.3521),("1999-05-03",0.3793),("1999-05-04",0.3559),("1999-05-05",0.3597),("1999-05-06",0.3406),("1999-05-07",0.3512),("1999-05-10",0.3463),("1999-05-11",0.3425),("1999-05-12",0.3559),("1999-05-13",0.3535),("1999-05-14",0.3397),("1999-05-17",0.3397),("1999-05-18",0.3463),("1999-05-19",0.3459),("1999-05-20",0.3253),("1999-05-21",0.3363),("1999-05-24",0.321),("1999-05-25",0.3176),("1999-05-26",0.3372),("1999-05-27",0.333),("1999-05-28",0.3372),("1999-06-01",0.343),("1999-06-02",0.3564),("1999-06-03",0.3631),("1999-06-04",0.3684),("1999-06-07",0.3746),("1999-06-08",0.365),("1999-06-09",0.3708),("1999-06-10",0.3684),("1999-06-11",0.3555),("1999-06-14",0.3478),("1999-06-15",0.3525),("1999-06-16",0.3669),("1999-06-17",0.355),("1999-06-18",0.3607),("1999-06-21",0.3559),("1999-06-22",0.3473),("1999-06-23",0.3344),("1999-06-24",0.3238),("1999-06-25",0.3229),("1999-06-28",0.3258),("1999-06-29",0.3473),("1999-06-30",0.3545),("1999-07-01",0.3468),("1999-07-02",0.3545),("1999-07-06",0.3627),("1999-07-07",0.3818),("1999-07-08",0.4171),("1999-07-09",0.4258),("1999-07-12",0.4171),("1999-07-13",0.4109),("1999-07-14",0.4282),("1999-07-15",0.4076),("1999-07-16",0.4061),("1999-07-19",0.4167),("1999-07-20",0.4047),("1999-07-21",0.4138),("1999-07-22",0.4009),("1999-07-23",0.408),("1999-07-26",0.3899),("1999-07-27",0.4109),("1999-07-28",0.4162),("1999-07-29",0.4124),("1999-07-30",0.4263),("1999-08-02",0.4267),("1999-08-03",0.4229),("1999-08-04",0.4119),("1999-08-05",0.4191),("1999-08-06",0.4143),("1999-08-09",0.4167),("1999-08-10",0.4239),("1999-08-11",0.4569),("1999-08-12",0.4592),("1999-08-13",0.4597),("1999-08-16",0.4631),("1999-08-17",0.4616),("1999-08-18",0.4602),("1999-08-19",0.4497),("1999-08-20",0.453),("1999-08-23",0.465),("1999-08-24",0.4622),("1999-08-25",0.4698),("1999-08-26",0.4756),("1999-08-27",0.4956),("1999-08-30",0.475),("1999-08-31",0.4994),("1999-09-01",0.5252),("1999-09-02",0.5401),("1999-09-03",0.5626),("1999-09-07",0.5845),("1999-09-08",0.5702),("1999-09-09",0.5783),("1999-09-10",0.5927),("1999-09-13",0.5741),("1999-09-14",0.5956),("1999-09-15",0.5769),("1999-09-16",0.5879),("1999-09-17",0.5889),("1999-09-20",0.6051),("1999-09-21",0.53),("1999-09-22",0.5382),("1999-09-23",0.4846),("1999-09-24",0.4971),("1999-09-27",0.4693),("1999-09-28",0.4564),("1999-09-29",0.4521),("1999-09-30",0.4846),("1999-10-01",0.4724),("1999-10-04",0.4942),("1999-10-05",0.52),("1999-10-06",0.5143),("1999-10-07",0.508),("1999-10-08",0.5018),("1999-10-11",0.5105),("1999-10-12",0.5181),("1999-10-13",0.4901),("1999-10-14",0.5602),("1999-10-15",0.5707),("1999-10-18",0.5607),("1999-10-19",0.5243),("1999-10-20",0.575),("1999-10-21",0.5826),("1999-10-22",0.5659),("1999-10-25",0.5702),("1999-10-26",0.5745),("1999-10-27",0.5845),("1999-10-28",0.596),("1999-10-29",0.6132),("1999-11-01",0.5941),("1999-11-02",0.6142),("1999-11-03",0.6238),("1999-11-04",0.64),("1999-11-05",0.6759),("1999-11-08",0.7376),("1999-11-09",0.686),("1999-11-10",0.6999),("1999-11-11",0.7061),("1999-11-12",0.6936),("1999-11-15",0.6846),("1999-11-16",0.698),("1999-11-17",0.6908),("1999-11-18",0.686),("1999-11-19",0.7075),("1999-11-22",0.6936),("1999-11-23",0.7104),("1999-11-24",0.7248),("1999-11-26",0.7276),("1999-11-29",0.7238),("1999-11-30",0.7491),("1999-12-01",0.7888),("1999-12-02",0.8434),("1999-12-03",0.8802),("1999-12-06",0.8879),("1999-12-07",0.9017),("1999-12-08",0.8424),("1999-12-09",0.8056),("1999-12-10",0.7884),("1999-12-13",0.7578),("1999-12-14",0.7261),("1999-12-15",0.7424),("1999-12-16",0.7525),("1999-12-17",0.7654),("1999-12-20",0.7501),("1999-12-21",0.7845),("1999-12-22",0.765),("1999-12-23",0.7922),("1999-12-27",0.7601),("1999-12-28",0.7516),("1999-12-29",0.7707),("1999-12-30",0.7678),("1999-12-31",0.7869),("2000-01-03",0.8568),("2000-01-04",0.7845),("2000-01-05",0.796),("2000-01-06",0.7271),("2000-01-07",0.7616),("2000-01-10",0.7482),("2000-01-11",0.7099),("2000-01-12",0.6674),("2000-01-13",0.7405),("2000-01-14",0.7688),("2000-01-18",0.7956),("2000-01-19",0.8156),("2000-01-20",0.8687),("2000-01-21",0.852),("2000-01-24",0.8133),("2000-01-25",0.8592),("2000-01-26",0.8434),("2000-01-27",0.842),("2000-01-28",0.7778),("2000-01-31",0.7941),("2000-02-01",0.7673),("2000-02-02",0.7563),("2000-02-03",0.7907),("2000-02-04",0.8266),("2000-02-07",0.873),("2000-02-08",0.8792),("2000-02-09",0.862),("2000-02-10",0.8687),("2000-02-11",0.8324),("2000-02-14",0.8864),("2000-02-15",0.9108),("2000-02-16",0.8735),("2000-02-17",0.8792),("2000-02-18",0.8515),("2000-02-22",0.8711),("2000-02-23",0.8898),("2000-02-24",0.8818),("2000-02-25",0.8448),("2000-02-28",0.8668),("2000-02-29",0.8773),("2000-03-01",0.9974),("2000-03-02",0.9338),("2000-03-03",0.9797),("2000-03-06",0.962),("2000-03-07",0.9405),("2000-03-08",0.9338),("2000-03-09",0.9357),("2000-03-10",0.9625),("2000-03-13",0.9285),("2000-03-14",0.8745),("2000-03-15",0.8898),("2000-03-16",0.9304),("2000-03-17",0.9568),("2000-03-20",0.9415),("2000-03-21",1.0328),("2000-03-22",1.1036),("2000-03-23",1.0816),("2000-03-24",1.0616),("2000-03-27",1.0682),("2000-03-28",1.0649),("2000-03-29",1.0405),("2000-03-30",0.9625),("2000-03-31",1.0395),("2000-04-03",1.0204),("2000-04-04",0.9744),("2000-04-05",0.9979),("2000-04-06",0.9582),("2000-04-07",1.0084),("2000-04-10",0.9568),("2000-04-11",0.9142),("2000-04-12",0.8362),("2000-04-13",0.8711),("2000-04-14",0.8563),("2000-04-17",0.9481),("2000-04-18",0.9711),("2000-04-19",0.9271),("2000-04-20",0.9098),("2000-04-24",0.9223),("2000-04-25",0.9821),("2000-04-26",0.9285),("2000-04-27",0.9702),("2000-04-28",0.9496),("2000-05-01",0.9515),("2000-05-02",0.9022),("2000-05-03",0.8807),("2000-05-04",0.8472),("2000-05-05",0.8658),("2000-05-08",0.8429),("2000-05-09",0.8071),("2000-05-10",0.7601),("2000-05-11",0.7869),("2000-05-12",0.8237),("2000-05-15",0.7731),("2000-05-16",0.809),("2000-05-17",0.7759),("2000-05-18",0.7712),("2000-05-19",0.7195),("2000-05-22",0.6884),("2000-05-23",0.6568),("2000-05-24",0.6712),("2000-05-25",0.668),("2000-05-26",0.6611),("2000-05-30",0.6702),("2000-05-31",0.6429),("2000-06-01",0.6821),("2000-06-02",0.7085),("2000-06-05",0.6989),("2000-06-06",0.7108),("2000-06-07",0.7391),("2000-06-08",0.7257),("2000-06-09",0.7329),("2000-06-12",0.698),("2000-06-13",0.7233),("2000-06-14",0.6922),("2000-06-15",0.707),("2000-06-16",0.698),("2000-06-19",0.7395),("2000-06-20",0.775),("2000-06-21",0.8516),("2000-06-22",0.8228),("2000-06-23",0.7913),("2000-06-26",0.8286),("2000-06-27",0.7922),("2000-06-28",0.8334),("2000-06-29",0.7845),("2000-06-30",0.8018),("2000-07-03",0.8161),("2000-07-05",0.7904),("2000-07-06",0.7931),("2000-07-07",0.8334),("2000-07-10",0.8746),("2000-07-11",0.8717),("2000-07-12",0.9013),("2000-07-13",0.8649),("2000-07-14",0.8831),("2000-07-17",0.8926),("2000-07-18",0.8764),("2000-07-19",0.8066),("2000-07-20",0.8439),("2000-07-21",0.8199),("2000-07-24",0.7454),("2000-07-25",0.7663),("2000-07-26",0.7663),("2000-07-27",0.796),("2000-07-28",0.7395),("2000-07-31",0.7778),("2000-08-01",0.7548),("2000-08-02",0.7233),("2000-08-03",0.7348),("2000-08-04",0.7253),("2000-08-07",0.7339),("2000-08-08",0.7157),("2000-08-09",0.7271),("2000-08-10",0.7281),("2000-08-11",0.7301),("2000-08-14",0.7204),("2000-08-15",0.7147),("2000-08-16",0.7424),("2000-08-17",0.7875),("2000-08-18",0.7654),("2000-08-21",0.7731),("2000-08-22",0.7913),("2000-08-23",0.8314),("2000-08-24",0.8589),("2000-08-25",0.8697),("2000-08-28",0.8888),("2000-08-29",0.9061),("2000-08-30",0.9108),("2000-08-31",0.9329),("2000-09-01",0.9712),("2000-09-05",0.9558),("2000-09-06",0.8946),("2000-09-07",0.9491),("2000-09-08",0.9013),("2000-09-11",0.8946),("2000-09-12",0.8841),("2000-09-13",0.8879),("2000-09-14",0.8704),("2000-09-15",0.8455),("2000-09-18",0.9286),("2000-09-19",0.9176),("2000-09-20",0.9346),("2000-09-21",0.8678),("2000-09-22",0.7989),("2000-09-25",0.819),("2000-09-26",0.7875),("2000-09-27",0.7492),("2000-09-28",0.819),("2000-09-29",0.3942),("2000-10-02",0.3712),("2000-10-03",0.3415),("2000-10-04",0.3616),("2000-10-05",0.3377),("2000-10-06",0.3397),("2000-10-09",0.333),("2000-10-10",0.3195),("2000-10-11",0.3003),("2000-10-12",0.3062),("2000-10-13",0.3377),("2000-10-16",0.3291),("2000-10-17",0.308),("2000-10-18",0.308),("2000-10-19",0.2899),("2000-10-20",0.2985),("2000-10-23",0.3118),("2000-10-24",0.2889),("2000-10-25",0.2832),("2000-10-26",0.2832),("2000-10-27",0.2841),("2000-10-30",0.2956),("2000-10-31",0.2994),("2000-11-01",0.3138),("2000-11-02",0.3415),("2000-11-03",0.3406),("2000-11-06",0.3282),("2000-11-07",0.3262),("2000-11-08",0.3071),("2000-11-09",0.3091),("2000-11-10",0.2918),("2000-11-13",0.2965),("2000-11-14",0.31),("2000-11-15",0.3042),("2000-11-16",0.2909),("2000-11-17",0.2832),("2000-11-20",0.2899),("2000-11-21",0.2879),("2000-11-22",0.2832),("2000-11-24",0.2956),("2000-11-27",0.2861),("2000-11-28",0.276),("2000-11-29",0.2688),("2000-11-30",0.2526),("2000-12-01",0.2612),("2000-12-04",0.2555),("2000-12-05",0.2602),("2000-12-06",0.2191),("2000-12-07",0.2191),("2000-12-08",0.2305),("2000-12-11",0.2325),("2000-12-12",0.2354),("2000-12-13",0.2296),("2000-12-14",0.2211),("2000-12-15",0.2152),("2000-12-18",0.2181),("2000-12-19",0.2143),("2000-12-20",0.2201),("2000-12-21",0.2152),("2000-12-22",0.2296),("2000-12-26",0.2249),("2000-12-27",0.2267),("2000-12-28",0.2267),("2000-12-29",0.2278),("2001-01-02",0.2278),("2001-01-03",0.2506),("2001-01-04",0.2612),("2001-01-05",0.2506),("2001-01-08",0.2535),("2001-01-09",0.2631),("2001-01-10",0.2535),("2001-01-11",0.2755),("2001-01-12",0.2631),("2001-01-16",0.2621),("2001-01-17",0.2573),("2001-01-18",0.2861),("2001-01-19",0.2985),("2001-01-22",0.2947),("2001-01-23",0.3138),("2001-01-24",0.3138),("2001-01-25",0.3052),("2001-01-26",0.2994),("2001-01-29",0.332),("2001-01-30",0.333),("2001-01-31",0.331),("2001-02-01",0.3233),("2001-02-02",0.3157),("2001-02-05",0.3091),("2001-02-06",0.3233),("2001-02-07",0.3176),("2001-02-08",0.3176),("2001-02-09",0.2927),("2001-02-12",0.3014),("2001-02-13",0.2927),("2001-02-14",0.2985),("2001-02-15",0.3071),("2001-02-16",0.2909),("2001-02-20",0.2803),("2001-02-21",0.2889),("2001-02-22",0.2879),("2001-02-23",0.2879),("2001-02-26",0.2985),("2001-02-27",0.2965),("2001-02-28",0.2794),("2001-03-01",0.287),("2001-03-02",0.2947),("2001-03-05",0.3118),("2001-03-06",0.3291),("2001-03-07",0.3253),("2001-03-08",0.3186),("2001-03-09",0.31),("2001-03-12",0.285),("2001-03-13",0.2994),("2001-03-14",0.3129),("2001-03-15",0.3014),("2001-03-16",0.3003),("2001-03-19",0.3147),("2001-03-20",0.3014),("2001-03-21",0.308),("2001-03-22",0.331),("2001-03-23",0.3521),("2001-03-26",0.3334),("2001-03-27",0.3501),("2001-03-28",0.3394),("2001-03-29",0.3449),("2001-03-30",0.3379),("2001-04-02",0.3305),("2001-04-03",0.3098),("2001-04-04",0.2985),("2001-04-05",0.3195),("2001-04-06",0.3152),("2001-04-09",0.3144),("2001-04-10",0.3374),("2001-04-11",0.3337),("2001-04-12",0.3432),("2001-04-16",0.3282),("2001-04-17",0.3123),("2001-04-18",0.3489),("2001-04-19",0.3937),("2001-04-20",0.3833),("2001-04-23",0.3712),("2001-04-24",0.3679),("2001-04-25",0.3784),("2001-04-26",0.378),("2001-04-27",0.4011),("2001-04-30",0.3902),("2001-05-01",0.3969),("2001-05-02",0.407),("2001-05-03",0.3821),("2001-05-04",0.3942),("2001-05-07",0.3821),("2001-05-08",0.3761),("2001-05-09",0.3671),("2001-05-10",0.3521),("2001-05-11",0.3498),("2001-05-14",0.3565),("2001-05-15",0.3548),("2001-05-16",0.3689),("2001-05-17",0.3605),("2001-05-18",0.3602),("2001-05-21",0.3607),("2001-05-22",0.3597),("2001-05-23",0.3556),("2001-05-24",0.3552),("2001-05-25",0.3484),("2001-05-29",0.3287),("2001-05-30",0.3028),("2001-05-31",0.3054),("2001-06-01",0.3198),("2001-06-04",0.3163),("2001-06-05",0.3206),("2001-06-06",0.3173),("2001-06-07",0.3316),("2001-06-08",0.3264),("2001-06-11",0.3068),("2001-06-12",0.3109),("2001-06-13",0.3134),("2001-06-14",0.3043),("2001-06-15",0.3129),("2001-06-18",0.3112),("2001-06-19",0.3091),("2001-06-20",0.3317),("2001-06-21",0.3443),("2001-06-22",0.3408),("2001-06-25",0.3672),("2001-06-26",0.3636),("2001-06-27",0.3573),("2001-06-28",0.3604),("2001-06-29",0.3559),("2001-07-02",0.3659),("2001-07-03",0.3649),("2001-07-05",0.355),("2001-07-06",0.3372),("2001-07-09",0.3475),("2001-07-10",0.3236),("2001-07-11",0.345),("2001-07-12",0.3729),("2001-07-13",0.3804),("2001-07-16",0.3668),("2001-07-17",0.3842),("2001-07-18",0.3183),("2001-07-19",0.3056),("2001-07-20",0.3059),("2001-07-23",0.2991),("2001-07-24",0.2922),("2001-07-25",0.2827),("2001-07-26",0.2846),("2001-07-27",0.2902),("2001-07-30",0.2898),("2001-07-31",0.2876),("2001-08-01",0.2918),("2001-08-02",0.3034),("2001-08-03",0.2985),("2001-08-06",0.2928),("2001-08-07",0.2947),("2001-08-08",0.2893),("2001-08-09",0.2916),("2001-08-10",0.2912),("2001-08-13",0.2922),("2001-08-14",0.2867),("2001-08-15",0.2823),("2001-08-16",0.2855),("2001-08-17",0.2766),("2001-08-20",0.2774),("2001-08-21",0.2743),("2001-08-22",0.2788),("2001-08-23",0.2726),("2001-08-24",0.2843),("2001-08-27",0.2896),("2001-08-28",0.2817),("2001-08-29",0.2729),("2001-08-30",0.2729),("2001-08-31",0.284),("2001-09-04",0.2794),("2001-09-05",0.284),("2001-09-06",0.2713),("2001-09-07",0.2645),("2001-09-10",0.2659),("2001-09-17",0.2601),("2001-09-18",0.2492),("2001-09-19",0.2605),("2001-09-20",0.24),("2001-09-21",0.2408),("2001-09-24",0.2518),("2001-09-25",0.2379),("2001-09-26",0.2319),("2001-09-27",0.2374),("2001-09-28",0.2374),("2001-10-01",0.2379),("2001-10-02",0.2304),("2001-10-03",0.2293),("2001-10-04",0.2431),("2001-10-05",0.2471),("2001-10-08",0.248),("2001-10-09",0.2449),("2001-10-10",0.2575),("2001-10-11",0.2716),("2001-10-12",0.2757),("2001-10-15",0.2754),("2001-10-16",0.2757),("2001-10-17",0.2601),("2001-10-18",0.2755),("2001-10-19",0.2801),("2001-10-22",0.2912),("2001-10-23",0.2777),("2001-10-24",0.2901),("2001-10-25",0.2938),("2001-10-26",0.2858),("2001-10-29",0.2699),("2001-10-30",0.2694),("2001-10-31",0.2688),("2001-11-01",0.2846),("2001-11-02",0.2843),("2001-11-05",0.2919),("2001-11-06",0.2996),("2001-11-07",0.2999),("2001-11-08",0.2864),("2001-11-09",0.2864),("2001-11-12",0.287),("2001-11-13",0.2965),("2001-11-14",0.3002),("2001-11-15",0.2977),("2001-11-16",0.2904),("2001-11-19",0.3062),("2001-11-20",0.299),("2001-11-21",0.3013),("2001-11-23",0.3037),("2001-11-26",0.3271),("2001-11-27",0.3215),("2001-11-28",0.3143),("2001-11-29",0.3126),("2001-11-30",0.3261),("2001-12-03",0.3222),("2001-12-04",0.3429),("2001-12-05",0.3637),("2001-12-06",0.3487),("2001-12-07",0.345),("2001-12-10",0.345),("2001-12-11",0.3334),("2001-12-12",0.329),("2001-12-13",0.3215),("2001-12-14",0.3121),("2001-12-17",0.3157),("2001-12-18",0.3216),("2001-12-19",0.331),("2001-12-20",0.3164),("2001-12-21",0.3215),("2001-12-24",0.327),("2001-12-26",0.329),("2001-12-27",0.3379),("2001-12-28",0.3434),("2001-12-31",0.3353),("2002-01-02",0.3567),("2002-01-03",0.361),("2002-01-04",0.3627),("2002-01-07",0.3506),("2002-01-08",0.3461),("2002-01-09",0.3314),("2002-01-10",0.325),("2002-01-11",0.3222),("2002-01-14",0.3238),("2002-01-15",0.3322),("2002-01-16",0.3181),("2002-01-17",0.3441),("2002-01-18",0.3394),("2002-01-22",0.334),("2002-01-23",0.3524),("2002-01-24",0.3553),("2002-01-25",0.3559),("2002-01-28",0.3562),("2002-01-29",0.3532),("2002-01-30",0.3688),("2002-01-31",0.3784),("2002-02-01",0.3737),("2002-02-04",0.3881),("2002-02-05",0.3896),("2002-02-06",0.3777),("2002-02-07",0.372),("2002-02-08",0.3679),("2002-02-11",0.3824),("2002-02-12",0.3783),("2002-02-13",0.3829),("2002-02-14",0.3766),("2002-02-15",0.3659),("2002-02-19",0.3463),("2002-02-20",0.3541),("2002-02-21",0.3291),("2002-02-22",0.3481),("2002-02-25",0.3645),("2002-02-26",0.3623),("2002-02-27",0.3362),("2002-02-28",0.3322),("2002-03-01",0.359),("2002-03-04",0.3718),("2002-03-05",0.3602),("2002-03-06",0.3685),("2002-03-07",0.3732),("2002-03-08",0.3775),("2002-03-11",0.3836),("2002-03-12",0.3784),("2002-03-13",0.3749),("2002-03-14",0.374),("2002-03-15",0.3819),("2002-03-18",0.3787),("2002-03-19",0.3804),("2002-03-20",0.3815),("2002-03-21",0.3715),("2002-03-22",0.3688),("2002-03-25",0.3574),("2002-03-26",0.3591),("2002-03-27",0.3593),("2002-03-28",0.3623),("2002-04-01",0.3744),("2002-04-02",0.3685),("2002-04-03",0.3636),("2002-04-04",0.3812),("2002-04-05",0.3787),("2002-04-08",0.376),("2002-04-09",0.3689),("2002-04-10",0.3775),("2002-04-11",0.3806),("2002-04-12",0.3836),("2002-04-15",0.3827),("2002-04-16",0.394),("2002-04-17",0.3997),("2002-04-18",0.389),("2002-04-19",0.3824),("2002-04-22",0.3755),("2002-04-23",0.3712),("2002-04-24",0.3639),("2002-04-25",0.3692),("2002-04-26",0.3522),("2002-04-29",0.3668),("2002-04-30",0.3715),("2002-05-01",0.3671),("2002-05-02",0.3627),("2002-05-03",0.3599),("2002-05-06",0.3467),("2002-05-07",0.344),("2002-05-08",0.3731),("2002-05-09",0.3703),("2002-05-10",0.357),("2002-05-13",0.3665),("2002-05-14",0.392),("2002-05-15",0.387),("2002-05-16",0.3859),("2002-05-17",0.3829),("2002-05-20",0.3787),("2002-05-21",0.3591),("2002-05-22",0.3723),("2002-05-23",0.3855),("2002-05-24",0.3697),("2002-05-28",0.3671),("2002-05-29",0.3671),("2002-05-30",0.3705),("2002-05-31",0.3567),("2002-06-03",0.3507),("2002-06-04",0.3487),("2002-06-05",0.3478),("2002-06-06",0.3392),("2002-06-07",0.3276),("2002-06-10",0.3288),("2002-06-11",0.3132),("2002-06-12",0.3075),("2002-06-13",0.2991),("2002-06-14",0.3077),("2002-06-17",0.3144),("2002-06-18",0.3085),("2002-06-19",0.2621),("2002-06-20",0.2619),("2002-06-21",0.2579),("2002-06-24",0.2644),("2002-06-25",0.2624),("2002-06-26",0.2534),("2002-06-27",0.2612),("2002-06-28",0.2713),("2002-07-01",0.2612),("2002-07-02",0.2593),("2002-07-03",0.2687),("2002-07-05",0.2869),("2002-07-08",0.2757),("2002-07-09",0.2684),("2002-07-10",0.2651),("2002-07-11",0.2801),("2002-07-12",0.2679),("2002-07-15",0.2791),("2002-07-16",0.2734),("2002-07-17",0.2393),("2002-07-18",0.2295),("2002-07-19",0.229),("2002-07-22",0.2284),("2002-07-23",0.2215),("2002-07-24",0.2327),("2002-07-25",0.2198),("2002-07-26",0.2195),("2002-07-29",0.2299),("2002-07-30",0.2362),("2002-07-31",0.2336),("2002-08-01",0.2266),("2002-08-02",0.2212),("2002-08-05",0.2142),("2002-08-06",0.2256),("2002-08-07",0.2301),("2002-08-08",0.2342),("2002-08-09",0.2296),("2002-08-12",0.2295),("2002-08-13",0.2233),("2002-08-14",0.2322),("2002-08-15",0.239),("2002-08-16",0.242),("2002-08-19",0.2446),("2002-08-20",0.2436),("2002-08-21",0.2468),("2002-08-22",0.2445),("2002-08-23",0.2408),("2002-08-26",0.2377),("2002-08-27",0.2273),("2002-08-28",0.225),("2002-08-29",0.225),("2002-08-30",0.2258),("2002-09-03",0.2151),("2002-09-04",0.2217),("2002-09-05",0.2171),("2002-09-06",0.2201),("2002-09-09",0.22),("2002-09-10",0.2194),("2002-09-11",0.2188),("2002-09-12",0.2165),("2002-09-13",0.2169),("2002-09-16",0.222),("2002-09-17",0.2266),("2002-09-18",0.2299),("2002-09-19",0.2232),("2002-09-20",0.2276),("2002-09-23",0.2273),("2002-09-24",0.2241),("2002-09-25",0.2286),("2002-09-26",0.225),("2002-09-27",0.2253),("2002-09-30",0.222),("2002-10-01",0.2221),("2002-10-02",0.2169),("2002-10-03",0.2189),("2002-10-04",0.2148),("2002-10-07",0.2108),("2002-10-08",0.2096),("2002-10-09",0.2082),("2002-10-10",0.2162),("2002-10-11",0.2221),("2002-10-14",0.2261),("2002-10-15",0.2321),("2002-10-16",0.2229),("2002-10-17",0.216),("2002-10-18",0.2195),("2002-10-21",0.2229),("2002-10-22",0.225),("2002-10-23",0.2278),("2002-10-24",0.2249),("2002-10-25",0.2361),("2002-10-28",0.239),("2002-10-29",0.2364),("2002-10-30",0.2446),("2002-10-31",0.246),("2002-11-01",0.2504),("2002-11-04",0.2586),("2002-11-05",0.2587),("2002-11-06",0.2636),("2002-11-07",0.2449),("2002-11-08",0.2425),("2002-11-11",0.2321),("2002-11-12",0.2394),("2002-11-13",0.2387),("2002-11-14",0.2495),("2002-11-15",0.2442),("2002-11-18",0.2396),("2002-11-19",0.2338),("2002-11-20",0.2377),("2002-11-21",0.2503),("2002-11-22",0.2451),("2002-11-25",0.2445),("2002-11-26",0.2359),("2002-11-27",0.2406),("2002-11-29",0.2373),("2002-12-02",0.2324),("2002-12-03",0.2321),("2002-12-04",0.2292),("2002-12-05",0.224),("2002-12-06",0.2289),("2002-12-09",0.2258),("2002-12-10",0.2339),("2002-12-11",0.2371),("2002-12-12",0.2325),("2002-12-13",0.2264),("2002-12-16",0.2273),("2002-12-17",0.2308),("2002-12-18",0.223),("2002-12-19",0.2174),("2002-12-20",0.2165),("2002-12-23",0.2218),("2002-12-24",0.2198),("2002-12-26",0.2204),("2002-12-27",0.2152),("2002-12-30",0.2154),("2002-12-31",0.2194),("2003-01-02",0.2266),("2003-01-03",0.2281),("2003-01-06",0.2281),("2003-01-07",0.2273),("2003-01-08",0.2227),("2003-01-09",0.2247),("2003-01-10",0.2253),("2003-01-13",0.224),("2003-01-14",0.2237),("2003-01-15",0.2209),("2003-01-16",0.2238),("2003-01-17",0.2158),("2003-01-21",0.2146),("2003-01-22",0.2125),("2003-01-23",0.2169),("2003-01-24",0.2113),("2003-01-27",0.2163),("2003-01-28",0.218),("2003-01-29",0.2232),("2003-01-30",0.2192),("2003-01-31",0.2198),("2003-02-03",0.2244),("2003-02-04",0.2235),("2003-02-05",0.2212),("2003-02-06",0.2209),("2003-02-07",0.2166),("2003-02-10",0.2197),("2003-02-11",0.2197),("2003-02-12",0.2203),("2003-02-13",0.2226),("2003-02-14",0.2246),("2003-02-18",0.2338),("2003-02-19",0.2273),("2003-02-20",0.2261),("2003-02-21",0.2296),("2003-02-24",0.2256),("2003-02-25",0.2299),("2003-02-26",0.222),("2003-02-27",0.2275),("2003-02-28",0.2298),("2003-03-03",0.2243),("2003-03-04",0.2229),("2003-03-05",0.2238),("2003-03-06",0.2229),("2003-03-07",0.2224),("2003-03-10",0.22),("2003-03-11",0.2178),("2003-03-12",0.2177),("2003-03-13",0.2253),("2003-03-14",0.2263),("2003-03-17",0.2298),("2003-03-18",0.2296),("2003-03-19",0.2289),("2003-03-20",0.2282),("2003-03-21",0.2296),("2003-03-24",0.22),("2003-03-25",0.2227),("2003-03-26",0.2206),("2003-03-27",0.2218),("2003-03-28",0.223),("2003-03-31",0.2165),("2003-04-01",0.2168),("2003-04-02",0.2235),("2003-04-03",0.2214),("2003-04-04",0.2206),("2003-04-07",0.2218),("2003-04-08",0.2212),("2003-04-09",0.2172),("2003-04-10",0.22),("2003-04-11",0.2021),("2003-04-14",0.2079),("2003-04-15",0.205),("2003-04-16",0.2027),("2003-04-17",0.2008),("2003-04-21",0.2012),("2003-04-22",0.2068),("2003-04-23",0.2079),("2003-04-24",0.2057),("2003-04-25",0.2044),("2003-04-28",0.2122),("2003-04-29",0.2152),("2003-04-30",0.2177),("2003-05-01",0.2198),("2003-05-02",0.2212),("2003-05-05",0.2463),("2003-05-06",0.2679),("2003-05-07",0.2702),("2003-05-08",0.2755),("2003-05-09",0.2801),("2003-05-12",0.2841),("2003-05-13",0.2858),("2003-05-14",0.284),("2003-05-15",0.2867),("2003-05-16",0.2878),("2003-05-19",0.2771),("2003-05-20",0.2723),("2003-05-21",0.2733),("2003-05-22",0.2792),("2003-05-23",0.2804),("2003-05-27",0.289),("2003-05-28",0.2798),("2003-05-29",0.2771),("2003-05-30",0.2748),("2003-06-02",0.2671),("2003-06-03",0.265),("2003-06-04",0.2694),("2003-06-05",0.27),("2003-06-06",0.2625),("2003-06-09",0.257),("2003-06-10",0.263),("2003-06-11",0.2671),("2003-06-12",0.272),("2003-06-13",0.2667),("2003-06-16",0.2797),("2003-06-17",0.2785),("2003-06-18",0.2927),("2003-06-19",0.293),("2003-06-20",0.2939),("2003-06-23",0.2918),("2003-06-24",0.2875),("2003-06-25",0.2922),("2003-06-26",0.2953),("2003-06-27",0.2867),("2003-06-30",0.2918),("2003-07-01",0.2922),("2003-07-02",0.295),("2003-07-03",0.2928),("2003-07-07",0.3042),("2003-07-08",0.3123),("2003-07-09",0.3045),("2003-07-10",0.2997),("2003-07-11",0.3039),("2003-07-14",0.3046),("2003-07-15",0.3002),("2003-07-16",0.3042),("2003-07-17",0.3199),("2003-07-18",0.3193),("2003-07-21",0.3155),("2003-07-22",0.3184),("2003-07-23",0.3183),("2003-07-24",0.314),("2003-07-25",0.3297),("2003-07-28",0.3213),("2003-07-29",0.3172),("2003-07-30",0.3105),("2003-07-31",0.3227),("2003-08-01",0.3173),("2003-08-04",0.3247),("2003-08-05",0.312),("2003-08-06",0.3005),("2003-08-07",0.3051),("2003-08-08",0.3007),("2003-08-11",0.301),("2003-08-12",0.3016),("2003-08-13",0.3089),("2003-08-14",0.3057),("2003-08-15",0.3017),("2003-08-18",0.3114),("2003-08-19",0.3111),("2003-08-20",0.3216),("2003-08-21",0.3319),("2003-08-22",0.3196),("2003-08-25",0.3193),("2003-08-26",0.3222),("2003-08-27",0.3288),("2003-08-28",0.3397),("2003-08-29",0.3461),("2003-09-02",0.3498),("2003-09-03",0.3513),("2003-09-04",0.3495),("2003-09-05",0.3444),("2003-09-08",0.3481),("2003-09-09",0.3424),("2003-09-10",0.3395),("2003-09-11",0.3454),("2003-09-12",0.3536),("2003-09-15",0.34),("2003-09-16",0.3423),("2003-09-17",0.3386),("2003-09-18",0.3503),("2003-09-19",0.3457),("2003-09-22",0.338),("2003-09-23",0.3434),("2003-09-24",0.3264),("2003-09-25",0.3127),("2003-09-26",0.3167),("2003-09-29",0.3261),("2003-09-30",0.3172),("2003-10-01",0.3183),("2003-10-02",0.3149),("2003-10-03",0.332),("2003-10-06",0.3412),("2003-10-07",0.3555),("2003-10-08",0.353),("2003-10-09",0.359),("2003-10-10",0.3625),("2003-10-13",0.3728),("2003-10-14",0.3758),("2003-10-15",0.38),("2003-10-16",0.3559),("2003-10-17",0.3483),("2003-10-20",0.3555),("2003-10-21",0.3548),("2003-10-22",0.3484),("2003-10-23",0.3519),("2003-10-24",0.346),("2003-10-27",0.346),("2003-10-28",0.3631),("2003-10-29",0.3627),("2003-10-30",0.3535),("2003-10-31",0.3504),("2003-11-03",0.3544),("2003-11-04",0.3507),("2003-11-05",0.3525),("2003-11-06",0.3539),("2003-11-07",0.3444),("2003-11-10",0.3353),("2003-11-11",0.3297),("2003-11-12",0.3418),("2003-11-13",0.3432),("2003-11-14",0.3285),("2003-11-17",0.3235),("2003-11-18",0.3124),("2003-11-19",0.3126),("2003-11-20",0.3119),("2003-11-21",0.3105),("2003-11-24",0.3238),("2003-11-25",0.3166),("2003-11-26",0.3172),("2003-11-28",0.3201),("2003-12-01",0.3323),("2003-12-02",0.3297),("2003-12-03",0.3219),("2003-12-04",0.3238),("2003-12-05",0.3192),("2003-12-08",0.3222),("2003-12-09",0.3131),("2003-12-10",0.312),("2003-12-11",0.3247),("2003-12-12",0.3198),("2003-12-15",0.3088),("2003-12-16",0.308),("2003-12-17",0.3043),("2003-12-18",0.3068),("2003-12-19",0.3016),("2003-12-22",0.3039),("2003-12-23",0.3033),("2003-12-24",0.3124),("2003-12-26",0.3181),("2003-12-29",0.3238),("2003-12-30",0.3258),("2003-12-31",0.3271),("2004-01-02",0.3258),("2004-01-05",0.3394),("2004-01-06",0.3382),("2004-01-07",0.3458),("2004-01-08",0.3576),("2004-01-09",0.3521),("2004-01-12",0.3633),("2004-01-13",0.3692),("2004-01-14",0.3705),("2004-01-15",0.3498),("2004-01-16",0.3478),("2004-01-20",0.348),("2004-01-21",0.3461),("2004-01-22",0.3395),("2004-01-23",0.3454),("2004-01-26",0.3522),("2004-01-27",0.3532),("2004-01-28",0.3447),("2004-01-29",0.3472),("2004-01-30",0.3454),("2004-02-02",0.3417),("2004-02-03",0.3408),("2004-02-04",0.3336),("2004-02-05",0.3432),("2004-02-06",0.3477),("2004-02-09",0.347),("2004-02-10",0.3518),("2004-02-11",0.3643),("2004-02-12",0.3633),("2004-02-13",0.3521),("2004-02-17",0.3545),("2004-02-18",0.3561),("2004-02-19",0.344),("2004-02-20",0.3429),("2004-02-23",0.3397),("2004-02-24",0.3423),("2004-02-25",0.3492),("2004-02-26",0.3527),("2004-02-27",0.3662),("2004-03-01",0.3677),("2004-03-02",0.3645),("2004-03-03",0.3662),("2004-03-04",0.3852),("2004-03-05",0.4093),("2004-03-08",0.398),("2004-03-09",0.4149),("2004-03-10",0.4237),("2004-03-11",0.4156),("2004-03-12",0.4219),("2004-03-15",0.4049),("2004-03-16",0.3953),("2004-03-17",0.4009),("2004-03-18",0.393),("2004-03-19",0.3959),("2004-03-22",0.3959),("2004-03-23",0.3871),("2004-03-24",0.3904),("2004-03-25",0.4113),("2004-03-26",0.4139),("2004-03-29",0.4273),("2004-03-30",0.4274),("2004-03-31",0.4139),("2004-04-01",0.415),("2004-04-02",0.421),("2004-04-05",0.4335),("2004-04-06",0.426),("2004-04-07",0.4181),("2004-04-08",0.4214),("2004-04-12",0.4292),("2004-04-13",0.4123),("2004-04-14",0.4078),("2004-04-15",0.4485),("2004-04-16",0.4467),("2004-04-19",0.434),("2004-04-20",0.4245),("2004-04-21",0.4245),("2004-04-22",0.4253),("2004-04-23",0.424),("2004-04-26",0.4153),("2004-04-27",0.4124),("2004-04-28",0.4049),("2004-04-29",0.4098),("2004-04-30",0.3946),("2004-05-03",0.3991),("2004-05-04",0.4002),("2004-05-05",0.408),("2004-05-06",0.4069),("2004-05-07",0.4083),("2004-05-10",0.4023),("2004-05-11",0.4155),("2004-05-12",0.4179),("2004-05-13",0.4162),("2004-05-14",0.4142),("2004-05-17",0.4078),("2004-05-18",0.4142),("2004-05-19",0.4052),("2004-05-20",0.4089),("2004-05-21",0.415),("2004-05-24",0.4185),("2004-05-25",0.4349),("2004-05-26",0.4364),("2004-05-27",0.4312),("2004-05-28",0.4295),("2004-06-01",0.4295),("2004-06-02",0.4427),("2004-06-03",0.4348),("2004-06-04",0.4406),("2004-06-07",0.4563),("2004-06-08",0.4646),("2004-06-09",0.4623),("2004-06-10",0.4706),("2004-06-14",0.4611),("2004-06-15",0.4698),("2004-06-16",0.5012),("2004-06-17",0.5023),("2004-06-18",0.5038),("2004-06-21",0.4949),("2004-06-22",0.5052),("2004-06-23",0.5159),("2004-06-24",0.5079),("2004-06-25",0.5159),("2004-06-28",0.4974),("2004-06-29",0.4975),("2004-06-30",0.4981),("2004-07-01",0.4945),("2004-07-02",0.4758),("2004-07-06",0.4738),("2004-07-07",0.4652),("2004-07-08",0.4614),("2004-07-09",0.4597),("2004-07-12",0.4461),("2004-07-13",0.4473),("2004-07-14",0.4528),("2004-07-15",0.5041),("2004-07-16",0.4929),("2004-07-19",0.4894),("2004-07-20",0.4929),("2004-07-21",0.484),("2004-07-22",0.485),("2004-07-23",0.47),("2004-07-26",0.4785),("2004-07-27",0.4964),("2004-07-28",0.494),("2004-07-29",0.4997),("2004-07-30",0.4951),("2004-08-02",0.4834),("2004-08-03",0.479),("2004-08-04",0.4866),("2004-08-05",0.4805),("2004-08-06",0.4559),("2004-08-09",0.4638),("2004-08-10",0.4825),("2004-08-11",0.4747),("2004-08-12",0.4649),("2004-08-13",0.4721),("2004-08-16",0.4712),("2004-08-17",0.4726),("2004-08-18",0.4859),("2004-08-19",0.4701),("2004-08-20",0.4715),("2004-08-23",0.4758),("2004-08-24",0.4891),("2004-08-25",0.5059),("2004-08-26",0.5306),("2004-08-27",0.5258),("2004-08-30",0.5223),("2004-08-31",0.528),("2004-09-01",0.549),("2004-09-02",0.5459),("2004-09-03",0.5393),("2004-09-07",0.5474),("2004-09-08",0.5565),("2004-09-09",0.5465),("2004-09-10",0.5491),("2004-09-13",0.5448),("2004-09-14",0.5433),("2004-09-15",0.5389),("2004-09-16",0.5565),("2004-09-17",0.5685),("2004-09-20",0.5773),("2004-09-21",0.5819),("2004-09-22",0.5652),("2004-09-23",0.5705),("2004-09-24",0.5708),("2004-09-27",0.5745),("2004-09-28",0.5823),("2004-09-29",0.5921),("2004-09-30",0.5932),("2004-10-01",0.592),("2004-10-04",0.5938),("2004-10-05",0.6027),("2004-10-06",0.6221),("2004-10-07",0.6065),("2004-10-08",0.5979),("2004-10-11",0.5907),("2004-10-12",0.5862),("2004-10-13",0.6085),("2004-10-14",0.6886),("2004-10-15",0.6965),("2004-10-18",0.731),("2004-10-19",0.7259),("2004-10-20",0.7267),("2004-10-21",0.7339),("2004-10-22",0.7258),("2004-10-25",0.7279),("2004-10-26",0.7343),("2004-10-27",0.77),("2004-10-28",0.7989),("2004-10-29",0.8022),("2004-11-01",0.8029),("2004-11-02",0.819),("2004-11-03",0.8467),("2004-11-04",0.8335),("2004-11-05",0.8377),("2004-11-08",0.8325),("2004-11-09",0.8274),("2004-11-10",0.8381),("2004-11-11",0.8465),("2004-11-12",0.8496),("2004-11-15",0.8456),("2004-11-16",0.841),("2004-11-17",0.8404),("2004-11-18",0.8479),("2004-11-19",0.8446),("2004-11-22",0.9392),("2004-11-23",0.9379),("2004-11-24",0.9805),("2004-11-26",0.9881),("2004-11-29",1.0477),("2004-11-30",1.0264),("2004-12-01",1.0377),("2004-12-02",0.9983),("2004-12-03",0.9595),("2004-12-06",1.007),("2004-12-07",0.9627),("2004-12-08",0.9687),("2004-12-09",0.9796),("2004-12-10",0.9973),("2004-12-13",0.9937),("2004-12-14",0.9995),("2004-12-15",0.999),("2004-12-16",1.0195),("2004-12-17",0.9949),("2004-12-20",0.9601),("2004-12-21",0.975),("2004-12-22",0.9759),("2004-12-23",0.9799),("2004-12-27",0.9669),("2004-12-28",0.9825),("2004-12-29",0.9865),("2004-12-30",0.992),("2004-12-31",0.9859),("2005-01-03",0.9689),("2005-01-04",0.9788),("2005-01-05",0.9874),("2005-01-06",0.9881),("2005-01-07",1.0601),("2005-01-10",1.0557),("2005-01-11",0.9883),("2005-01-12",1.0021),("2005-01-13",1.0685),("2005-01-14",1.0746),("2005-01-18",1.0815),("2005-01-19",1.0697),("2005-01-20",1.0786),("2005-01-21",1.0791),("2005-01-24",1.0832),("2005-01-25",1.103),("2005-01-26",1.106),("2005-01-27",1.112),("2005-01-28",1.1325),("2005-01-31",1.1772),("2005-02-01",1.1868),("2005-02-02",1.219),("2005-02-03",1.1911),("2005-02-04",1.2069),("2005-02-07",1.2084),("2005-02-08",1.2384),("2005-02-09",1.2054),("2005-02-10",1.1996),("2005-02-11",1.2432),("2005-02-14",1.2955),("2005-02-15",1.3534),("2005-02-16",1.3797),("2005-02-17",1.3442),("2005-02-18",1.3289),("2005-02-22",1.3056),("2005-02-23",1.3506),("2005-02-24",1.3614),("2005-02-25",1.3623),("2005-02-28",1.3735),("2005-03-01",1.3624),("2005-03-02",1.3508),("2005-03-03",1.2795),("2005-03-04",1.3107),("2005-03-07",1.3089),("2005-03-08",1.2409),("2005-03-09",1.2048),("2005-03-10",1.2195),("2005-03-11",1.2329),("2005-03-14",1.2345),("2005-03-15",1.2541),("2005-03-16",1.2608),("2005-03-17",1.2935),("2005-03-18",1.3153),("2005-03-21",1.3379),("2005-03-22",1.3113),("2005-03-23",1.3027),("2005-03-24",1.3012),("2005-03-28",1.3021),("2005-03-29",1.2782),("2005-03-30",1.3104),("2005-03-31",1.2758),("2005-04-01",1.2519),("2005-04-04",1.258),("2005-04-05",1.2825),("2005-04-06",1.296),("2005-04-07",1.3337),("2005-04-08",1.3392),("2005-04-11",1.2834),("2005-04-12",1.3061),("2005-04-13",1.2565),("2005-04-14",1.1408),("2005-04-15",1.0823),("2005-04-18",1.0906),("2005-04-19",1.1356),("2005-04-20",1.0872),("2005-04-21",1.1371),("2005-04-22",1.0869),("2005-04-25",1.1322),("2005-04-26",1.108),("2005-04-27",1.1007),("2005-04-28",1.0881),("2005-04-29",1.104),("2005-05-02",1.1154),("2005-05-03",1.1086),("2005-05-04",1.1374),("2005-05-05",1.123),("2005-05-06",1.1402),("2005-05-09",1.1319),("2005-05-10",1.1151),("2005-05-11",1.0903),("2005-05-12",1.0449),("2005-05-13",1.0645),("2005-05-16",1.0884),("2005-05-17",1.0826),("2005-05-18",1.0973),("2005-05-19",1.1496),("2005-05-20",1.1496),("2005-05-23",1.2173),("2005-05-24",1.2155),("2005-05-25",1.2179),("2005-05-26",1.2473),("2005-05-27",1.2418),("2005-05-31",1.2173),("2005-06-01",1.2338),("2005-06-02",1.2259),("2005-06-03",1.1708),("2005-06-06",1.161),("2005-06-07",1.1187),("2005-06-08",1.1304),("2005-06-09",1.1527),("2005-06-10",1.0964),("2005-06-13",1.0991),("2005-06-14",1.1022),("2005-06-15",1.1368),("2005-06-16",1.1628),("2005-06-17",1.1729),("2005-06-20",1.1515),("2005-06-21",1.1591),("2005-06-22",1.1803),("2005-06-23",1.1907),("2005-06-24",1.1561),("2005-06-27",1.1359),("2005-06-28",1.1423),("2005-06-29",1.1135),("2005-06-30",1.127),("2005-07-01",1.1175),("2005-07-05",1.1628),("2005-07-06",1.1448),("2005-07-07",1.1521),("2005-07-08",1.1711),("2005-07-11",1.1665),("2005-07-12",1.1708),("2005-07-13",1.1741),("2005-07-14",1.2476),("2005-07-15",1.2721),("2005-07-18",1.2703),("2005-07-19",1.3223),("2005-07-20",1.3358),("2005-07-21",1.3254),("2005-07-22",1.3471),("2005-07-25",1.3413),("2005-07-26",1.3358),("2005-07-27",1.3468),("2005-07-28",1.341),("2005-07-29",1.3058),("2005-08-01",1.3089),("2005-08-02",1.3223),("2005-08-03",1.3232),("2005-08-04",1.3076),("2005-08-05",1.3162),("2005-08-08",1.3058),("2005-08-09",1.3416),("2005-08-10",1.3281),("2005-08-11",1.3471),("2005-08-12",1.4114),("2005-08-15",1.4598),("2005-08-16",1.416),("2005-08-17",1.4436),("2005-08-18",1.4175),("2005-08-19",1.4032),("2005-08-22",1.4044),("2005-08-23",1.4004),("2005-08-24",1.4013),("2005-08-25",1.4102),("2005-08-26",1.4004),("2005-08-29",1.4035),("2005-08-30",1.4258),("2005-08-31",1.4356),("2005-09-01",1.4163),("2005-09-02",1.4151),("2005-09-06",1.4941),("2005-09-07",1.4904),("2005-09-08",1.5241),("2005-09-09",1.5709),("2005-09-12",1.5737),("2005-09-13",1.5559),("2005-09-14",1.5189),("2005-09-15",1.5268),("2005-09-16",1.5679),("2005-09-19",1.6117),("2005-09-20",1.6285),("2005-09-21",1.5954),("2005-09-22",1.589),("2005-09-23",1.6288),("2005-09-26",1.6484),("2005-09-27",1.6361),("2005-09-28",1.5639),("2005-09-29",1.6025),("2005-09-30",1.6413),("2005-10-03",1.6668),("2005-10-04",1.6456),("2005-10-05",1.6159),("2005-10-06",1.5829),("2005-10-07",1.5706),("2005-10-10",1.5422),("2005-10-11",1.5795),("2005-10-12",1.5079),("2005-10-13",1.6453),("2005-10-14",1.6533),("2005-10-17",1.6361),("2005-10-18",1.5985),("2005-10-19",1.6821),("2005-10-20",1.7188),("2005-10-21",1.7041),("2005-10-24",1.7387),("2005-10-25",1.7176),("2005-10-26",1.7461),("2005-10-27",1.6965),("2005-10-28",1.6677),("2005-10-31",1.7632),("2005-11-01",1.7604),("2005-11-02",1.8355),("2005-11-03",1.8936),("2005-11-04",1.8722),("2005-11-07",1.844),("2005-11-08",1.8339),("2005-11-09",1.8404),("2005-11-10",1.8731),("2005-11-11",1.8841),("2005-11-14",1.8814),("2005-11-15",1.9068),("2005-11-16",1.9885),("2005-11-17",1.9754),("2005-11-18",1.9766),("2005-11-21",1.9888),("2005-11-22",2.0366),("2005-11-23",2.0547),("2005-11-25",2.1229),("2005-11-28",2.1327),("2005-11-29",2.085),("2005-11-30",2.0764),("2005-12-01",2.1921),("2005-12-02",2.2237),("2005-12-05",2.1989),("2005-12-06",2.2672),("2005-12-07",2.2641),("2005-12-08",2.2681),("2005-12-09",2.2757),("2005-12-12",2.2935),("2005-12-13",2.2956),("2005-12-14",2.2047),("2005-12-15",2.2099),("2005-12-16",2.1771),("2005-12-19",2.1854),("2005-12-20",2.2078),("2005-12-21",2.2503),("2005-12-22",2.2662),("2005-12-23",2.2457),("2005-12-27",2.2727),("2005-12-28",2.2525),("2005-12-29",2.1875),("2005-12-30",2.201),("2006-01-03",2.2886),("2006-01-04",2.2953),("2006-01-05",2.2773),("2006-01-06",2.336),("2006-01-09",2.3284),("2006-01-10",2.4756),("2006-01-11",2.5687),("2006-01-12",2.5807),("2006-01-13",2.6205),("2006-01-17",2.5935),("2006-01-18",2.5256),("2006-01-19",2.4198),("2006-01-20",2.3296),("2006-01-23",2.378),("2006-01-24",2.3281),("2006-01-25",2.2717),("2006-01-26",2.2145),("2006-01-27",2.2053),("2006-01-30",2.2962),("2006-01-31",2.3119),("2006-02-01",2.3091),("2006-02-02",2.2074),("2006-02-03",2.1997),("2006-02-06",2.0605),("2006-02-07",2.0697),("2006-02-08",2.1067),("2006-02-09",1.9885),("2006-02-10",2.0608),("2006-02-13",1.9812),("2006-02-14",2.0711),("2006-02-15",2.1193),("2006-02-16",2.1606),("2006-02-17",2.152),("2006-02-21",2.115),("2006-02-22",2.1836),("2006-02-23",2.1967),("2006-02-24",2.1879),("2006-02-27",2.1735),("2006-02-28",2.0969),("2006-03-01",2.1156),("2006-03-02",2.1312),("2006-03-03",2.0733),("2006-03-06",2.0048),("2006-03-07",2.0302),("2006-03-08",2.0103),("2006-03-09",1.9573),("2006-03-10",1.9347),("2006-03-13",2.0109),("2006-03-14",2.0611),("2006-03-15",2.0277),("2006-03-16",1.9689),("2006-03-17",1.9797),("2006-03-20",1.9591),("2006-03-21",1.8924),("2006-03-22",1.8881),("2006-03-23",1.8419),("2006-03-24",1.8358),("2006-03-27",1.822),("2006-03-28",1.7975),("2006-03-29",1.9083),("2006-03-30",1.9212),("2006-03-31",1.9203),("2006-04-03",1.9181),("2006-04-04",1.8728),("2006-04-05",2.0577),("2006-04-06",2.1811),("2006-04-07",2.1367),("2006-04-10",2.1024),("2006-04-11",2.0816),("2006-04-12",2.0424),("2006-04-13",2.035),("2006-04-17",1.9843),("2006-04-18",2.0274),("2006-04-19",2.01),("2006-04-20",2.0706),("2006-04-21",2.0525),("2006-04-24",2.013),("2006-04-25",2.0259),("2006-04-26",2.0865),("2006-04-27",2.1236),("2006-04-28",2.1551),("2006-05-01",2.1309),("2006-05-02",2.1928),("2006-05-03",2.1781),("2006-05-04",2.1778),("2006-05-05",2.201),("2006-05-08",2.201),("2006-05-09",2.1747),("2006-05-10",2.1615),("2006-05-11",2.0865),("2006-05-12",2.0727),("2006-05-15",2.0755),("2006-05-16",1.9895),("2006-05-17",1.998),("2006-05-18",1.9343),("2006-05-19",1.9751),("2006-05-22",1.9405),("2006-05-23",1.9334),("2006-05-24",1.9392),("2006-05-25",1.9696),("2006-05-26",1.9456),("2006-05-30",1.8743),("2006-05-31",1.8299),("2006-06-01",1.9034),("2006-06-02",1.8878),("2006-06-05",1.837),("2006-06-06",1.8285),("2006-06-07",1.7931),("2006-06-08",1.8603),("2006-06-09",1.8223),("2006-06-12",1.7451),("2006-06-13",1.7859),("2006-06-14",1.7638),("2006-06-15",1.818),("2006-06-16",1.7623),("2006-06-19",1.7513),("2006-06-20",1.7595),("2006-06-21",1.7715),("2006-06-22",1.8241),("2006-06-23",1.8012),("2006-06-26",1.8061),("2006-06-27",1.7583),("2006-06-28",1.7151),("2006-06-29",1.8055),("2006-06-30",1.7534),("2006-07-03",1.7742),("2006-07-05",1.7452),("2006-07-06",1.7075),("2006-07-07",1.6962),("2006-07-10",1.6839),("2006-07-11",1.7038),("2006-07-12",1.6214),("2006-07-13",1.5997),("2006-07-14",1.5513),("2006-07-17",1.6034),("2006-07-18",1.6196),("2006-07-19",1.6564),("2006-07-20",1.8523),("2006-07-21",1.859),("2006-07-24",1.8805),("2006-07-25",1.896),("2006-07-26",1.9555),("2006-07-27",1.9411),("2006-07-28",2.0081),("2006-07-31",2.0807),("2006-08-01",2.0568),("2006-08-02",2.0868),("2006-08-03",2.1306),("2006-08-04",2.0911),("2006-08-07",2.0577),("2006-08-08",1.9833),("2006-08-09",1.9469),("2006-08-10",1.9616),("2006-08-11",1.9487),("2006-08-14",1.9576),("2006-08-15",2.0345),("2006-08-16",2.0813),("2006-08-17",2.0694),("2006-08-18",2.0792),("2006-08-21",2.0378),("2006-08-22",2.0703),("2006-08-23",2.0608),("2006-08-24",2.0761),("2006-08-25",2.1049),("2006-08-28",2.0507),("2006-08-29",2.0354),("2006-08-30",2.0501),("2006-08-31",2.0773),("2006-09-01",2.0936),("2006-09-05",2.1885),("2006-09-06",2.1441),("2006-09-07",2.2289),("2006-09-08",2.2203),("2006-09-11",2.2197),("2006-09-12",2.2237),("2006-09-13",2.2717),("2006-09-14",2.2708),("2006-09-15",2.2687),("2006-09-18",2.2623),("2006-09-19",2.2586),("2006-09-20",2.3042),("2006-09-21",2.2855),("2006-09-22",2.235),("2006-09-25",2.3192),("2006-09-26",2.3761),("2006-09-27",2.3394),("2006-09-28",2.3578),("2006-09-29",2.3569),("2006-10-02",2.292),("2006-10-03",2.2678),("2006-10-04",2.3079),("2006-10-05",2.291),("2006-10-06",2.2724),("2006-10-09",2.2849),("2006-10-10",2.2598),("2006-10-11",2.242),("2006-10-12",2.3042),("2006-10-13",2.2968),("2006-10-16",2.3085),("2006-10-17",2.2745),("2006-10-18",2.2818),("2006-10-19",2.4184),("2006-10-20",2.4478),("2006-10-23",2.494),("2006-10-24",2.4815),("2006-10-25",2.5008),("2006-10-26",2.5164),("2006-10-27",2.4619),("2006-10-30",2.4622),("2006-10-31",2.4824),("2006-11-01",2.4236),("2006-11-02",2.4181),("2006-11-03",2.397),("2006-11-06",2.4404),("2006-11-07",2.4649),("2006-11-08",2.5243),("2006-11-09",2.5516),("2006-11-10",2.5448),("2006-11-13",2.5825),("2006-11-14",2.6024),("2006-11-15",2.5733),("2006-11-16",2.6211),("2006-11-17",2.6284),("2006-11-20",2.6474),("2006-11-21",2.7126),("2006-11-22",2.765),("2006-11-24",2.8054),("2006-11-27",2.7414),("2006-11-28",2.8109),("2006-11-29",2.8106),("2006-11-30",2.8063),("2006-12-01",2.7959),("2006-12-04",2.7898),("2006-12-05",2.7944),("2006-12-06",2.7503),("2006-12-07",2.6649),("2006-12-08",2.7022),("2006-12-11",2.7172),("2006-12-12",2.6373),("2006-12-13",2.7264),("2006-12-14",2.7111),("2006-12-15",2.6857),("2006-12-18",2.6168),("2006-12-19",2.6425),("2006-12-20",2.5951),("2006-12-21",2.5381),("2006-12-22",2.5167),("2006-12-26",2.4955),("2006-12-27",2.4959),("2006-12-28",2.476),("2006-12-29",2.5975),("2007-01-03",2.5657),("2007-01-04",2.6226),("2007-01-05",2.6039),("2007-01-08",2.6168),("2007-01-09",2.8342),("2007-01-10",2.9698),("2007-01-11",2.9331),("2007-01-12",2.8969),("2007-01-16",2.9729),("2007-01-17",2.907),("2007-01-18",2.727),("2007-01-19",2.7096),("2007-01-22",2.6572),("2007-01-23",2.6238),("2007-01-24",2.6544),("2007-01-25",2.6407),("2007-01-26",2.614),("2007-01-29",2.6312),("2007-01-30",2.6192),("2007-01-31",2.6248),("2007-02-01",2.5944),("2007-02-02",2.5947),("2007-02-05",2.5699),("2007-02-06",2.5764),("2007-02-07",2.6376),("2007-02-08",2.6385),("2007-02-09",2.5494),("2007-02-12",2.5987),("2007-02-13",2.5932),("2007-02-14",2.6116),("2007-02-15",2.6088),("2007-02-16",2.5972),("2007-02-20",2.63),("2007-02-21",2.731),("2007-02-22",2.7405),("2007-02-23",2.727),("2007-02-26",2.7142),("2007-02-27",2.5696),("2007-02-28",2.5905),("2007-03-01",2.6655),("2007-03-02",2.615),("2007-03-05",2.6428),("2007-03-06",2.7001),("2007-03-07",2.6857),("2007-03-08",2.6943),("2007-03-09",2.6933),("2007-03-12",2.7515),("2007-03-13",2.7065),("2007-03-14",2.7555),("2007-03-15",2.7423),("2007-03-16",2.7429),("2007-03-19",2.7901),("2007-03-20",2.8008),("2007-03-21",2.874),("2007-03-22",2.8767),("2007-03-23",2.8633),("2007-03-26",2.9346),("2007-03-27",2.9226),("2007-03-28",2.8547),("2007-03-29",2.8703),("2007-03-30",2.8446),("2007-04-02",2.8672),("2007-04-03",2.8933),("2007-04-04",2.8862),("2007-04-05",2.8988),("2007-04-09",2.8672),("2007-04-10",2.8856),("2007-04-11",2.8348),("2007-04-12",2.8225),("2007-04-13",2.7628),("2007-04-16",2.7993),("2007-04-17",2.7662),("2007-04-18",2.7677),("2007-04-19",2.7638),("2007-04-20",2.7852),("2007-04-23",2.8629),("2007-04-24",2.8547),("2007-04-25",2.9192),("2007-04-26",3.0261),("2007-04-27",3.0592),("2007-04-30",3.0555),("2007-05-01",3.0454),("2007-05-02",3.0736),("2007-05-03",3.0739),("2007-05-04",3.0864),("2007-05-07",3.1817),("2007-05-08",3.2166),("2007-05-09",3.2723),("2007-05-10",3.2864),("2007-05-11",3.3292),("2007-05-14",3.3482),("2007-05-15",3.2919),("2007-05-16",3.2864),("2007-05-17",3.3507),("2007-05-18",3.3684),("2007-05-21",3.4284),("2007-05-22",3.4762),("2007-05-23",3.4563),("2007-05-24",3.3889),("2007-05-25",3.4786),("2007-05-29",3.501),("2007-05-30",3.6363),("2007-05-31",3.7104),("2007-06-01",3.625),("2007-06-04",3.7147),("2007-06-05",3.7557),("2007-06-06",3.7854),("2007-06-07",3.7986),("2007-06-08",3.8114),("2007-06-11",3.6798),("2007-06-12",3.6856),("2007-06-13",3.5974),("2007-06-14",3.6357),("2007-06-15",3.6893),("2007-06-18",3.8298),("2007-06-19",3.786),("2007-06-20",3.7214),("2007-06-21",3.7934),("2007-06-22",3.7658),("2007-06-25",3.7456),("2007-06-26",3.6633),("2007-06-27",3.7318),("2007-06-28",3.6911),("2007-06-29",3.7364),("2007-07-02",3.7126),("2007-07-03",3.8935),("2007-07-05",4.0643),("2007-07-06",4.0506),("2007-07-09",3.9902),("2007-07-10",4.0521),("2007-07-11",4.0533),("2007-07-12",4.1047),("2007-07-13",4.2168),("2007-07-16",4.2281),("2007-07-17",4.2529),("2007-07-18",4.2287),("2007-07-19",4.2863),("2007-07-20",4.4011),("2007-07-23",4.3996),("2007-07-24",4.1299),("2007-07-25",4.2024),("2007-07-26",4.47),("2007-07-27",4.4042),("2007-07-30",4.3301),("2007-07-31",4.034),("2007-08-01",4.1332),("2007-08-02",4.1788),("2007-08-03",4.0368),("2007-08-06",4.1409),("2007-08-07",4.1341),("2007-08-08",4.1029),("2007-08-09",3.8696),("2007-08-10",3.8271),("2007-08-13",3.9125),("2007-08-14",3.7974),("2007-08-15",3.6709),("2007-08-16",3.5837),("2007-08-17",3.737),("2007-08-20",3.7419),("2007-08-21",3.9057),("2007-08-22",4.057),("2007-08-23",4.0129),("2007-08-24",4.1424),("2007-08-27",4.049),("2007-08-28",3.8828),("2007-08-29",4.1051),("2007-08-30",4.1715),("2007-08-31",4.2398),("2007-09-04",4.4137),("2007-09-05",4.1871),("2007-09-06",4.1335),("2007-09-07",4.0343),("2007-09-10",4.1856),("2007-09-11",4.1482),("2007-09-12",4.1899),("2007-09-13",4.2006),("2007-09-14",4.2499),("2007-09-17",4.2376),("2007-09-18",4.3145),("2007-09-19",4.3099),("2007-09-20",4.2958),("2007-09-21",4.4134),("2007-09-24",4.5398),("2007-09-25",4.6898),("2007-09-26",4.6773),("2007-09-27",4.7302),("2007-09-28",4.6987),("2007-10-01",4.7866),("2007-10-02",4.8512),("2007-10-03",4.835),("2007-10-04",4.7835),("2007-10-05",4.943),("2007-10-08",5.1408),("2007-10-09",5.1393),("2007-10-10",5.1065),("2007-10-11",4.9669),("2007-10-12",5.1207),("2007-10-15",5.1123),("2007-10-16",5.1919),("2007-10-17",5.289),("2007-10-18",5.312),("2007-10-19",5.2177),("2007-10-22",5.3383),("2007-10-23",5.6996),("2007-10-24",5.6925),("2007-10-25",5.5961),("2007-10-26",5.6549),("2007-10-29",5.6668),("2007-10-30",5.7253),("2007-10-31",5.8156),("2007-11-01",5.7388),("2007-11-02",5.7519),("2007-11-05",5.7002),("2007-11-06",5.8719),("2007-11-07",5.7038),("2007-11-08",5.3722),("2007-11-09",5.063),("2007-11-12",4.7076),("2007-11-13",5.2036),("2007-11-14",5.0857),("2007-11-15",5.0303),("2007-11-16",5.0943),("2007-11-19",5.0196),("2007-11-20",5.1696),("2007-11-21",5.1577),("2007-11-23",5.252),("2007-11-26",5.2826),("2007-11-27",5.3521),("2007-11-28",5.5177),("2007-11-29",5.6423),("2007-11-30",5.5789),("2007-12-03",5.4761),("2007-12-04",5.5052),("2007-12-05",5.6794),("2007-12-06",5.8157),("2007-12-07",5.9488),("2007-12-10",5.946),("2007-12-11",5.7724),("2007-12-12",5.8435),("2007-12-13",5.8732),("2007-12-14",5.8291),("2007-12-17",5.6457),("2007-12-18",5.6022),("2007-12-19",5.6065),("2007-12-20",5.7317),("2007-12-21",5.9368),("2007-12-24",6.0866),("2007-12-26",6.0911),("2007-12-27",6.0795),("2007-12-28",6.1181),("2007-12-31",6.0645),("2008-01-02",5.9653),("2008-01-03",5.9681),("2008-01-04",5.5125),("2008-01-07",5.4387),("2008-01-08",5.2431),("2008-01-09",5.4926),("2008-01-10",5.4503),("2008-01-11",5.2872),("2008-01-14",5.4736),("2008-01-15",5.1754),("2008-01-16",4.8876),("2008-01-17",4.9259),("2008-01-18",4.9403),("2008-01-22",4.7651),("2008-01-23",4.2579),("2008-01-24",4.1516),("2008-01-25",3.9804),("2008-01-28",3.9804),("2008-01-29",4.0273),("2008-01-30",4.0469),("2008-01-31",4.1442),("2008-02-01",4.095),("2008-02-04",4.0307),("2008-02-05",3.9605),("2008-02-06",3.7352),("2008-02-07",3.7119),("2008-02-08",3.8418),("2008-02-11",3.9633),("2008-02-12",3.8228),("2008-02-13",3.9618),("2008-02-14",3.9024),("2008-02-15",3.8157),("2008-02-19",3.7407),("2008-02-20",3.7909),("2008-02-21",3.7211),("2008-02-22",3.6574),("2008-02-25",3.666),("2008-02-26",3.648),("2008-02-27",3.7646),("2008-02-28",3.9774),("2008-02-29",3.8277),("2008-03-03",3.7269),("2008-03-04",3.8154),("2008-03-05",3.8114),("2008-03-06",3.7025),("2008-03-07",3.7429),("2008-03-10",3.6645),("2008-03-11",3.899),("2008-03-12",3.8586),("2008-03-13",3.9171),("2008-03-14",3.8764),("2008-03-17",3.88),("2008-03-18",4.0665),("2008-03-19",3.97),("2008-03-20",4.0803),("2008-03-24",4.2719),("2008-03-25",4.3163),("2008-03-26",4.4412),("2008-03-27",4.294),("2008-03-28",4.3785),("2008-03-31",4.3935),("2008-04-01",4.5781),("2008-04-02",4.5156),("2008-04-03",4.6418),("2008-04-04",4.6868),("2008-04-07",4.7728),("2008-04-08",4.6794),("2008-04-09",4.6366),("2008-04-10",4.7318),("2008-04-11",4.5049),("2008-04-14",4.5245),("2008-04-15",4.5429),("2008-04-16",4.7058),("2008-04-17",4.7299),("2008-04-18",4.9305),("2008-04-21",5.1485),("2008-04-22",4.9048),("2008-04-23",4.9871),("2008-04-24",5.1723),("2008-04-25",5.1965),("2008-04-28",5.2734),("2008-04-29",5.3594),("2008-04-30",5.3257),("2008-05-01",5.511),("2008-05-02",5.5397),("2008-05-05",5.6558),("2008-05-06",5.7149),("2008-05-07",5.5903),("2008-05-08",5.6659),("2008-05-09",5.6166),("2008-05-12",5.7608),("2008-05-13",5.8159),("2008-05-14",5.7026),("2008-05-15",5.8089),("2008-05-16",5.7443),("2008-05-19",5.6212),("2008-05-20",5.6916),("2008-05-21",5.4556),("2008-05-22",5.4206),("2008-05-23",5.5468),("2008-05-27",5.7078),("2008-05-28",5.7256),("2008-05-29",5.7158),("2008-05-30",5.7789),("2008-06-02",5.6977),("2008-06-03",5.6754),("2008-06-04",5.6699),("2008-06-05",5.7997),("2008-06-06",5.6836),("2008-06-09",5.5603),("2008-06-10",5.6836),("2008-06-11",5.5358),("2008-06-12",5.3046),("2008-06-13",5.2774),("2008-06-16",5.4142),("2008-06-17",5.5547),("2008-06-18",5.4727),("2008-06-19",5.5385),("2008-06-20",5.3662),("2008-06-23",5.3016),("2008-06-24",5.3043),("2008-06-25",5.4311),("2008-06-26",5.1515),("2008-06-27",5.2076),("2008-06-30",5.1264),("2008-07-01",5.3481),("2008-07-02",5.1491),("2008-07-03",5.2085),("2008-07-07",5.3628),("2008-07-08",5.4972),("2008-07-09",5.3349),("2008-07-10",5.4078),("2008-07-11",5.2838),("2008-07-14",5.3236),("2008-07-15",5.1938),("2008-07-16",5.2908),("2008-07-17",5.2602),("2008-07-18",5.0563),("2008-07-21",5.0912),("2008-07-22",4.9605),("2008-07-23",5.0903),("2008-07-24",4.8689),("2008-07-25",4.9635),("2008-07-28",4.7272),("2008-07-29",4.8092),("2008-07-30",4.895),("2008-07-31",4.8665),("2008-08-01",4.7964),("2008-08-04",4.6914),("2008-08-05",4.9182),("2008-08-06",5.0269),("2008-08-07",5.0079),("2008-08-08",5.191),("2008-08-11",5.3138),("2008-08-12",5.4109),("2008-08-13",5.4895),("2008-08-14",5.4901),("2008-08-15",5.3805),("2008-08-18",5.3698),("2008-08-19",5.3129),("2008-08-20",5.3836),("2008-08-21",5.3361),("2008-08-22",5.4127),("2008-08-25",5.2829),("2008-08-26",5.3162),("2008-08-27",5.3478),("2008-08-28",5.3193),("2008-08-29",5.1904),("2008-09-02",5.0882),("2008-09-03",5.1117),("2008-09-04",4.936),("2008-09-05",4.9041),("2008-09-08",4.835),("2008-09-09",4.6439),("2008-09-10",4.6418),("2008-09-11",4.6736),("2008-09-12",4.56),("2008-09-15",4.2973),("2008-09-16",4.2826),("2008-09-17",3.9137),("2008-09-18",4.1054),("2008-09-19",4.3142),("2008-09-22",4.0123),("2008-09-23",3.8834),("2008-09-24",3.9406),("2008-09-25",4.0392),("2008-09-26",3.9263),("2008-09-29",3.2227),("2008-09-30",3.4799),("2008-10-01",3.3409),("2008-10-02",3.0647),("2008-10-03",2.9719),("2008-10-06",3.0047),("2008-10-07",2.7298),("2008-10-08",2.7491),("2008-10-09",2.7169),("2008-10-10",2.9637),("2008-10-13",3.3758),("2008-10-14",3.1866),("2008-10-15",2.9989),("2008-10-16",3.1195),("2008-10-17",2.982),("2008-10-20",3.0139),("2008-10-21",2.8011),("2008-10-22",2.9658),("2008-10-23",3.0075),("2008-10-24",2.9508),("2008-10-27",2.8195),("2008-10-28",3.0589),("2008-10-29",3.201),("2008-10-30",3.3997),("2008-10-31",3.294),("2008-11-03",3.2747),("2008-11-04",3.3981),("2008-11-05",3.1627),("2008-11-06",3.0341),("2008-11-07",3.0078),("2008-11-10",2.9355),("2008-11-11",2.9015),("2008-11-12",2.7592),("2008-11-13",2.9527),("2008-11-14",2.7628),("2008-11-17",2.6985),("2008-11-18",2.7527),("2008-11-19",2.6419),("2008-11-20",2.4643),("2008-11-21",2.5283),("2008-11-24",2.8458),("2008-11-25",2.78),("2008-11-26",2.9086),("2008-11-28",2.8372),("2008-12-01",2.7227),("2008-12-02",2.8311),("2008-12-03",2.9361),("2008-12-04",2.7987),("2008-12-05",2.8779),("2008-12-08",3.0531),("2008-12-09",3.0635),("2008-12-10",3.0068),("2008-12-11",2.9086),("2008-12-12",3.0087),("2008-12-15",2.9009),("2008-12-16",2.9217),("2008-12-17",2.7298),("2008-12-18",2.738),("2008-12-19",2.7555),("2008-12-22",2.6251),("2008-12-23",2.6447),("2008-12-24",2.6036),("2008-12-26",2.6272),("2008-12-29",2.6517),("2008-12-30",2.6419),("2008-12-31",2.6131),("2009-01-02",2.7784),("2009-01-05",2.8957),("2009-01-06",2.8479),("2009-01-07",2.7864),("2009-01-08",2.8381),("2009-01-09",2.7732),("2009-01-12",2.7145),("2009-01-13",2.6854),("2009-01-14",2.6125),("2009-01-15",2.5528),("2009-01-16",2.5207),("2009-01-20",2.3942),("2009-01-21",2.536),("2009-01-22",2.7053),("2009-01-23",2.7053),("2009-01-26",2.7445),("2009-01-27",2.7778),("2009-01-28",2.8841),("2009-01-29",2.8473),("2009-01-30",2.7595),("2009-02-02",2.8017),("2009-02-03",2.8467),("2009-02-04",2.8642),("2009-02-05",2.9533),("2009-02-06",3.0531),("2009-02-09",3.1385),("2009-02-10",2.9952),("2009-02-11",2.9643),("2009-02-12",3.0393),("2009-02-13",3.0359),("2009-02-17",2.8942),("2009-02-18",2.8893),("2009-02-19",2.7751),("2009-02-20",2.7922),("2009-02-23",2.6621),("2009-02-24",2.7631),("2009-02-25",2.791),("2009-02-26",2.7307),("2009-02-27",2.7344),("2009-03-02",2.6924),("2009-03-03",2.7056),("2009-03-04",2.7913),("2009-03-05",2.72),("2009-03-06",2.6116),("2009-03-09",2.5445),("2009-03-10",2.7135),("2009-03-11",2.8375),("2009-03-12",2.9499),("2009-03-13",2.937),("2009-03-16",2.9214),("2009-03-17",3.0512),("2009-03-18",3.1082),("2009-03-19",3.1112),("2009-03-20",3.1103),("2009-03-23",3.2962),("2009-03-24",3.2708),("2009-03-25",3.2603),("2009-03-26",3.3638),("2009-03-27",3.2714),("2009-03-30",3.1991),("2009-03-31",3.2184),("2009-04-01",3.3277),("2009-04-02",3.4508),("2009-04-03",3.5512),("2009-04-06",3.6265),("2009-04-07",3.5209),("2009-04-08",3.5613),("2009-04-09",3.6608),("2009-04-13",3.6807),("2009-04-14",3.6222),("2009-04-15",3.6017),("2009-04-16",3.7184),("2009-04-17",3.7787),("2009-04-20",3.6893),("2009-04-21",3.7279),("2009-04-22",3.7202),("2009-04-23",3.8393),("2009-04-24",3.7934),("2009-04-27",3.8188),("2009-04-28",3.7934),("2009-04-29",3.8313),("2009-04-30",3.8525),("2009-05-01",3.8956),("2009-05-04",4.0435),("2009-05-05",4.0631),("2009-05-06",4.0567),("2009-05-07",3.9514),("2009-05-08",3.9553),("2009-05-11",3.967),("2009-05-12",3.8093),("2009-05-13",3.6584),("2009-05-14",3.7643),("2009-05-15",3.7481),("2009-05-18",3.8776),("2009-05-19",3.9021),("2009-05-20",3.8537),("2009-05-21",3.802),("2009-05-22",3.7505),("2009-05-26",4.004),("2009-05-27",4.0735),("2009-05-28",4.1354),("2009-05-29",4.158),("2009-06-01",4.2664),("2009-06-02",4.2707),("2009-06-03",4.3154),("2009-06-04",4.4008),("2009-06-05",4.4293),("2009-06-08",4.4042),("2009-06-09",4.3696),("2009-06-10",4.294),("2009-06-11",4.2848),("2009-06-12",4.1935),("2009-06-15",4.1666),("2009-06-16",4.1746),("2009-06-17",4.151),("2009-06-18",4.1602),("2009-06-19",4.2704),("2009-06-22",4.2058),("2009-06-23",4.1029),("2009-06-24",4.1706),("2009-06-25",4.282),("2009-06-26",4.361),("2009-06-29",4.3466),("2009-06-30",4.3607),("2009-07-01",4.373),("2009-07-02",4.2869),("2009-07-06",4.2438),("2009-07-07",4.1455),("2009-07-08",4.2012),("2009-07-09",4.1749),("2009-07-10",4.241),("2009-07-13",4.358),("2009-07-14",4.3558),("2009-07-15",4.4969),("2009-07-16",4.5165),("2009-07-17",4.6461),("2009-07-20",4.6815),("2009-07-21",4.6387),("2009-07-22",4.7988),("2009-07-23",4.8319),("2009-07-24",4.8982),("2009-07-27",4.9017),("2009-07-28",4.8986),("2009-07-29",4.8996),("2009-07-30",4.9841),("2009-07-31",5.0024),("2009-08-03",5.0955),("2009-08-04",5.0686),("2009-08-05",5.0551),("2009-08-06",5.0183),("2009-08-07",5.0673),("2009-08-10",5.0431),("2009-08-11",4.9853),("2009-08-12",5.0612),("2009-08-13",5.1564),("2009-08-14",5.1062),("2009-08-17",4.8861),("2009-08-18",5.0211),("2009-08-19",5.0395),("2009-08-20",5.0924),("2009-08-21",5.1809),("2009-08-24",5.176),("2009-08-25",5.1864),("2009-08-26",5.1255),("2009-08-27",5.188),("2009-08-28",5.2063),("2009-08-31",5.15),("2009-09-01",5.0608),("2009-09-02",5.0572),("2009-09-03",5.0992),("2009-09-04",5.2143),("2009-09-08",5.2945),("2009-09-09",5.2397),("2009-09-10",5.2832),("2009-09-11",5.2709),("2009-09-14",5.3187),("2009-09-15",5.3628),("2009-09-16",5.5682),("2009-09-17",5.6503),("2009-09-18",5.6647),("2009-09-21",5.634),("2009-09-22",5.6481),("2009-09-23",5.6794),("2009-09-24",5.6279),("2009-09-25",5.5835),("2009-09-28",5.6993),("2009-09-29",5.6757),("2009-09-30",5.6748),("2009-10-01",5.5373),("2009-10-02",5.661),("2009-10-05",5.6954),("2009-10-06",5.8174),("2009-10-07",5.8248),("2009-10-08",5.7948),("2009-10-09",5.8315),("2009-10-12",5.8419),("2009-10-13",5.8177),("2009-10-14",5.8566),("2009-10-15",5.8343),("2009-10-16",5.7574),("2009-10-19",5.8128),("2009-10-20",6.0853),("2009-10-21",6.2739),("2009-10-22",6.2825),("2009-10-23",6.2439),("2009-10-26",6.1992),("2009-10-27",6.0428),("2009-10-28",5.8906),("2009-10-29",6.0115),("2009-10-30",5.7712),("2009-11-02",5.796),("2009-11-03",5.7789),("2009-11-04",5.8419),("2009-11-05",5.9405),("2009-11-06",5.95),("2009-11-09",6.168),("2009-11-10",6.2145),("2009-11-11",6.2228),("2009-11-12",6.1842),("2009-11-13",6.2595),("2009-11-16",6.3263),("2009-11-17",6.3376),("2009-11-18",6.3058),("2009-11-19",6.1389),("2009-11-20",6.1208),("2009-11-23",6.3033),("2009-11-24",6.2592),("2009-11-25",6.2516),("2009-11-27",6.1414),("2009-11-30",6.1205),("2009-12-01",6.0305),("2009-12-02",6.0079),("2009-12-03",6.0155),("2009-12-04",5.9188),("2009-12-07",5.785),("2009-12-08",5.8132),("2009-12-09",6.0559),("2009-12-10",6.014),("2009-12-11",5.9601),("2009-12-14",6.0308),("2009-12-15",5.9448),("2009-12-16",5.9711),("2009-12-17",5.8741),("2009-12-18",5.9834),("2009-12-21",6.0691),("2009-12-22",6.1343),("2009-12-23",6.1876),("2009-12-24",6.4001),("2009-12-28",6.4788),("2009-12-29",6.4019),("2009-12-30",6.4797),("2009-12-31",6.4519),("2010-01-04",6.5522),("2010-01-05",6.5636),("2010-01-06",6.4592),("2010-01-07",6.4472),("2010-01-08",6.4901),("2010-01-11",6.4328),("2010-01-12",6.3597),("2010-01-13",6.4494),("2010-01-14",6.412),("2010-01-15",6.3049),("2010-01-19",6.5838),("2010-01-20",6.4823),("2010-01-21",6.3704),("2010-01-22",6.0544),("2010-01-25",6.2174),("2010-01-26",6.3052),("2010-01-27",6.3647),("2010-01-28",6.1016),("2010-01-29",5.8803),("2010-02-01",5.9619),("2010-02-02",5.9965),("2010-02-03",6.0997),("2010-02-04",5.8799),("2010-02-05",5.9843),("2010-02-08",5.9433),("2010-02-09",6.0066),("2010-02-10",5.9738),("2010-02-11",6.0826),("2010-02-12",6.1349),("2010-02-16",6.2274),("2010-02-17",6.2014),("2010-02-18",6.2129),("2010-02-19",6.1744),("2010-02-22",6.136),("2010-02-23",6.0333),("2010-02-24",6.1434),("2010-02-25",6.1845),("2010-02-26",6.2647),("2010-03-01",6.3985),("2010-03-02",6.3943),("2010-03-03",6.4089),("2010-03-04",6.4512),("2010-03-05",6.7035),("2010-03-08",6.7075),("2010-03-09",6.8281),("2010-03-10",6.8838),("2010-03-11",6.904),("2010-03-12",6.9377),("2010-03-15",6.8532),("2010-03-16",6.8719),("2010-03-17",6.8618),("2010-03-18",6.878),("2010-03-19",6.8045),("2010-03-22",6.8811),("2010-03-23",6.9916),("2010-03-24",7.0225),("2010-03-25",6.9392),("2010-03-26",7.0693),("2010-03-29",7.115),("2010-03-30",7.2207),("2010-03-31",7.1949),("2010-04-01",7.2246),("2010-04-05",7.3017),("2010-04-06",7.3339),("2010-04-07",7.3663),("2010-04-08",7.3464),("2010-04-09",7.4028),("2010-04-12",7.4181),("2010-04-13",7.4224),("2010-04-14",7.5222),("2010-04-15",7.6211),("2010-04-16",7.5745),("2010-04-19",7.5644),("2010-04-20",7.4885),("2010-04-21",7.9364),("2010-04-22",8.1584),("2010-04-23",8.2919),("2010-04-26",8.2511),("2010-04-27",8.0227),("2010-04-28",8.0093),("2010-04-29",8.2248),("2010-04-30",7.9937),("2010-05-03",8.1547),("2010-05-04",7.9199),("2010-05-05",7.8374),("2010-05-06",7.5393),("2010-05-07",7.2212),("2010-05-10",7.7763),("2010-05-11",7.8537),("2010-05-12",8.0243),("2010-05-13",7.9101),("2010-05-14",7.7711),("2010-05-17",7.7833),("2010-05-18",7.7264),("2010-05-19",7.6033),("2010-05-20",7.2794),("2010-05-21",7.419),("2010-05-24",7.5549),("2010-05-25",7.5078),("2010-05-26",7.4738),("2010-05-27",7.7567),("2010-05-28",7.8648),("2010-06-01",7.9857),("2010-06-02",8.0812),("2010-06-03",8.0558),("2010-06-04",7.8367),("2010-06-07",7.6829),("2010-06-08",7.6336),("2010-06-09",7.4459),("2010-06-10",7.6697),("2010-06-11",7.7616),("2010-06-14",7.7852),("2010-06-15",7.9508),("2010-06-16",8.1823),("2010-06-17",8.3237),("2010-06-18",8.3912),("2010-06-21",8.2717),("2010-06-22",8.3843),("2010-06-23",8.2961),("2010-06-24",8.2358),("2010-06-25",8.1654),("2010-06-28",8.2144),("2010-06-29",7.843),("2010-06-30",7.701),("2010-07-01",7.6076),("2010-07-02",7.5604),("2010-07-06",7.6122),("2010-07-07",7.9194),("2010-07-08",7.9018),("2010-07-09",7.9487),("2010-07-12",7.8772),("2010-07-13",7.7092),("2010-07-14",7.7376),("2010-07-15",7.6985),("2010-07-16",7.6511),("2010-07-19",7.5188),("2010-07-20",7.712),("2010-07-21",7.7839),("2010-07-22",7.9304),("2010-07-23",7.9584),("2010-07-26",7.9382),("2010-07-27",8.0852),("2010-07-28",7.9897),("2010-07-29",7.9024),("2010-07-30",7.8761),("2010-08-02",8.0169),("2010-08-03",8.0194),("2010-08-04",8.0515),("2010-08-05",8.0123),("2010-08-06",7.9631),("2010-08-09",8.0139),("2010-08-10",7.9422),("2010-08-11",7.6599),("2010-08-12",7.7089),("2010-08-13",7.6266),("2010-08-16",7.5819),("2010-08-17",7.7144),("2010-08-18",7.7481),("2010-08-19",7.6504),("2010-08-20",7.6431),("2010-08-23",7.5255),("2010-08-24",7.3458),("2010-08-25",7.4364),("2010-08-26",7.3565),("2010-08-27",7.3976),("2010-08-30",7.4245),("2010-08-31",7.4429),("2010-09-01",7.6642),("2010-09-02",7.7206),("2010-09-03",7.9226),("2010-09-07",7.8932),("2010-09-08",8.0497),("2010-09-09",8.0543),("2010-09-10",8.0647),("2010-09-13",8.1758),("2010-09-14",8.2071),("2010-09-15",8.2732),("2010-09-16",8.4676),("2010-09-17",8.4309),("2010-09-20",8.6715),("2010-09-21",8.688),("2010-09-22",8.8099),("2010-09-23",8.8457),("2010-09-24",8.9498),("2010-09-27",8.9144),("2010-09-28",8.7826),("2010-09-29",8.7983),("2010-09-30",8.6874),("2010-10-01",8.6498),("2010-10-04",8.531),("2010-10-05",8.8463),("2010-10-06",8.854),("2010-10-07",8.8549),("2010-10-08",9.0034),("2010-10-11",9.0429),("2010-10-12",9.1402),("2010-10-13",9.1892),("2010-10-14",9.2557),("2010-10-15",9.6362),("2010-10-18",9.736),("2010-10-19",9.4755),("2010-10-20",9.5073),("2010-10-21",9.4764),("2010-10-22",9.4137),("2010-10-25",9.4556),("2010-10-26",9.4314),("2010-10-27",9.4247),("2010-10-28",9.3454),("2010-10-29",9.2149),("2010-11-01",9.3129),("2010-11-02",9.4715),("2010-11-03",9.5768),("2010-11-04",9.7443),("2010-11-05",9.7094),("2010-11-08",9.755),("2010-11-09",9.6773),("2010-11-10",9.737),("2010-11-11",9.6949),("2010-11-12",9.4308),("2010-11-15",9.4003),("2010-11-16",9.2336),("2010-11-17",9.2003),("2010-11-18",9.443),("2010-11-19",9.391),("2010-11-22",9.594),("2010-11-23",9.4522),("2010-11-24",9.6379),("2010-11-26",9.6442),("2010-11-29",9.7014),("2010-11-30",9.5263),("2010-12-01",9.6871),("2010-12-02",9.7406),("2010-12-03",9.7189),("2010-12-06",9.8019),("2010-12-07",9.7425),("2010-12-08",9.8282),("2010-12-09",9.7899),("2010-12-10",9.8144),("2010-12-13",9.8484),("2010-12-14",9.8062),("2010-12-15",9.8083),("2010-12-16",9.8355),("2010-12-17",9.816),("2010-12-20",9.8649),("2010-12-21",9.926),("2010-12-22",9.9553),("2010-12-23",9.9075),("2010-12-27",9.9406),("2010-12-28",9.9647),("2010-12-29",9.9592),("2010-12-30",9.9093),("2010-12-31",9.8757),("2011-01-03",10.0903),("2011-01-04",10.1429),("2011-01-05",10.2259),("2011-01-06",10.2176),("2011-01-07",10.2908),("2011-01-10",10.4848),("2011-01-11",10.4598),("2011-01-12",10.5449),("2011-01-13",10.5835),("2011-01-14",10.6692),("2011-01-18",10.4295),("2011-01-19",10.3741),("2011-01-20",10.1855),("2011-01-21",10.003),("2011-01-24",10.3315),("2011-01-25",10.4525),("2011-01-26",10.5275),("2011-01-27",10.5079),("2011-01-28",10.2902),("2011-01-31",10.3888),("2011-02-01",10.5636),("2011-02-02",10.5419),("2011-02-03",10.5149),("2011-02-04",10.6086),("2011-02-07",10.7733),("2011-02-08",10.875),("2011-02-09",10.9656),("2011-02-10",10.8548),("2011-02-11",10.9255),("2011-02-14",10.9968),("2011-02-15",11.0189),("2011-02-16",11.1178),("2011-02-17",10.9699),("2011-02-18",10.7329),("2011-02-22",10.367),("2011-02-23",10.4898),("2011-02-24",10.4978),("2011-02-25",10.6594),("2011-02-28",10.814),("2011-03-01",10.6946),("2011-03-02",10.7807),("2011-03-03",11.0085),("2011-03-04",11.0219),("2011-03-07",10.8799),("2011-03-08",10.8921),("2011-03-09",10.7914),("2011-03-10",10.6138),("2011-03-11",10.7767),("2011-03-14",10.8248),("2011-03-15",10.5759),("2011-03-16",10.1037),("2011-03-17",10.2455),("2011-03-18",10.124),("2011-03-21",10.3882),("2011-03-22",10.4463),("2011-03-23",10.3848),("2011-03-24",10.5618),("2011-03-25",10.7629),("2011-03-28",10.7292),("2011-03-29",10.7452),("2011-03-30",10.6738),("2011-03-31",10.6701),("2011-04-01",10.5492),("2011-04-04",10.446),("2011-04-05",10.3756),("2011-04-06",10.3496),("2011-04-07",10.3508),("2011-04-08",10.2584),("2011-04-11",10.1279),("2011-04-12",10.1769),("2011-04-13",10.2911),("2011-04-14",10.1775),("2011-04-15",10.0257),("2011-04-18",10.1601),("2011-04-19",10.3441),("2011-04-20",10.4834),("2011-04-21",10.7371),("2011-04-25",10.8079),("2011-04-26",10.7286),("2011-04-27",10.7204),("2011-04-28",10.6163),("2011-04-29",10.7197),("2011-05-02",10.6019),("2011-05-03",10.6607),("2011-05-04",10.7026),("2011-05-05",10.6163),("2011-05-06",10.6135),("2011-05-09",10.6423),("2011-05-10",10.6989),("2011-05-11",10.631),("2011-05-12",10.6108),("2011-05-13",10.4249),("2011-05-16",10.2045),("2011-05-17",10.2914),("2011-05-18",10.4056),("2011-05-19",10.4258),("2011-05-20",10.2633),("2011-05-23",10.2382),("2011-05-24",10.1705),("2011-05-25",10.311),("2011-05-26",10.2565),("2011-05-27",10.3303),("2011-05-31",10.6493),("2011-06-01",10.5783),("2011-06-02",10.5964),("2011-06-03",10.5149),("2011-06-06",10.3496),("2011-06-07",10.1659),("2011-06-08",10.172),("2011-06-09",10.1491),("2011-06-10",9.9779),("2011-06-13",9.9993),("2011-06-14",10.1781),("2011-06-15",10.0039),("2011-06-16",9.9553),("2011-06-17",9.8052),("2011-06-20",9.654),("2011-06-21",9.9595),("2011-06-22",9.8772),("2011-06-23",10.1411),("2011-06-24",9.9917),("2011-06-27",10.1659),("2011-06-28",10.2645),("2011-06-29",10.2271),("2011-06-30",10.277),("2011-07-01",10.5094),("2011-07-05",10.6983),("2011-07-06",10.7697),("2011-07-07",10.9362),("2011-07-08",11.0131),("2011-07-11",10.8382),("2011-07-12",10.8306),("2011-07-13",10.9613),("2011-07-14",10.9537),("2011-07-15",11.1726),("2011-07-18",11.4444),("2011-07-19",11.5378),("2011-07-20",11.8455),("2011-07-21",11.8575),("2011-07-22",12.0415),("2011-07-25",12.2007),("2011-07-26",12.351),("2011-07-27",12.0197),("2011-07-28",11.9962),("2011-07-29",11.9551),("2011-08-01",12.1471),("2011-08-02",11.9071),("2011-08-03",12.0191),("2011-08-04",11.5537),("2011-08-05",11.4389),("2011-08-08",10.814),("2011-08-09",11.4509),("2011-08-10",11.1349),("2011-08-11",11.4414),("2011-08-12",11.5421),("2011-08-15",11.7387),("2011-08-16",11.649),("2011-08-17",11.6477),("2011-08-18",11.2072),("2011-08-19",10.9004),("2011-08-22",10.9129),("2011-08-23",11.4383),("2011-08-24",11.5173),("2011-08-25",11.442),("2011-08-26",11.7439),("2011-08-29",11.9395),("2011-08-30",11.9401),("2011-08-31",11.7821),("2011-09-01",11.6658),("2011-09-02",11.4521),("2011-09-06",11.6263),("2011-09-07",11.7546),("2011-09-08",11.761),("2011-09-09",11.5571),("2011-09-12",11.6324),("2011-09-13",11.7757),("2011-09-14",11.919),("2011-09-15",12.0311),("2011-09-16",12.2619),("2011-09-19",12.6027),("2011-09-20",12.6584),("2011-09-21",12.6183),("2011-09-22",12.3023),("2011-09-23",12.3782),("2011-09-26",12.3436),("2011-09-27",12.2239),("2011-09-28",12.1551),("2011-09-29",11.9579),("2011-09-30",11.6747),("2011-10-03",11.4689),("2011-10-04",11.4046),("2011-10-05",11.5807),("2011-10-06",11.5537),("2011-10-07",11.322),("2011-10-10",11.904),("2011-10-11",12.2555),("2011-10-12",12.3136),("2011-10-13",12.5047),("2011-10-14",12.9202),("2011-10-17",12.8586),("2011-10-18",12.9275),("2011-10-19",12.2043),("2011-10-20",12.103),("2011-10-21",12.0283),("2011-10-24",12.4233),("2011-10-25",12.1783),("2011-10-26",12.265),("2011-10-27",12.3902),("2011-10-28",12.3981),("2011-10-31",12.3929),("2011-11-01",12.1397),("2011-11-02",12.1673),("2011-11-03",12.3406),("2011-11-04",12.2539),("2011-11-07",12.2383),("2011-11-08",12.4373),("2011-11-09",12.1021),("2011-11-10",11.7941),("2011-11-11",11.7757),("2011-11-14",11.6116),("2011-11-15",11.9046),("2011-11-16",11.7803),("2011-11-17",11.555),("2011-11-18",11.4793),("2011-11-21",11.2978),("2011-11-22",11.5274),("2011-11-23",11.2359),("2011-11-25",11.1312),("2011-11-28",11.5155),("2011-11-29",11.4261),("2011-11-30",11.7016),("2011-12-01",11.8771),("2011-12-02",11.9312),("2011-12-05",12.0326),("2011-12-06",11.9695),("2011-12-07",11.9126),("2011-12-08",11.9606),("2011-12-09",12.0513),("2011-12-12",11.9968),("2011-12-13",11.904),("2011-12-14",11.6401),("2011-12-15",11.6018),("2011-12-16",11.6655),("2011-12-19",11.7019),("2011-12-20",12.1226),("2011-12-21",12.1378),("2011-12-22",12.2022),("2011-12-23",12.3485),("2011-12-27",12.4465),("2011-12-28",12.3274),("2011-12-29",12.4034),("2011-12-30",12.3997),("2012-01-03",12.5904),("2012-01-04",12.6581),("2012-01-05",12.7986),("2012-01-06",12.9324),("2012-01-09",12.9119),("2012-01-10",12.9581),("2012-01-11",12.937),("2012-01-12",12.9015),("2012-01-13",12.8531),("2012-01-17",13.0028),("2012-01-18",13.1378),("2012-01-19",13.0962),("2012-01-20",12.8681),("2012-01-23",13.0858),("2012-01-24",12.8715),("2012-01-25",13.6752),("2012-01-26",13.613),("2012-01-27",13.6941),("2012-01-30",13.8696),("2012-01-31",13.9758),("2012-02-01",13.9669),("2012-02-02",13.9342),("2012-02-03",14.0738),("2012-02-06",14.2051),("2012-02-07",14.3539),("2012-02-08",14.5943),("2012-02-09",15.0991),("2012-02-10",15.1068),("2012-02-13",15.3878),("2012-02-14",15.5979),("2012-02-15",15.2369),("2012-02-16",15.3759),("2012-02-17",15.3731),("2012-02-21",15.7629),("2012-02-22",15.7075),("2012-02-23",15.81),("2012-02-24",15.9944),("2012-02-27",16.0969),("2012-02-28",16.3924),("2012-02-29",16.6076),("2012-03-01",16.6698),("2012-03-02",16.6915),("2012-03-05",16.3235),("2012-03-06",16.2347),("2012-03-07",16.2479),("2012-03-08",16.5938),("2012-03-09",16.6912),("2012-03-12",16.9003),("2012-03-13",17.3932),("2012-03-14",18.0509),("2012-03-15",17.9278),("2012-03-16",17.9281),("2012-03-19",18.4036),("2012-03-20",18.5524),("2012-03-21",18.4464),("2012-03-22",18.3497),("2012-03-23",18.249),("2012-03-26",18.5836),("2012-03-27",18.8132),("2012-03-28",18.9094),("2012-03-29",18.6718),("2012-03-30",18.3561),("2012-04-02",18.9403),("2012-04-03",19.2676),("2012-04-04",19.1142),("2012-04-05",19.4011),("2012-04-09",19.4791),("2012-04-10",19.2406),("2012-04-11",19.172),("2012-04-12",19.067),("2012-04-13",18.53),("2012-04-16",17.7615),("2012-04-17",18.6669),("2012-04-18",18.6252),("2012-04-19",17.9853),("2012-04-20",17.5426),("2012-04-23",17.5034),("2012-04-24",17.1538),("2012-04-25",18.6761),("2012-04-26",18.6056),("2012-04-27",18.4617),("2012-04-30",17.8794),("2012-05-01",17.8228),("2012-05-02",17.9406),("2012-05-03",17.8133),("2012-05-04",17.306),("2012-05-07",17.4355),("2012-05-08",17.3957),("2012-05-09",17.4263),("2012-05-10",17.4673),("2012-05-11",17.3507),("2012-05-14",17.0907),("2012-05-15",16.9361),("2012-05-16",16.7189),("2012-05-17",16.2304),("2012-05-18",16.2384),("2012-05-21",17.1844),("2012-05-22",17.0525),("2012-05-23",17.4685),("2012-05-24",17.3081),("2012-05-25",17.2153),("2012-05-29",17.5209),("2012-05-30",17.7321),("2012-05-31",17.6881),("2012-06-01",17.1755),("2012-06-04",17.2766),("2012-06-05",17.2319),("2012-06-06",17.4961),("2012-06-07",17.5041),("2012-06-08",17.7674),("2012-06-11",17.4872),("2012-06-12",17.64),("2012-06-13",17.5175),("2012-06-14",17.4982),("2012-06-15",17.5778),("2012-06-18",17.9345),("2012-06-19",17.9844),("2012-06-20",17.9333),("2012-06-21",17.6862),("2012-06-22",17.8219),("2012-06-25",17.4748),("2012-06-26",17.5134),("2012-06-27",17.5892),("2012-06-28",17.4223),("2012-06-29",17.88),("2012-07-02",18.1409),("2012-07-03",18.3518),("2012-07-05",18.6742),("2012-07-06",18.5499),("2012-07-09",18.7952),("2012-07-10",18.6213),("2012-07-11",18.5055),("2012-07-12",18.3362),("2012-07-13",18.5221),("2012-07-16",18.5815),("2012-07-17",18.5824),("2012-07-18",18.5616),("2012-07-19",18.8083),("2012-07-20",18.5015),("2012-07-23",18.4872),("2012-07-24",18.3981),("2012-07-25",17.6036),("2012-07-26",17.6008),("2012-07-27",17.9155),("2012-07-30",18.2177),("2012-07-31",18.6993),("2012-08-01",18.5784),("2012-08-02",18.6084),("2012-08-03",18.8506),("2012-08-06",19.0603),("2012-08-07",19.0102),("2012-08-08",18.9779),("2012-08-09",19.0857),("2012-08-10",19.1155),("2012-08-13",19.3707),("2012-08-14",19.4227),("2012-08-15",19.3963),("2012-08-16",19.5657),("2012-08-17",19.9276),("2012-08-20",20.4515),("2012-08-21",20.1721),("2012-08-22",20.5659),("2012-08-23",20.374),("2012-08-24",20.3922),("2012-08-27",20.7753),("2012-08-28",20.7482),("2012-08-29",20.7072),("2012-08-30",20.4121),("2012-08-31",20.4543),("2012-09-04",20.7534),("2012-09-05",20.6077),("2012-09-06",20.7934),("2012-09-07",20.9216),("2012-09-10",20.3774),("2012-09-11",20.3113),("2012-09-12",20.5942),("2012-09-13",20.9997),("2012-09-14",21.2549),("2012-09-17",21.5163),("2012-09-18",21.5818),("2012-09-19",21.5876),("2012-09-20",21.4831),("2012-09-21",21.526),("2012-09-24",21.2399),("2012-09-25",20.7095),("2012-09-26",20.4524),("2012-09-27",20.9487),("2012-09-28",20.5116),("2012-10-01",20.2744),("2012-10-02",20.3334),("2012-10-03",20.6452),("2012-10-04",20.5022),("2012-10-05",20.0653),("2012-10-08",19.6219),("2012-10-09",19.5506),("2012-10-10",19.7062),("2012-10-11",19.3123),("2012-10-12",19.3619),("2012-10-15",19.5171),("2012-10-16",19.9793),("2012-10-17",19.8201),("2012-10-18",19.4519),("2012-10-19",18.7509),("2012-10-22",19.4946),("2012-10-23",18.859),("2012-10-24",18.9658),("2012-10-25",18.7416),("2012-10-26",18.5713),("2012-10-31",18.3044),("2012-11-01",18.3419),("2012-11-02",17.735),("2012-11-05",17.9755),("2012-11-06",17.921),("2012-11-07",17.2385),("2012-11-08",16.6128),("2012-11-09",16.9004),("2012-11-12",16.7698),("2012-11-13",16.7719),("2012-11-14",16.5859),("2012-11-15",16.2381),("2012-11-16",16.3017),("2012-11-19",17.4772),("2012-11-20",17.3284),("2012-11-21",17.3527),("2012-11-23",17.6555),("2012-11-26",18.2125),("2012-11-27",18.0657),("2012-11-28",18.0089),("2012-11-29",18.2072),("2012-11-30",18.0812),("2012-12-03",18.1093),("2012-12-04",17.7897),("2012-12-05",16.645),("2012-12-06",16.9061),("2012-12-07",16.4738),("2012-12-10",16.3679),("2012-12-11",16.7252),("2012-12-12",16.6514),("2012-12-13",16.3638),("2012-12-14",15.7492),("2012-12-17",16.0283),("2012-12-18",16.4939),("2012-12-19",16.2594),("2012-12-20",16.1179),("2012-12-21",16.0438),("2012-12-24",16.0697),("2012-12-26",15.8482),("2012-12-27",15.9119),("2012-12-28",15.7428),("2012-12-31",16.4405),("2013-01-02",16.9613),("2013-01-03",16.7471),("2013-01-04",16.2807),("2013-01-07",16.185),("2013-01-08",16.2285),("2013-01-09",15.9749),("2013-01-10",16.1729),("2013-01-11",16.0737),("2013-01-14",15.5007),("2013-01-15",15.0116),("2013-01-16",15.6347),("2013-01-17",15.5294),("2013-01-18",15.4466),("2013-01-22",15.594),("2013-01-23",15.8793),("2013-01-24",13.9174),("2013-01-25",13.5893),("2013-01-28",13.8967),("2013-01-29",14.1574),("2013-01-30",14.1129),("2013-01-31",14.0715),("2013-02-01",14.0138),("2013-02-04",13.6646),("2013-02-05",14.1443),("2013-02-06",14.129),("2013-02-07",14.5467),("2013-02-08",14.7567),("2013-02-11",14.9105),("2013-02-12",14.5367),("2013-02-13",14.5091),("2013-02-14",14.496),("2013-02-15",14.2963),("2013-02-19",14.291),("2013-02-20",13.9449),("2013-02-21",13.8582),("2013-02-22",14.0058),("2013-02-25",13.7569),("2013-02-26",13.9486),("2013-02-27",13.8119),("2013-02-28",13.7134),("2013-03-01",13.3739),("2013-03-04",13.0501),("2013-03-05",13.3948),("2013-03-06",13.2245),("2013-03-07",13.3773),("2013-03-08",13.4127),("2013-03-11",13.6038),("2013-03-12",13.3105),("2013-03-13",13.308),("2013-03-14",13.4369),("2013-03-15",13.7837),("2013-03-18",14.1583),("2013-03-19",14.1201),("2013-03-20",14.0452),("2013-03-21",14.0654),("2013-03-22",14.3506),("2013-03-25",14.4025),("2013-03-26",14.3266),("2013-03-27",14.0452),("2013-03-28",13.7526),("2013-04-01",13.3254),("2013-04-02",13.3528),("2013-04-03",13.4211),("2013-04-04",13.2884),("2013-04-05",13.148),("2013-04-08",13.2415),("2013-04-09",13.2654),("2013-04-10",13.536),("2013-04-11",13.4938),("2013-04-12",13.3531),("2013-04-15",13.0439),("2013-04-16",13.2425),("2013-04-17",12.5142),("2013-04-18",12.1802),("2013-04-19",12.133),("2013-04-22",12.3859),("2013-04-23",12.6177),("2013-04-24",12.5969),("2013-04-25",12.6876),("2013-04-26",12.9618),("2013-04-29",13.363),("2013-04-30",13.7563),("2013-05-01",13.6479),("2013-05-02",13.8414),("2013-05-03",13.98),("2013-05-06",14.3134),("2013-05-07",14.2496),("2013-05-08",14.4106),("2013-05-09",14.2857),("2013-05-10",14.1669),("2013-05-13",14.2222),("2013-05-14",13.8819),("2013-05-15",13.4125),("2013-05-16",13.5916),("2013-05-17",13.5504),("2013-05-20",13.8529),("2013-05-21",13.7506),("2013-05-22",13.8036),("2013-05-23",13.8282),("2013-05-24",13.9223),("2013-05-28",13.8062),("2013-05-29",13.916),("2013-05-30",14.1234),("2013-05-31",14.0657),("2013-06-03",14.0965),("2013-06-04",14.0524),("2013-06-05",13.921),("2013-06-06",13.7131),("2013-06-07",13.8179),("2013-06-10",13.7265),("2013-06-11",13.6862),("2013-06-12",13.517),("2013-06-13",13.635),("2013-06-14",13.45),("2013-06-17",13.511),("2013-06-18",13.5038),("2013-06-19",13.2295),("2013-06-20",13.0368),("2013-06-21",12.9324),("2013-06-24",12.5896),("2013-06-25",12.5925),("2013-06-26",12.4498),("2013-06-27",12.3157),("2013-06-28",12.4017),("2013-07-01",12.7986),("2013-07-02",13.0885),("2013-07-03",13.1607),("2013-07-05",13.055),("2013-07-08",12.9809),("2013-07-09",13.2092),("2013-07-10",13.1585),("2013-07-11",13.3637),("2013-07-12",13.3393),("2013-07-15",13.3684),("2013-07-16",13.4546),("2013-07-17",13.4582),("2013-07-18",13.5035),("2013-07-19",13.2905),("2013-07-22",13.3331),("2013-07-23",13.1041),("2013-07-24",13.7772),("2013-07-25",13.7143),("2013-07-26",13.7922),("2013-07-29",14.0049),("2013-07-30",14.1778),("2013-07-31",14.1531),("2013-08-01",14.2828),("2013-08-02",14.4662),("2013-08-05",14.6823),("2013-08-06",14.5509),("2013-08-07",14.5425),("2013-08-08",14.5137),("2013-08-09",14.3072),("2013-08-12",14.7136),("2013-08-13",15.4129),("2013-08-14",15.694),("2013-08-15",15.6754),("2013-08-16",15.8146),("2013-08-19",15.9849),("2013-08-20",15.7749),("2013-08-21",15.8155),("2013-08-22",15.8344),("2013-08-23",15.7733),("2013-08-26",15.8347),("2013-08-27",15.382),("2013-08-28",15.4546),("2013-08-29",15.4799),("2013-08-30",15.3387),("2013-09-03",15.3817),("2013-09-04",15.7),("2013-09-05",15.5923),("2013-09-06",15.6852),("2013-09-09",15.9355),("2013-09-10",15.5725),("2013-09-11",14.7246),("2013-09-12",14.8814),("2013-09-13",14.6362),("2013-09-16",14.1709),("2013-09-17",14.3346),("2013-09-18",14.6293),("2013-09-19",14.8692),("2013-09-20",14.7152),("2013-09-23",15.4465),("2013-09-24",15.3981),("2013-09-25",15.1597),("2013-09-26",15.3074),("2013-09-27",15.1981),("2013-09-30",15.0092),("2013-10-01",15.3622),("2013-10-02",15.4125),("2013-10-03",15.2189),("2013-10-04",15.207),("2013-10-07",15.3556),("2013-10-08",15.1412),("2013-10-09",15.319),("2013-10-10",15.415),("2013-10-11",15.5149),("2013-10-14",15.6165),("2013-10-15",15.6997),("2013-10-16",15.7763),("2013-10-17",15.8829),("2013-10-18",16.0211),("2013-10-21",16.4137),("2013-10-22",16.3667),("2013-10-23",16.527),("2013-10-24",16.7458),("2013-10-25",16.5584),("2013-10-28",16.6818),("2013-10-29",16.2663),("2013-10-30",16.525),("2013-10-31",16.4559),("2013-11-01",16.3718),("2013-11-04",16.5834),("2013-11-05",16.5424),("2013-11-06",16.4958),("2013-11-07",16.229),("2013-11-08",16.4844),("2013-11-11",16.4366),("2013-11-12",16.467),("2013-11-13",16.4868),("2013-11-14",16.7251),("2013-11-15",16.6248),("2013-11-18",16.4233),("2013-11-19",16.4525),("2013-11-20",16.3084),("2013-11-21",16.5027),("2013-11-22",16.4604),("2013-11-25",16.5851),("2013-11-26",16.891),("2013-11-27",17.2888),("2013-11-29",17.6089),("2013-12-02",17.4557),("2013-12-03",17.9336),("2013-12-04",17.8917),("2013-12-05",17.9836),("2013-12-06",17.734),("2013-12-09",17.937),("2013-12-10",17.9091),("2013-12-11",17.7765),("2013-12-12",17.7505),("2013-12-13",17.557),("2013-12-16",17.6542),("2013-12-17",17.5747),("2013-12-18",17.4411),("2013-12-19",17.2413),("2013-12-20",17.3857),("2013-12-23",18.0529),("2013-12-24",17.9763),("2013-12-26",17.8569),("2013-12-27",17.7362),("2013-12-30",17.5599),("2013-12-31",17.7657),("2014-01-02",17.5158),("2014-01-03",17.1311),("2014-01-06",17.2245),("2014-01-07",17.1012),("2014-01-08",17.2096),("2014-01-09",16.9898),("2014-01-10",16.8765),("2014-01-13",16.9648),("2014-01-14",17.3024),("2014-01-15",17.6498),("2014-01-16",17.5513),("2014-01-17",17.1213),("2014-01-21",17.3873),("2014-01-22",17.4645),("2014-01-23",17.6124),("2014-01-24",17.2923),("2014-01-27",17.4326),("2014-01-28",16.0392),("2014-01-29",15.8571),("2014-01-30",15.8265),("2014-01-31",15.8524),("2014-02-03",15.8818),("2014-02-04",16.1117),("2014-02-05",16.2321),("2014-02-06",16.3261),("2014-02-07",16.5545),("2014-02-10",16.8511),("2014-02-11",17.0731),("2014-02-12",17.0718),("2014-02-13",17.3429),("2014-02-14",17.3289),("2014-02-18",17.3926),("2014-02-19",17.118),("2014-02-20",16.9199),("2014-02-21",16.7319),("2014-02-24",16.8052),("2014-02-25",16.6303),("2014-02-26",16.4803),("2014-02-27",16.809),("2014-02-28",16.7635),("2014-03-03",16.8119),("2014-03-04",16.9228),("2014-03-05",16.9584),("2014-03-06",16.9072),("2014-03-07",16.8973),("2014-03-10",16.9126),("2014-03-11",17.0773),("2014-03-12",17.0938),("2014-03-13",16.904),("2014-03-14",16.7141),("2014-03-17",16.7794),("2014-03-18",16.9279),("2014-03-19",16.9234),("2014-03-20",16.8418),("2014-03-21",16.9747),("2014-03-24",17.176),("2014-03-25",17.3608),("2014-03-26",17.1948),("2014-03-27",17.1209),("2014-03-28",17.1018),("2014-03-31",17.098),("2014-04-01",17.2544),("2014-04-02",17.283),("2014-04-03",17.1633),("2014-04-04",16.9412),("2014-04-07",16.6752),("2014-04-08",16.6743),("2014-04-09",16.8935),("2014-04-10",16.6756),("2014-04-11",16.5523),("2014-04-14",16.6182),("2014-04-15",16.4997),("2014-04-16",16.5332),("2014-04-17",16.7221),("2014-04-21",16.9205),("2014-04-22",16.9374),("2014-04-23",16.716),("2014-04-24",18.0864),("2014-04-25",18.2193),("2014-04-28",18.9249),("2014-04-29",18.8688),("2014-04-30",18.7974),("2014-05-01",18.8417),("2014-05-02",18.8768),("2014-05-05",19.1437),("2014-05-06",18.9351),("2014-05-07",18.8688),("2014-05-08",18.8353),("2014-05-09",18.7569),("2014-05-12",18.9904),("2014-05-13",19.0202),("2014-05-14",19.0237),("2014-05-15",18.8619),("2014-05-16",19.1403),("2014-05-19",19.3671),("2014-05-20",19.3709),("2014-05-21",19.4222),("2014-05-22",19.453),("2014-05-23",19.6727),("2014-05-27",20.0411),("2014-05-28",19.9892),("2014-05-29",20.3534),("2014-05-30",20.2772),("2014-06-02",20.1378),("2014-06-03",20.4226),("2014-06-04",20.6558),("2014-06-05",20.7369),("2014-06-06",20.6798),("2014-06-09",21.0107),("2014-06-10",21.1341),("2014-06-11",21.0466),("2014-06-12",20.6946),("2014-06-13",20.4681),("2014-06-16",20.6744),("2014-06-17",20.6475),("2014-06-18",20.6699),("2014-06-19",20.5981),("2014-06-20",20.3851),("2014-06-23",20.3672),("2014-06-24",20.2439),("2014-06-25",20.2618),("2014-06-26",20.3829),("2014-06-27",20.6251),("2014-06-30",20.8381),("2014-07-01",20.9704),("2014-07-02",20.9614),("2014-07-03",21.0847),("2014-07-07",21.5193),("2014-07-08",21.3807),("2014-07-09",21.3897),("2014-07-10",21.3101),("2014-07-11",21.3516),("2014-07-14",21.6274),("2014-07-15",21.374),("2014-07-16",21.2529),("2014-07-17",20.874),("2014-07-18",21.1744),("2014-07-21",21.0643),("2014-07-22",21.2395),("2014-07-23",21.7933),("2014-07-24",21.7574),("2014-07-25",21.9012),("2014-07-28",22.2037),("2014-07-29",22.0602),("2014-07-30",22.0086),("2014-07-31",21.4368),("2014-08-01",21.5556),("2014-08-04",21.4345),("2014-08-05",21.3292),("2014-08-06",21.2933),("2014-08-07",21.291),("2014-08-08",21.3496),("2014-08-11",21.6313),("2014-08-12",21.6268),("2014-08-13",21.913),("2014-08-14",21.9716),("2014-08-15",22.0798),("2014-08-18",22.3457),("2014-08-19",22.6544),("2014-08-20",22.6634),("2014-08-21",22.6657),("2014-08-22",22.8324),("2014-08-25",22.882),("2014-08-26",22.7353),("2014-08-27",23.015),("2014-08-28",23.042),("2014-08-29",23.0983),("2014-09-02",23.2786),("2014-09-03",22.2961),("2014-09-04",22.1113),("2014-09-05",22.3029),("2014-09-08",22.1654),("2014-09-09",22.082),("2014-09-10",22.7603),("2014-09-11",22.8572),("2014-09-12",22.909),("2014-09-15",22.9023),("2014-09-16",22.7288),("2014-09-17",22.891),("2014-09-18",22.9383),("2014-09-19",22.7513),("2014-09-22",22.7738),("2014-09-23",23.1299),("2014-09-24",22.9293),("2014-09-25",22.055),("2014-09-26",22.704),("2014-09-29",22.5598),("2014-09-30",22.704),("2014-10-01",22.3502),("2014-10-02",22.5124),("2014-10-03",22.4493),("2014-10-06",22.4493),("2014-10-07",22.2533),("2014-10-08",22.7152),("2014-10-09",22.7648),("2014-10-10",22.6995),("2014-10-13",22.4921),("2014-10-14",22.2533),("2014-10-15",21.9806),("2014-10-16",21.6922),("2014-10-17",22.0099),("2014-10-20",22.4809),("2014-10-21",23.0916),("2014-10-22",23.2088),("2014-10-23",23.6234),("2014-10-24",23.7113),("2014-10-27",23.6865),("2014-10-28",24.0538),("2014-10-29",24.189),("2014-10-30",24.1079),("2014-10-31",24.3378),("2014-11-03",24.6532),("2014-11-04",24.473),("2014-11-05",24.5316),("2014-11-06",24.6014),("2014-11-07",24.6716),("2014-11-10",24.6308),("2014-11-11",24.8277),("2014-11-12",25.1785),("2014-11-13",25.5339),("2014-11-14",25.8417),("2014-11-17",25.7987),("2014-11-18",26.1336),("2014-11-19",25.9526),("2014-11-20",26.3237),("2014-11-21",26.36),("2014-11-24",26.8477),("2014-11-25",26.6157),("2014-11-26",26.9326),("2014-11-28",26.9167),("2014-12-01",26.0431),("2014-12-02",25.9435),("2014-12-03",26.2377),("2014-12-04",26.1382),("2014-12-05",26.0273),("2014-12-08",25.4388),("2014-12-09",25.8281),("2014-12-10",25.337),("2014-12-11",25.2623),("2014-12-12",24.8345),("2014-12-15",24.4939),("2014-12-16",24.159),("2014-12-17",24.7621),("2014-12-18",25.4954),("2014-12-19",25.2985),("2014-12-22",25.561),("2014-12-23",25.4705),("2014-12-24",25.3506),("2014-12-26",25.7987),("2014-12-29",25.7806),("2014-12-30",25.466),("2014-12-31",24.9816),("2015-01-02",24.744),("2015-01-05",24.0469),("2015-01-06",24.0492),("2015-01-07",24.3864),("2015-01-08",25.3234),("2015-01-09",25.3506),("2015-01-12",24.7259),("2015-01-13",24.9454),("2015-01-14",24.8504),("2015-01-15",24.1759),("2015-01-16",23.9881),("2015-01-20",24.6059),("2015-01-21",24.7938),("2015-01-22",25.4388),("2015-01-23",25.5701),("2015-01-26",25.5972),("2015-01-27",24.701),("2015-01-28",26.0974),("2015-01-29",26.9099),("2015-01-30",26.5161),("2015-02-02",26.8488),("2015-02-03",26.8533),("2015-02-04",27.0593),("2015-02-05",27.2517),("2015-02-06",27.0222),("2015-02-09",27.2017),("2015-02-10",27.7243),("2015-02-11",28.3741),("2015-02-12",28.7331),("2015-02-13",28.874),("2015-02-17",29.0444),("2015-02-18",29.2454),("2015-02-19",29.1852),("2015-02-20",29.4227),("2015-02-23",30.219),("2015-02-24",30.0305),("2015-02-25",29.2625),("2015-02-26",29.6317),("2015-02-27",29.1875),("2015-03-02",29.3307),("2015-03-03",29.392),("2015-03-04",29.2057),("2015-03-05",28.7217),("2015-03-06",28.7649),("2015-03-09",28.8876),("2015-03-10",28.29),("2015-03-11",27.7743),("2015-03-12",28.2764),("2015-03-13",28.081),("2015-03-16",28.39),("2015-03-17",28.8649),("2015-03-18",29.1898),("2015-03-19",28.9683),("2015-03-20",28.6059),("2015-03-23",28.9035),("2015-03-24",28.7853),("2015-03-25",28.0333),("2015-03-26",28.2287),("2015-03-27",28.0037),("2015-03-30",28.7126),("2015-03-31",28.2719),("2015-04-01",28.231),("2015-04-02",28.4741),("2015-04-06",28.9353),("2015-04-07",28.6308),("2015-04-08",28.5377),("2015-04-09",28.7558),("2015-04-10",28.8785),("2015-04-13",28.8217),("2015-04-14",28.6967),("2015-04-15",28.8058),("2015-04-16",28.6672),("2015-04-17",28.3446),("2015-04-20",28.9921),("2015-04-21",28.8353),("2015-04-22",29.2239),("2015-04-23",29.4624),("2015-04-24",29.601),("2015-04-27",30.1395),("2015-04-28",29.6647),("2015-04-29",29.2284),("2015-04-30",28.4354),("2015-05-01",29.2988),("2015-05-04",29.242),("2015-05-05",28.5831),("2015-05-06",28.4036),("2015-05-07",28.5786),("2015-05-08",29.117),("2015-05-11",28.8204),("2015-05-12",28.7166),("2015-05-13",28.7497),("2015-05-14",29.4205),("2015-05-15",29.3794),("2015-05-18",29.7034),("2015-05-19",29.676),("2015-05-20",29.6737),("2015-05-21",29.9772),("2015-05-22",30.2395),("2015-05-26",29.5733),("2015-05-27",30.1266),("2015-05-28",30.0661),("2015-05-29",29.7239),("2015-06-01",29.7821),("2015-06-02",29.6509),("2015-06-03",29.6874),("2015-06-04",29.514),("2015-06-05",29.352),("2015-06-08",29.1581),("2015-06-09",29.0714),("2015-06-10",29.4045),("2015-06-11",29.3383),("2015-06-12",29.0144),("2015-06-15",28.9573),("2015-06-16",29.1125),("2015-06-17",29.044),("2015-06-18",29.1763),("2015-06-19",28.8843),("2015-06-22",29.1147),("2015-06-23",28.9824),("2015-06-24",29.2288),("2015-06-25",29.0896),("2015-06-26",28.9185),("2015-06-29",28.412),("2015-06-30",28.6162),("2015-07-01",28.8843),("2015-07-02",28.8478),("2015-07-06",28.7474),("2015-07-07",28.6767),("2015-07-08",27.9649),("2015-07-09",27.3945),("2015-07-10",28.1268),("2015-07-13",28.6698),("2015-07-14",28.6584),("2015-07-15",28.9345),("2015-07-16",29.3201),("2015-07-17",29.5733),("2015-07-20",30.1323),("2015-07-21",29.8312),("2015-07-22",28.5695),("2015-07-23",28.5558),("2015-07-24",28.4052),("2015-07-27",28.0105),("2015-07-28",28.1497),("2015-07-29",28.0607),("2015-07-30",27.9192),("2015-07-31",27.6751),("2015-08-03",27.0226),("2015-08-04",26.1556),("2015-08-05",26.329),("2015-08-06",26.386),("2015-08-07",26.4754),("2015-08-10",27.438),("2015-08-11",26.0102),("2015-08-12",26.4112),("2015-08-13",26.3906),("2015-08-14",26.5762),("2015-08-17",26.8513),("2015-08-18",26.7),("2015-08-19",26.3585),("2015-08-20",25.8176),("2015-08-21",24.2386),("2015-08-24",23.6335),("2015-08-25",23.7756),("2015-08-26",25.1393),("2015-08-27",25.8795),("2015-08-28",25.9643),("2015-08-31",25.8429),("2015-09-01",24.6878),("2015-09-02",25.7466),("2015-09-03",25.2951),("2015-09-04",25.043),("2015-09-08",25.7397),("2015-09-09",25.2447),("2015-09-10",25.7993),("2015-09-11",26.1752),("2015-09-14",26.4273),("2015-09-15",26.6496),("2015-09-16",26.6794),("2015-09-17",26.1087),("2015-09-18",26.001),("2015-09-21",26.4044),("2015-09-22",25.9895),("2015-09-23",26.2004),("2015-09-24",26.3562),("2015-09-25",26.2898),("2015-09-28",25.7695),("2015-09-29",24.9949),("2015-09-30",25.1988),("2015-10-01",25.114),("2015-10-02",25.2974),("2015-10-05",25.3891),("2015-10-06",25.5105),("2015-10-07",25.3891),("2015-10-08",25.0957),("2015-10-09",25.6962),("2015-10-12",25.577),("2015-10-13",25.6205),("2015-10-14",25.2584),("2015-10-15",25.6366),("2015-10-16",25.4487),("2015-10-19",25.6068),("2015-10-20",26.0743),("2015-10-21",26.072),("2015-10-22",26.4708),("2015-10-23",27.2913),("2015-10-26",26.4204),("2015-10-27",26.2531),("2015-10-28",27.3348),("2015-10-29",27.6236),("2015-10-30",27.3876),("2015-11-02",27.7726),("2015-11-03",28.0912),("2015-11-04",27.9605),("2015-11-05",27.8322),("2015-11-06",27.8644),("2015-11-09",27.7516),("2015-11-10",26.877),("2015-11-11",26.7251),("2015-11-12",26.6353),("2015-11-13",25.8573),("2015-11-16",26.2797),("2015-11-17",26.168),("2015-11-18",26.9967),("2015-11-19",27.3396),("2015-11-20",27.4593),("2015-11-23",27.1025),("2015-11-24",27.3626),("2015-11-25",27.167),("2015-11-27",27.1163),("2015-11-30",27.2291),("2015-12-01",27.0082),("2015-12-02",26.7642),("2015-12-03",26.5156),("2015-12-04",27.3972),("2015-12-07",27.2245),("2015-12-08",27.213),("2015-12-09",26.6123),("2015-12-10",26.7389),("2015-12-11",26.0507),("2015-12-14",25.8895),("2015-12-15",25.4315),("2015-12-16",25.6271),("2015-12-17",25.0839),("2015-12-18",24.4049),("2015-12-21",24.7042),("2015-12-22",24.6811),("2015-12-23",24.9988),("2015-12-24",24.8653),("2015-12-28",24.5868),("2015-12-29",25.0287),("2015-12-30",24.7019),("2015-12-31",24.2277),("2016-01-04",24.2484),("2016-01-05",23.6408),("2016-01-06",23.1781),("2016-01-07",22.1999),("2016-01-08",22.3173),("2016-01-11",22.6787),("2016-01-12",23.0078),("2016-01-13",22.4163),("2016-01-14",22.9065),("2016-01-15",22.3564),("2016-01-19",22.2482),("2016-01-20",22.2782),("2016-01-21",22.1654),("2016-01-22",23.3439),("2016-01-25",22.8881),("2016-01-26",23.0147),("2016-01-27",21.5025),("2016-01-28",21.6567),("2016-01-29",22.4048),("2016-02-01",22.1953),("2016-02-02",21.7465),("2016-02-03",22.1769),("2016-02-04",22.3541),("2016-02-05",21.7571),("2016-02-08",21.9862),("2016-02-09",21.9816),("2016-02-10",21.8149),("2016-02-11",21.683),("2016-02-12",21.7502),("2016-02-16",22.3634),("2016-02-17",22.7059),("2016-02-18",22.2754),("2016-02-19",22.2245),("2016-02-22",22.4189),("2016-02-23",21.9121),("2016-02-24",22.2384),("2016-02-25",22.3912),("2016-02-26",22.4259),("2016-02-29",22.375),("2016-03-01",23.2636),("2016-03-02",23.3145),("2016-03-03",23.488),("2016-03-04",23.8375),("2016-03-07",23.5737),("2016-03-08",23.3793),("2016-03-09",23.4001),("2016-03-10",23.4117),("2016-03-11",23.6639),("2016-03-14",23.7241),("2016-03-15",24.2008),("2016-03-16",24.5224),("2016-03-17",24.4831),("2016-03-18",24.5109),("2016-03-21",24.5085),("2016-03-22",24.696),("2016-03-23",24.5595),("2016-03-24",24.453),("2016-03-28",24.3419),("2016-03-29",24.9181),("2016-03-30",25.3532),("2016-03-31",25.2213),("2016-04-01",25.4527),("2016-04-04",25.7142),("2016-04-05",25.411),("2016-04-06",25.6772),("2016-04-07",25.1172),("2016-04-08",25.1449),("2016-04-11",25.2282),("2016-04-12",25.5568),("2016-04-13",25.9271),("2016-04-14",25.941),("2016-04-15",25.4203),("2016-04-18",24.8719),("2016-04-19",24.74),("2016-04-20",24.7909),("2016-04-21",24.5224),("2016-04-22",24.4553),("2016-04-25",24.3165),("2016-04-26",24.1475),("2016-04-27",22.6364),("2016-04-28",21.9445),("2016-04-29",21.6923),("2016-05-02",21.6692),("2016-05-03",22.0255),("2016-05-04",21.7964),("2016-05-05",21.7085),("2016-05-06",21.5874),("2016-05-09",21.6037),("2016-05-10",21.7504),("2016-05-11",21.5385),("2016-05-12",21.0333),("2016-05-13",21.0752),("2016-05-16",21.8575),("2016-05-17",21.7667),("2016-05-18",22.0158),("2016-05-19",21.932),("2016-05-20",22.1695),("2016-05-23",22.4512),("2016-05-24",22.7935),("2016-05-25",23.1939),("2016-05-26",23.3778),("2016-05-27",23.3639),("2016-05-31",23.2498),("2016-06-01",22.9238),("2016-06-02",22.7515),("2016-06-03",22.7981),("2016-06-06",22.9634),("2016-06-07",23.0565),("2016-06-08",23.0356),("2016-06-09",23.2009),("2016-06-10",23.01),("2016-06-13",22.6631),("2016-06-14",22.691),("2016-06-15",22.6165),("2016-06-16",22.712),("2016-06-17",22.1951),("2016-06-20",22.1415),("2016-06-21",22.3301),("2016-06-22",22.2463),("2016-06-23",22.3744),("2016-06-24",21.7457),("2016-06-27",21.4291),("2016-06-28",21.79),("2016-06-29",21.9786),("2016-06-30",22.258),("2016-07-01",22.3255),("2016-07-05",22.1159),("2016-07-06",22.2417),("2016-07-07",22.3371),("2016-07-08",22.5094),("2016-07-11",22.5793),("2016-07-12",22.6817),("2016-07-13",22.5536),("2016-07-14",23.0007),("2016-07-15",22.9983),("2016-07-18",23.2428),("2016-07-19",23.2521),("2016-07-20",23.2731),("2016-07-21",23.1497),("2016-07-22",22.9704),("2016-07-25",22.6631),("2016-07-26",22.5071),("2016-07-27",23.9692),("2016-07-28",24.2928),("2016-07-29",24.2626),("2016-08-01",24.691),("2016-08-02",24.3254),("2016-08-03",24.6304),("2016-08-04",24.7818),("2016-08-05",25.1586),("2016-08-08",25.367),("2016-08-09",25.47),("2016-08-10",25.2804),("2016-08-11",25.264),("2016-08-12",25.3225),("2016-08-15",25.6268),("2016-08-16",25.6034),("2016-08-17",25.5659),("2016-08-18",25.5332),("2016-08-19",25.5987),("2016-08-22",25.3997),("2016-08-23",25.4793),("2016-08-24",25.2874),("2016-08-25",25.1797),("2016-08-26",25.0322),("2016-08-29",25.0041),("2016-08-30",24.8122),("2016-08-31",24.8356),("2016-09-01",24.9831),("2016-09-02",25.2172),("2016-09-06",25.2101),("2016-09-07",25.3646),("2016-09-08",24.6998),("2016-09-09",24.1404),("2016-09-12",24.6811),("2016-09-13",25.2687),("2016-09-14",26.1628),("2016-09-15",27.0523),("2016-09-16",26.9002),("2016-09-19",26.5865),("2016-09-20",26.5842),("2016-09-21",26.5795),("2016-09-22",26.8299),("2016-09-23",26.3829),("2016-09-26",26.4227),("2016-09-27",26.4718),("2016-09-28",26.6731),("2016-09-29",26.2588),("2016-09-30",26.4624),("2016-10-03",26.3384),("2016-10-04",26.4507),("2016-10-05",26.4624),("2016-10-06",26.6591),("2016-10-07",26.6989),("2016-10-10",27.1647),("2016-10-11",27.2232),("2016-10-12",27.4666),("2016-10-13",27.3824),("2016-10-14",27.5345),("2016-10-17",27.5158),("2016-10-18",27.4971),("2016-10-19",27.4151),("2016-10-20",27.4011),("2016-10-21",27.2934),("2016-10-24",27.5392),("2016-10-25",27.6796),("2016-10-26",27.057),("2016-10-27",26.7972),("2016-10-28",26.6193),("2016-10-31",26.5771),("2016-11-01",26.0973),("2016-11-02",26.1207),("2016-11-03",25.8421),("2016-11-04",25.6092),("2016-11-07",25.9786),("2016-11-08",26.1316),("2016-11-09",26.0892),("2016-11-10",25.3621),("2016-11-11",25.5127),("2016-11-14",24.8727),("2016-11-15",25.2021),("2016-11-16",25.8798),("2016-11-17",25.8704),("2016-11-18",25.8963),("2016-11-21",26.2892),("2016-11-22",26.3057),("2016-11-23",26.1716),("2016-11-25",26.3033),("2016-11-28",26.2516),("2016-11-29",26.2257),("2016-11-30",26.0045),("2016-12-01",25.7621),("2016-12-02",25.8586),("2016-12-05",25.6727),("2016-12-06",25.8704),("2016-12-07",26.1245),("2016-12-08",26.381),("2016-12-09",26.8115),("2016-12-12",26.6586),("2016-12-13",27.1033),("2016-12-14",27.1033),("2016-12-15",27.2515),("2016-12-16",27.2868),("2016-12-19",27.4445),("2016-12-20",27.5174),("2016-12-21",27.5433),("2016-12-22",27.3621),("2016-12-23",27.4162),("2016-12-27",27.5904),("2016-12-28",27.4727),("2016-12-29",27.4657),("2016-12-30",27.2515),("2017-01-03",27.3292),("2017-01-04",27.2986),("2017-01-05",27.4374),("2017-01-06",27.7433),("2017-01-09",27.9974),("2017-01-10",28.0257),("2017-01-11",28.1762),("2017-01-12",28.0586),("2017-01-13",28.0092),("2017-01-17",28.2351),("2017-01-18",28.2327),("2017-01-19",28.1833),("2017-01-20",28.2351),("2017-01-23",28.2539),("2017-01-24",28.228),("2017-01-25",28.6774),("2017-01-26",28.6915),("2017-01-27",28.6939),("2017-01-30",28.6186),("2017-01-31",28.5527),("2017-02-01",30.2939),("2017-02-02",30.2421),("2017-02-03",30.3715),("2017-02-06",30.6562),("2017-02-07",30.948),("2017-02-08",31.068),("2017-02-09",31.2915),("2017-02-10",31.2206),("2017-02-13",31.4971),("2017-02-14",31.9059),("2017-02-15",32.0217),("2017-02-16",31.9827),("2017-02-17",32.0713),("2017-02-21",32.3029),("2017-02-22",32.3998),("2017-02-23",32.2627),("2017-02-24",32.2934),("2017-02-27",32.3572),("2017-02-28",32.3714),("2017-03-01",33.0331),("2017-03-02",32.8369),("2017-03-03",33.0307),("2017-03-06",32.9267),("2017-03-07",32.9693),("2017-03-08",32.8464),("2017-03-09",32.7708),("2017-03-10",32.8795),("2017-03-13",32.8937),("2017-03-14",32.844),("2017-03-15",33.1914),("2017-03-16",33.2458),("2017-03-17",33.0803),("2017-03-20",33.4277),("2017-03-21",33.0449),("2017-03-22",33.4183),("2017-03-23",33.3001),("2017-03-24",33.2339),("2017-03-27",33.2906),("2017-03-28",33.9807),("2017-03-29",34.0563),("2017-03-30",34.0114),("2017-03-31",33.9476),("2017-04-03",33.957),("2017-04-04",34.2099),("2017-04-05",34.0326),("2017-04-06",33.9476),("2017-04-07",33.872),("2017-04-10",33.8318),("2017-04-11",33.4679),("2017-04-12",33.5081),("2017-04-13",33.3308),("2017-04-17",33.5151),("2017-04-18",33.3663),("2017-04-19",33.2434),("2017-04-20",33.6593),("2017-04-21",33.6191),("2017-04-24",33.9429),("2017-04-25",34.1532),("2017-04-26",33.9523),("2017-04-27",33.9783),("2017-04-28",33.9452),("2017-05-01",34.6376),("2017-05-02",34.8574),("2017-05-03",34.751),("2017-05-04",34.6258),("2017-05-05",35.2),("2017-05-08",36.157),("2017-05-09",36.3886),("2017-05-10",36.2161),("2017-05-11",36.528),("2017-05-12",37.0382),("2017-05-15",36.9433),("2017-05-16",36.8887),("2017-05-17",35.6501),("2017-05-18",36.1935),("2017-05-19",36.3169),("2017-05-22",36.5375),("2017-05-23",36.4924),("2017-05-24",36.3833),("2017-05-25",36.509),("2017-05-26",36.4474),("2017-05-30",36.4616),("2017-05-31",36.2457),("2017-06-01",36.3453),("2017-06-02",36.8839),("2017-06-05",36.5233),("2017-06-06",36.6467),("2017-06-07",36.865),("2017-06-08",36.7748),("2017-06-09",35.3488),("2017-06-12",34.5041),("2017-06-13",34.7817),("2017-06-14",34.4424),("2017-06-15",34.236),("2017-06-16",33.7567),("2017-06-19",34.7224),("2017-06-20",34.4068),("2017-06-21",34.6109),("2017-06-22",34.5539),("2017-06-23",34.7082),("2017-06-26",34.599),("2017-06-27",34.1031),("2017-06-28",34.6014),("2017-06-29",34.0912),("2017-06-30",34.1719),("2017-07-03",34.0485),("2017-07-05",34.1885),("2017-07-06",33.8658),("2017-07-07",34.2099),("2017-07-10",34.4187),("2017-07-11",34.5302),("2017-07-12",34.58),("2017-07-13",35.0617),("2017-07-14",35.363),("2017-07-17",35.4864),("2017-07-18",35.6098),("2017-07-19",35.8328),("2017-07-20",35.6715),("2017-07-21",35.6549),("2017-07-24",36.0867),("2017-07-25",36.2409),("2017-07-26",36.4118),("2017-07-27",35.7237),("2017-07-28",35.4722),("2017-07-31",35.2895),("2017-08-01",35.6027),("2017-08-02",37.2849),("2017-08-03",36.9124),("2017-08-04",37.107),("2017-08-07",37.6812),("2017-08-08",37.9825),("2017-08-09",38.215),("2017-08-10",37.0026),("2017-08-11",37.5172),("2017-08-14",38.0818),("2017-08-15",38.4987),("2017-08-16",38.3438),("2017-08-17",37.6077),("2017-08-18",37.5219),("2017-08-21",37.4528),("2017-08-22",38.0651),("2017-08-23",38.1127),("2017-08-24",37.9436),("2017-08-25",38.0842),("2017-08-28",38.4677),("2017-08-29",38.8108),("2017-08-30",38.9156),("2017-08-31",39.0704),("2017-09-01",39.0824),("2017-09-05",38.613),("2017-09-06",38.5725),("2017-09-07",38.4177),("2017-09-08",37.7911),("2017-09-11",38.4749),("2017-09-12",38.3224),("2017-09-13",38.0341),("2017-09-14",37.7077),("2017-09-15",38.0889),("2017-09-18",37.8007),("2017-09-19",37.815),("2017-09-20",37.1812),("2017-09-21",36.5428),("2017-09-22",36.1854),("2017-09-25",35.8662),("2017-09-26",36.4832),("2017-09-27",36.7429),("2017-09-28",36.5166),("2017-09-29",36.7167),("2017-10-02",36.6428),("2017-10-03",36.8025),("2017-10-04",36.5642),("2017-10-05",37.0192),("2017-10-06",36.9978),("2017-10-09",37.1265),("2017-10-10",37.1407),("2017-10-11",37.2956),("2017-10-12",37.1646),("2017-10-13",37.4004),("2017-10-16",38.0889),("2017-10-17",38.2295),("2017-10-18",38.0603),("2017-10-19",37.1598),("2017-10-20",37.2241),("2017-10-23",37.2051),("2017-10-24",37.4266),("2017-10-25",37.2622),("2017-10-26",37.5005),("2017-10-27",38.8441),("2017-10-30",39.7184),("2017-10-31",40.2711),("2017-11-01",39.7589),("2017-11-02",40.0496),("2017-11-03",41.0954),("2017-11-06",41.5124),("2017-11-07",41.6458),("2017-11-08",41.9864),("2017-11-09",41.9007),("2017-11-10",41.7625),("2017-11-13",41.5951),("2017-11-14",40.9663),("2017-11-15",40.426),("2017-11-16",40.9089),("2017-11-17",40.6818),("2017-11-20",40.6411),("2017-11-21",41.3967),("2017-11-22",41.8318),("2017-11-24",41.8342),("2017-11-27",41.6238),("2017-11-28",41.3799),("2017-11-29",40.5216),("2017-11-30",41.0883),("2017-12-01",40.897),("2017-12-04",40.5981),("2017-12-05",40.5599),("2017-12-06",40.4092),("2017-12-07",40.4833),("2017-12-08",40.4953),("2017-12-11",41.2843),("2017-12-12",41.0524),("2017-12-13",41.1887),("2017-12-14",41.1767),("2017-12-15",41.5951),("2017-12-18",42.1809),("2017-12-19",41.7314),("2017-12-20",41.686),("2017-12-21",41.8438),("2017-12-22",41.8438),("2017-12-26",40.7822),("2017-12-27",40.7894),("2017-12-28",40.9041),("2017-12-29",40.4618),("2018-01-02",41.1863),("2018-01-03",41.1791),("2018-01-04",41.3704),("2018-01-05",41.8414),("2018-01-08",41.686),("2018-01-09",41.6812),("2018-01-10",41.6716),("2018-01-11",41.9083),("2018-01-12",42.3411),("2018-01-16",42.1259),("2018-01-17",42.8217),("2018-01-18",42.8599),("2018-01-19",42.6687),("2018-01-22",42.3196),("2018-01-23",42.3291),("2018-01-24",41.6549),("2018-01-25",40.9113),("2018-01-26",41.007),("2018-01-29",40.1582),("2018-01-30",39.9215),("2018-01-31",40.0315),("2018-02-01",40.1151),("2018-02-02",38.3745),("2018-02-05",37.4158),("2018-02-06",38.9794),("2018-02-07",38.145),("2018-02-08",37.0954),("2018-02-09",37.5473),("2018-02-12",39.0596),("2018-02-13",39.4509),("2018-02-14",40.1783),("2018-02-15",41.5274),("2018-02-16",41.393),("2018-02-20",41.2538),("2018-02-21",41.0665),("2018-02-22",41.4098),("2018-02-23",42.13),("2018-02-26",42.963),("2018-02-27",42.8237),("2018-02-28",42.7589),("2018-03-01",42.0099),("2018-03-02",42.3004),("2018-03-05",42.4468),("2018-03-06",42.4108),("2018-03-07",42.0171),("2018-03-08",42.4756),("2018-03-09",43.2054),("2018-03-12",43.6231),("2018-03-13",43.203),("2018-03-14",42.8357),("2018-03-15",42.8861),("2018-03-16",42.7349),("2018-03-19",42.0819),("2018-03-20",42.0675),("2018-03-21",41.1145),("2018-03-22",40.5336),("2018-03-23",39.595),("2018-03-26",41.4746),("2018-03-27",40.4112),("2018-03-28",39.9646),("2018-03-29",40.2767),("2018-04-02",40.0127),("2018-04-03",40.4232),("2018-04-04",41.1961),("2018-04-05",41.4818),("2018-04-06",40.4208),("2018-04-09",40.8216),("2018-04-10",41.5898),("2018-04-11",41.3954),("2018-04-12",41.8035),("2018-04-13",41.9451),("2018-04-16",42.2068),("2018-04-17",42.7877),("2018-04-18",42.6917),("2018-04-19",41.4818),("2018-04-20",39.7822),("2018-04-23",39.667),("2018-04-24",39.1148),("2018-04-25",39.2853),("2018-04-26",39.4221),("2018-04-27",38.966),("2018-04-30",39.6718),("2018-05-01",40.5936),("2018-05-02",42.3868),("2018-05-03",42.4636),("2018-05-04",44.1296),("2018-05-07",44.4489),("2018-05-08",44.6626),("2018-05-09",44.977),("2018-05-10",45.6204),("2018-05-11",45.4475),("2018-05-14",45.3415),("2018-05-15",44.9294),("2018-05-16",45.3487),("2018-05-17",45.062),("2018-05-18",44.8981),("2018-05-21",45.2162),("2018-05-22",45.1029),("2018-05-23",45.3921),("2018-05-24",45.3415),("2018-05-25",45.4451),("2018-05-29",45.2813),("2018-05-30",45.1849),("2018-05-31",45.033),("2018-06-01",45.8452),("2018-06-04",46.2283),("2018-06-05",46.585),("2018-06-06",46.7465),("2018-06-07",46.6211),("2018-06-08",46.197),("2018-06-11",46.0837),("2018-06-12",46.3368),("2018-06-13",45.956),("2018-06-14",45.9801),("2018-06-15",45.5078),("2018-06-18",45.4837),("2018-06-19",44.7487),("2018-06-20",44.9439),("2018-06-21",44.6933),("2018-06-22",44.5631),("2018-06-25",43.9004),("2018-06-26",44.445),("2018-06-27",44.38),("2018-06-28",44.7029),("2018-06-29",44.6089),("2018-07-02",45.1078),("2018-07-03",44.3221),("2018-07-05",44.6788),("2018-07-06",45.2981),("2018-07-09",45.9271),("2018-07-10",45.8717),("2018-07-11",45.2764),("2018-07-12",46.0355),("2018-07-13",46.1078),("2018-07-16",46.0066),("2018-07-17",46.1368),("2018-07-18",45.8837),("2018-07-19",46.2404),("2018-07-20",46.1344),("2018-07-23",46.1753),("2018-07-24",46.5103),("2018-07-25",46.9489),("2018-07-26",46.8019),("2018-07-27",46.0235),("2018-07-30",45.7656),("2018-07-31",45.8572),("2018-08-01",48.5587),("2018-08-02",49.9781),("2018-08-03",50.1227),("2018-08-06",50.3829),("2018-08-07",49.9106),("2018-08-08",49.9443),("2018-08-09",50.3371),("2018-08-10",50.1877),("2018-08-13",50.5118),("2018-08-14",50.7246),("2018-08-15",50.8431),("2018-08-16",51.588),("2018-08-17",52.6182),("2018-08-20",52.1055),("2018-08-21",52.0039),("2018-08-22",52.0063),("2018-08-23",52.1127),("2018-08-24",52.2748),("2018-08-27",52.7052),("2018-08-28",53.1309),("2018-08-29",53.9241),("2018-08-30",54.4198),("2018-08-31",55.0486),("2018-09-04",55.2251),("2018-09-05",54.8648),("2018-09-06",53.9531),("2018-09-07",53.5178),("2018-09-10",52.7995),("2018-09-11",54.1345),("2018-09-12",53.4622),("2018-09-13",54.7536),("2018-09-14",54.132),("2018-09-17",52.6907),("2018-09-18",52.7778),("2018-09-19",52.8092),("2018-09-20",53.2107),("2018-09-21",52.6375),("2018-09-24",53.3944),("2018-09-25",53.733),("2018-09-26",53.305),("2018-09-27",54.4005),("2018-09-28",54.5915),("2018-10-01",54.9591),("2018-10-02",55.4476),("2018-10-03",56.1223),("2018-10-04",55.1357),("2018-10-05",54.2409),("2018-10-08",54.1151),("2018-10-09",54.8648),("2018-10-10",52.3231),("2018-10-11",51.8612),("2018-10-12",53.7137),("2018-10-15",52.565),("2018-10-16",53.7233),("2018-10-17",53.4912),("2018-10-18",52.2409),("2018-10-19",53.0365),("2018-10-22",53.3606),("2018-10-23",53.8636),("2018-10-24",52.016),("2018-10-25",53.155),("2018-10-26",52.3086),("2018-10-29",51.3268),("2018-10-30",51.5831),("2018-10-31",52.9277),("2018-11-01",53.7403),("2018-11-02",50.1756),("2018-11-05",48.7512),("2018-11-06",49.2784),("2018-11-07",50.773),("2018-11-08",50.5964),("2018-11-09",49.6209),("2018-11-12",47.1213),("2018-11-13",46.6505),("2018-11-14",45.3327),("2018-11-15",46.4515),("2018-11-16",46.9659),("2018-11-19",45.1046),("2018-11-20",42.9496),("2018-11-21",42.901),("2018-11-23",41.8114),("2018-11-26",42.3768),("2018-11-27",42.2846),("2018-11-28",43.9106),("2018-11-29",43.5733),("2018-11-30",43.3379),("2018-12-03",44.8522),("2018-12-04",42.8792),("2018-12-06",42.4011),("2018-12-07",40.8892),("2018-12-10",41.1586),("2018-12-11",40.9232),("2018-12-12",41.0373),("2018-12-13",41.4862),("2018-12-14",40.1588),("2018-12-17",39.785),("2018-12-18",40.3019),("2018-12-19",39.0448),("2018-12-20",38.0596),("2018-12-21",36.5792),("2018-12-24",35.6328),("2018-12-26",38.1421),("2018-12-27",37.8945),("2018-12-28",37.914),("2018-12-31",38.2804),("2019-01-02",38.3241),("2019-01-03",34.5067),("2019-01-04",35.9798),("2019-01-07",35.8997),("2019-01-08",36.5841),("2019-01-09",37.2053),("2019-01-10",37.3242),("2019-01-11",36.9578),("2019-01-14",36.4021),("2019-01-15",37.1471),("2019-01-16",37.6009),("2019-01-17",37.8242),("2019-01-18",38.0571),("2019-01-22",37.2029),("2019-01-23",37.3534),("2019-01-24",37.0573),("2019-01-25",38.2853),("2019-01-28",37.9309),("2019-01-29",37.5378),("2019-01-30",40.1029),("2019-01-31",40.3917),("2019-02-01",40.4111),("2019-02-04",41.559),("2019-02-05",42.2701),("2019-02-06",42.2846),("2019-02-07",41.4838),("2019-02-08",41.5323),("2019-02-11",41.2935),("2019-02-12",41.6493),("2019-02-13",41.4763),("2019-02-14",41.6274),("2019-02-15",41.5348),("2019-02-19",41.6591),("2019-02-20",41.9271),("2019-02-21",41.6907),("2019-02-22",42.1562),("2019-02-25",42.4633),("2019-02-26",42.4877),("2019-02-27",42.6193),("2019-02-28",42.2001),("2019-03-01",42.6437),("2019-03-04",42.8582),("2019-03-05",42.7802),("2019-03-06",42.534),("2019-03-07",42.0417),("2019-03-08",42.1416),("2019-03-11",43.6015),("2019-03-12",44.0914),("2019-03-13",44.2864),("2019-03-14",44.7787),("2019-03-15",45.3612),("2019-03-18",45.8242),("2019-03-19",45.4611),("2019-03-20",45.8584),("2019-03-21",47.5473),("2019-03-22",46.5627),("2019-03-25",45.9997),("2019-03-26",45.5245),("2019-03-27",45.9339),("2019-03-28",45.9948),("2019-03-29",46.2946),("2019-04-01",46.609),("2019-04-02",47.2866),("2019-04-03",47.6107),("2019-04-04",47.6936),("2019-04-05",48.0128),("2019-04-08",48.7684),("2019-04-09",48.6221),("2019-04-10",48.8951),("2019-04-11",48.4881),("2019-04-12",48.4686),("2019-04-15",48.5563),("2019-04-16",48.5612),("2019-04-17",49.5068),("2019-04-18",49.6848),("2019-04-22",49.848),("2019-04-23",50.567),("2019-04-24",50.489),("2019-04-25",50.0308),("2019-04-26",49.792),("2019-04-29",49.8675),("2019-04-30",48.9073),("2019-05-01",51.3079),("2019-05-02",50.974),("2019-05-03",51.6077),("2019-05-06",50.8107),("2019-05-07",49.441),("2019-05-08",49.4508),("2019-05-09",48.9195),("2019-05-10",48.2444),("2019-05-13",45.4404),("2019-05-14",46.1598),("2019-05-15",46.7127),("2019-05-16",46.5072),("2019-05-17",46.243),("2019-05-20",44.7969),("2019-05-21",45.6557),("2019-05-22",44.7211),("2019-05-23",43.9577),("2019-05-24",43.7889),("2019-05-28",43.6078),("2019-05-29",43.3999),("2019-05-30",43.625),("2019-05-31",42.8347),("2019-06-03",42.4016),("2019-06-04",43.9528),("2019-06-05",44.6624),("2019-06-06",45.3181),("2019-06-07",46.5243),("2019-06-10",47.1189),("2019-06-11",47.6645),("2019-06-12",47.5128),("2019-06-13",47.503),("2019-06-14",47.158),("2019-06-17",47.4394),("2019-06-18",48.5551),("2019-06-19",48.4132),("2019-06-20",48.8022),("2019-06-21",48.6358),("2019-06-24",48.5869),("2019-06-25",47.8504),("2019-06-26",48.8854),("2019-06-27",48.8707),("2019-06-28",48.4254),("2019-07-01",49.3136),("2019-07-02",49.6023),("2019-07-03",50.0133),("2019-07-05",49.9693),("2019-07-08",48.9392),("2019-07-09",49.2377),("2019-07-10",49.7246),("2019-07-11",49.3625),("2019-07-12",49.7418),("2019-07-15",50.2091),("2019-07-16",50.0354),("2019-07-17",49.754),("2019-07-18",50.3192),("2019-07-19",49.568),("2019-07-22",50.7009),("2019-07-23",51.0972),("2019-07-24",51.0556),("2019-07-25",50.6519),("2019-07-26",50.8281),("2019-07-29",51.3028),("2019-07-30",51.0826),("2019-07-31",52.1249),("2019-08-01",50.9969),("2019-08-02",49.9179),("2019-08-05",47.3048),("2019-08-06",48.2003),("2019-08-07",48.6995),("2019-08-08",49.7736),("2019-08-09",49.365),("2019-08-12",49.2397),("2019-08-13",51.3249),("2019-08-14",49.7972),("2019-08-15",49.5492),("2019-08-16",50.7183),("2019-08-19",51.6639),("2019-08-20",51.6663),("2019-08-21",52.2263),("2019-08-22",52.1821),("2019-08-23",49.7702),("2019-08-26",50.7158),("2019-08-27",50.1435),("2019-08-28",50.48),("2019-08-29",51.3348),("2019-08-30",51.2684),("2019-09-03",50.5218),("2019-09-04",51.379),("2019-09-05",52.3835),("2019-09-06",52.3786),("2019-09-09",52.6021),("2019-09-10",53.2235),("2019-09-11",54.9157),("2019-09-12",54.7917),("2019-09-13",53.727),("2019-09-16",54.0094),("2019-09-17",54.2059),("2019-09-18",54.7143),("2019-09-19",54.2698),("2019-09-20",53.4765),("2019-09-23",53.7196),("2019-09-24",53.4642),("2019-09-25",54.287),("2019-09-26",54.007),("2019-09-27",53.7442),("2019-09-30",55.0091),("2019-10-01",55.1613),("2019-10-02",53.7786),("2019-10-03",54.2354),("2019-10-04",55.7557),("2019-10-07",55.768),("2019-10-08",55.1147),("2019-10-09",55.7606),("2019-10-10",56.5122),("2019-10-11",58.0153),("2019-10-14",57.9318),("2019-10-15",57.7967),("2019-10-16",57.5634),("2019-10-17",57.7869),("2019-10-18",58.0644),("2019-10-21",59.0714),("2019-10-22",58.9364),("2019-10-23",59.7272),("2019-10-24",59.8255),("2019-10-25",60.5623),("2019-10-28",61.1689),("2019-10-29",59.7542),("2019-10-30",59.7469),("2019-10-31",61.0977),("2019-11-01",62.8317),("2019-11-04",63.2443),("2019-11-05",63.1535),("2019-11-06",63.1805),("2019-11-07",63.9075),("2019-11-08",64.0824),("2019-11-11",64.5898),("2019-11-12",64.5307),("2019-11-13",65.149),("2019-11-14",64.6982),("2019-11-15",65.4668),("2019-11-18",65.7969),("2019-11-19",65.5974),("2019-11-20",64.8337),("2019-11-21",64.543),("2019-11-22",64.4864),("2019-11-25",65.6171),("2019-11-26",65.1047),("2019-11-27",65.9792),("2019-11-29",65.8338),("2019-12-02",65.0727),("2019-12-03",63.9124),("2019-12-04",64.4765),("2019-12-05",65.4225),("2019-12-06",66.6862),("2019-12-09",65.7526),("2019-12-10",66.1368),("2019-12-11",66.701),("2019-12-12",66.8709),("2019-12-13",67.7799),("2019-12-16",68.9402),("2019-12-17",69.0757),("2019-12-18",68.9106),("2019-12-19",68.9796),("2019-12-20",68.8367),("2019-12-23",69.96),("2019-12-24",70.0265),("2019-12-26",71.4159),("2019-12-27",71.3888),("2019-12-30",71.8125),("2019-12-31",72.3372),("2020-01-02",73.9876),("2020-01-03",73.2683),("2020-01-06",73.8521),("2020-01-07",73.5048),("2020-01-08",74.6872),("2020-01-09",76.2736),("2020-01-10",76.4461),("2020-01-13",78.0793),("2020-01-14",77.025),("2020-01-15",76.6949),("2020-01-16",77.6556),("2020-01-17",78.5153),("2020-01-21",77.9832),("2020-01-22",78.2616),("2020-01-23",78.6385),("2020-01-24",78.4119),("2020-01-27",76.1061),("2020-01-28",78.2591),("2020-01-29",79.8973),("2020-01-30",79.7815),("2020-01-31",76.2441),("2020-02-03",76.0347),("2020-02-04",78.5449),("2020-02-05",79.1854),("2020-02-06",80.1116),("2020-02-07",79.0252),("2020-02-10",79.4006),("2020-02-11",78.9215),("2020-02-12",80.7957),("2020-02-13",80.2204),("2020-02-14",80.2401),("2020-02-18",78.7709),("2020-02-19",79.9117),("2020-02-20",79.0919),("2020-02-21",77.3017),("2020-02-24",73.6298),("2020-02-25",71.1358),("2020-02-26",72.2643),("2020-02-27",67.5405),("2020-02-28",67.501),("2020-03-02",73.7854),("2020-03-03",71.442),("2020-03-04",74.7558),("2020-03-05",72.331),("2020-03-06",71.3704),("2020-03-09",65.7256),("2020-03-10",70.4592),("2020-03-11",68.0121),("2020-03-12",61.2956),("2020-03-13",68.6393),("2020-03-16",59.8091),("2020-03-17",62.4389),("2020-03-18",60.9104),("2020-03-19",60.4437),("2020-03-20",56.6064),("2020-03-23",55.4039),("2020-03-24",60.9623),("2020-03-25",60.6264),("2020-03-26",63.8168),("2020-03-27",61.1746),("2020-03-30",62.9204),("2020-03-31",62.792),("2020-04-01",59.4881),("2020-04-02",60.4807),("2020-04-03",59.6116),("2020-04-06",64.8119),("2020-04-07",64.0612),("2020-04-08",65.7009),("2020-04-09",66.175),("2020-04-13",67.4738),("2020-04-14",70.8815),("2020-04-15",70.2345),("2020-04-16",70.7926),("2020-04-17",69.832),("2020-04-20",68.3825),("2020-04-21",66.2688),("2020-04-22",68.1776),("2020-04-23",67.9134),("2020-04-24",69.874),("2020-04-27",69.9234),("2020-04-28",68.79),("2020-04-29",71.0494),("2020-04-30",72.5483),("2020-05-01",71.3803),("2020-05-04",72.3902),("2020-05-05",73.4767),("2020-05-06",74.2348),("2020-05-07",75.0027),("2020-05-08",76.7831),("2020-05-11",77.9913),("2020-05-12",77.1),("2020-05-13",76.1691),("2020-05-14",76.637),("2020-05-15",76.184),("2020-05-18",77.9789),("2020-05-19",77.5283),("2020-05-20",79.0361),("2020-05-21",78.4469),("2020-05-22",78.9519),("2020-05-26",78.4172),("2020-05-27",78.7588),("2020-05-28",78.7935),("2020-05-29",78.7167),("2020-06-01",79.6848),("2020-06-02",80.0537),("2020-06-03",80.4944),("2020-06-04",79.8012),("2020-06-05",82.074),("2020-06-08",82.5592),("2020-06-09",85.1663),("2020-06-10",87.3574),("2020-06-11",83.1633),("2020-06-12",83.8813),("2020-06-15",84.9187),("2020-06-16",87.1692),("2020-06-17",87.0479),("2020-06-18",87.0826),("2020-06-19",86.585),("2020-06-22",88.8503),("2020-06-23",90.7468),("2020-06-24",89.145),("2020-06-25",90.3284),("2020-06-26",87.553),("2020-06-29",89.5708),("2020-06-30",90.3185),("2020-07-01",90.1477),("2020-07-02",90.1477),("2020-07-06",92.5591),("2020-07-07",92.2719),("2020-07-08",94.421),("2020-07-09",94.7577),("2020-07-10",94.9929),("2020-07-13",94.5547),("2020-07-14",96.1194),("2020-07-15",96.7804),("2020-07-16",95.5896),("2020-07-17",95.3965),("2020-07-20",97.4068),("2020-07-21",96.0625),("2020-07-22",96.3323),("2020-07-23",91.9476),("2020-07-24",91.7198),("2020-07-27",93.8936),("2020-07-28",92.3512),("2020-07-29",94.1214),("2020-07-30",95.2603),("2020-07-31",105.233),("2020-08-03",107.8846),("2020-08-04",108.605),("2020-08-05",108.9987),("2020-08-06",112.8016),("2020-08-07",110.2416),("2020-08-10",111.8439),("2020-08-11",108.5177),("2020-08-12",112.1242),("2020-08-13",114.1085),("2020-08-14",114.0068),("2020-08-17",113.7092),("2020-08-18",114.6567),("2020-08-19",114.8006),("2020-08-20",117.3479),("2020-08-21",123.3952),("2020-08-24",124.871),("2020-08-25",123.8466),("2020-08-26",125.5308),("2020-08-27",124.0301),("2020-08-28",123.8292),("2020-08-31",128.0285),("2020-09-01",133.1283),("2020-09-02",130.37),("2020-09-03",119.9325),("2020-09-04",120.0119),("2020-09-08",111.9357),("2020-09-09",116.4004),("2020-09-10",112.6004),("2020-09-11",111.1221),("2020-09-14",114.4508),("2020-09-15",114.6344),("2020-09-16",111.2511),("2020-09-17",109.4751),("2020-09-18",106.0026),("2020-09-21",109.2172),("2020-09-22",110.9336),("2020-09-23",106.2804),("2020-09-24",107.3717),("2020-09-25",111.3999),("2020-09-28",114.0589),("2020-09-29",113.1957),("2020-09-30",114.9022),("2020-10-01",115.8746),("2020-10-02",112.1341),("2020-10-05",115.5868),("2020-10-06",112.273),("2020-10-07",114.178),("2020-10-08",114.0688),("2020-10-09",116.0532),("2020-10-12",123.4249),("2020-10-13",120.1508),("2020-10-14",120.2401),("2020-10-15",119.7638),("2020-10-16",118.0871),("2020-10-19",115.0709),("2020-10-20",116.5889),("2020-10-21",115.9539),("2020-10-22",114.8427),("2020-10-23",114.1383),("2020-10-26",114.1482),("2020-10-27",115.6861),("2020-10-28",110.3284),("2020-10-29",114.4161),("2020-10-30",108.0067),("2020-11-02",107.9174),("2020-11-03",109.5743),("2020-11-04",114.049),("2020-11-05",118.097),("2020-11-06",117.9631),("2020-11-09",115.6076),("2020-11-10",115.2597),("2020-11-11",118.7582),("2020-11-12",118.4799),("2020-11-13",118.5296),("2020-11-16",119.5632),("2020-11-17",118.6588),("2020-11-18",117.3071),("2020-11-19",117.9134),("2020-11-20",116.6213),("2020-11-23",113.1527),("2020-11-24",114.4646),("2020-11-25",115.3194),("2020-11-27",115.8759),("2020-11-30",118.3209),("2020-12-01",121.9684),("2020-12-02",122.3262),("2020-12-03",122.187),("2020-12-04",121.5013),("2020-12-07",122.9921),("2020-12-08",123.6182),("2020-12-09",121.0341),("2020-12-10",122.4852),("2020-12-11",121.6603),("2020-12-14",121.0341),("2020-12-15",127.0968),("2020-12-16",127.0272),("2020-12-17",127.9118),("2020-12-18",125.8793),("2020-12-21",127.4446),("2020-12-22",131.0723),("2020-12-23",130.1579),("2020-12-24",131.1617),("2020-12-28",135.8528),("2020-12-29",134.044),("2020-12-30",132.901),("2020-12-31",131.8773),("2021-01-04",128.6174),("2021-01-05",130.2076),("2021-01-06",125.8246),("2021-01-07",130.1182),("2021-01-08",131.2412),("2021-01-11",128.19),("2021-01-12",128.0111),("2021-01-13",130.0883),("2021-01-14",128.1205),("2021-01-15",126.3613),("2021-01-19",127.0471),("2021-01-20",131.2214),("2021-01-21",136.0317),("2021-01-22",138.2182),("2021-01-25",142.0447),("2021-01-26",142.2832),("2021-01-27",141.1899),("2021-01-28",136.2504),("2021-01-29",131.1518),("2021-02-01",133.3184),("2021-02-02",134.1632),("2021-02-03",133.1197),("2021-02-04",136.5485),("2021-02-05",136.1261),("2021-02-08",136.2754),("2021-02-09",135.3796),("2021-02-10",134.7625),("2021-02-11",134.5037),("2021-02-12",134.7426),("2021-02-16",132.5727),("2021-02-17",130.2336),("2021-02-18",129.1088),("2021-02-19",129.2681),("2021-02-22",125.416),("2021-02-23",125.2767),("2021-02-24",124.769),("2021-02-25",120.4292),("2021-02-26",120.698),("2021-03-01",127.1977),("2021-03-02",124.5401),("2021-03-03",121.4943),("2021-03-04",119.5732),("2021-03-05",120.8572),("2021-03-08",115.8207),("2021-03-09",120.5238),("2021-03-10",119.4239),("2021-03-11",121.3947),("2021-03-12",120.469),("2021-03-15",123.4153),("2021-03-16",124.988),("2021-03-17",124.1818),("2021-03-18",119.9714),("2021-03-19",119.4339),("2021-03-22",122.8181),("2021-03-23",121.972),("2021-03-24",119.5334),("2021-03-25",120.0311),("2021-03-26",120.6482),("2021-03-29",120.8274),("2021-03-30",119.3443),("2021-03-31",121.5839),("2021-04-01",122.4299),("2021-04-05",125.3165),("2021-04-06",125.625),("2021-04-07",127.3072),("2021-04-08",129.7558),("2021-04-09",132.3786),("2021-04-12",130.6317),("2021-04-13",133.8069),("2021-04-14",131.4181),("2021-04-15",133.8766),("2021-04-16",133.5382),("2021-04-19",134.215),("2021-04-20",132.4931),("2021-04-21",132.8812),("2021-04-22",131.3285),("2021-04-23",133.6974),("2021-04-26",134.0956),("2021-04-27",133.7671),("2021-04-28",132.9609),("2021-04-29",132.8613),("2021-04-30",130.8507),("2021-05-03",131.9257),("2021-05-04",127.2574),("2021-05-05",127.5063),("2021-05-06",129.1387),("2021-05-07",129.8255),("2021-05-10",126.4754),("2021-05-11",125.5382),("2021-05-12",122.4074),("2021-05-13",124.601),("2021-05-14",127.0736),("2021-05-17",125.8971),("2021-05-18",124.4813),("2021-05-19",124.3218),("2021-05-20",126.934),("2021-05-21",125.0596),("2021-05-24",126.7247),("2021-05-25",126.5253),("2021-05-26",126.4754),("2021-05-27",124.91),("2021-05-28",124.242),("2021-06-01",123.913),("2021-06-02",124.6907),("2021-06-03",123.1752),("2021-06-04",125.5182),("2021-06-07",125.5282),("2021-06-08",126.3657),("2021-06-09",126.7546),("2021-06-10",125.7376),("2021-06-11",126.9739),("2021-06-14",130.0947),("2021-06-15",129.2572),("2021-06-16",129.7657),("2021-06-17",131.4008),("2021-06-18",130.0747),("2021-06-21",131.9093),("2021-06-22",133.5843),("2021-06-23",133.3052),("2021-06-24",133.016),("2021-06-25",132.7169),("2021-06-28",134.382),("2021-06-29",135.9274),("2021-06-30",136.5555),("2021-07-01",136.8646),("2021-07-02",139.5467),("2021-07-06",141.6006),("2021-07-07",144.1431),("2021-07-08",142.817),("2021-07-09",144.6815),("2021-07-12",144.0733),("2021-07-13",145.2099),("2021-07-14",148.7095),("2021-07-15",148.0415),("2021-07-16",145.9577),("2021-07-19",142.0293),("2021-07-20",145.7184),("2021-07-21",144.9706),("2021-07-22",146.3665),("2021-07-23",148.1213),("2021-07-26",148.55),("2021-07-27",146.3366),("2021-07-28",144.5519),("2021-07-29",145.2099),("2021-07-30",145.4293),("2021-08-02",145.0903),("2021-08-03",146.9248),("2021-08-04",146.516),("2021-08-05",146.6257),("2021-08-06",145.9278),("2021-08-09",145.8779),("2021-08-10",145.3886),("2021-08-11",145.6482),("2021-08-12",148.6738),("2021-08-13",148.8835),("2021-08-16",150.9006),("2021-08-17",149.9719),("2021-08-18",146.1475),("2021-08-19",146.487),("2021-08-20",147.9748),("2021-08-23",149.4926),("2021-08-24",149.4027),("2021-08-25",148.1446),("2021-08-26",147.3258),("2021-08-27",148.3842),("2021-08-30",152.8976),("2021-08-31",151.6095),("2021-09-01",152.2885),("2021-09-02",153.4269),("2021-09-03",154.0759),("2021-09-07",156.4625),("2021-09-08",154.8848),("2021-09-09",153.8463),("2021-09-10",148.7537),("2021-09-13",149.3328),("2021-09-14",147.9049),("2021-09-15",148.8136),("2021-09-16",148.5739),("2021-09-17",145.8479),("2021-09-20",142.7324),("2021-09-21",143.2217),("2021-09-22",145.6382),("2021-09-23",146.6168),("2021-09-24",146.7067),("2021-09-27",145.1589),("2021-09-28",141.7039),("2021-09-29",142.6226),("2021-09-30",141.2945),("2021-10-01",142.4429),("2021-10-04",138.9379),("2021-10-05",140.9051),("2021-10-06",141.7938),("2021-10-07",143.0819),("2021-10-08",142.6925),("2021-10-11",142.6026),("2021-10-12",141.3045),("2021-10-13",140.7054),("2021-10-14",143.5512),("2021-10-15",144.6297),("2021-10-18",146.3372),("2021-10-19",148.544),("2021-10-20",149.0433),("2021-10-21",149.2629),("2021-10-22",148.4741),("2021-10-25",148.4242),("2021-10-26",149.1032),("2021-10-27",148.6338),("2021-10-28",152.3484),("2021-10-29",149.5825),("2021-11-01",148.7437),("2021-11-02",149.8021),("2021-11-03",151.27),("2021-11-04",150.7408),("2021-11-05",151.28),("2021-11-08",150.44),("2021-11-09",150.81),("2021-11-10",147.92),("2021-11-11",147.87),("2021-11-12",149.99),("2021-11-15",150.0),("2021-11-16",151.0),("2021-11-17",153.49),("2021-11-18",157.87),("2021-11-19",160.55),("2021-11-22",161.02),("2021-11-23",161.41),("2021-11-24",161.94),("2021-11-26",156.81),("2021-11-29",160.24),("2021-11-30",165.3),("2021-12-01",164.77),("2021-12-02",163.76),("2021-12-03",161.84),("2021-12-06",165.32),("2021-12-07",171.18),("2021-12-08",175.08),("2021-12-09",174.56),("2021-12-10",179.45),("2021-12-13",175.74),("2021-12-14",174.33),("2021-12-15",179.3),("2021-12-16",172.26),("2021-12-17",171.14),("2021-12-20",169.75),("2021-12-21",172.99),("2021-12-22",175.64),("2021-12-23",176.28),("2021-12-27",180.33),("2021-12-28",179.29),("2021-12-29",179.38),("2021-12-30",178.2),("2021-12-31",177.57),("2022-01-03",182.01),("2022-01-04",179.7),("2022-01-05",174.92),("2022-01-06",172.0),("2022-01-07",172.17)]
+ javelin.cabal view
@@ -0,0 +1,141 @@+cabal-version: 3.0+name: javelin+version: 0.1.0.0+synopsis: Labeled one-dimensional arrays+license: MIT+license-file: LICENSE+author: Laurent P. René de Cotret+maintainer: laurent.decotret@outlook.com+category: Data, Data Structures, Data Science+build-type: Simple+extra-doc-files: CHANGELOG.md+ files/aapl.txt+tested-with: GHC ==9.8.1 + || ==9.6.3+ || ==9.4.7 +description:+ + This package implements 'Series', labeled one-dimensional arrays+ combining properties from maps and arrays.+ + To get started, the important modules are:+ + ["Data.Series"] Boxed series of arbitrary types.+ + ["Data.Series.Unboxed"] Series of unboxed data types for better performance, at the cost of flexibility.+ + ["Data.Series.Generic"] Generic interface to manipulate any type of 'Series'.+ + ["Data.Series.Index"] Index containing series keys.+ + To get started, please take a look at the tutorial ("Data.Series.Tutorial").+ ++common common+ default-language: GHC2021+ ghc-options: -Wall+ -Wcompat+ -Widentities+ -Wincomplete-uni-patterns+ -Wincomplete-record-updates+ -Wredundant-constraints+ -fhide-source-paths+ -Wpartial-fields++library+ import: common+ hs-source-dirs: src+ exposed-modules: Data.Series+ Data.Series.Generic+ Data.Series.Generic.Internal+ Data.Series.Index+ Data.Series.Index.Internal+ Data.Series.Tutorial+ Data.Series.Unboxed+ other-modules: Data.Series.Generic.Aggregation+ Data.Series.Generic.Definition+ Data.Series.Generic.Numeric+ Data.Series.Generic.Scans+ Data.Series.Generic.View+ Data.Series.Generic.Zip+ Data.Series.Index.Definition+ build-depends: base >=4.15.0.0 && <4.20,+ containers >=0.6 && <0.8,+ deepseq >=1.4 && <1.6,+ foldl ^>=1.4,+ indexed-traversable ^>=0.1,+ vector >=0.12.3.0 && <0.14,+ vector-algorithms ^>=0.9++test-suite javelin-test+ import: common+ type: exitcode-stdio-1.0+ hs-source-dirs: test+ main-is: Main.hs+ other-modules: Test.Data.Series+ Test.Data.Series.Index+ Test.Data.Series.Generic.Aggregation+ Test.Data.Series.Generic.Definition+ Test.Data.Series.Generic.Numeric+ Test.Data.Series.Generic.View+ Test.Data.Series.Generic.Zip+ Test.Utils+ build-depends: base,+ containers,+ foldl,+ hedgehog,+ HUnit,+ ieee754,+ javelin,+ statistics,+ tasty,+ tasty-hedgehog,+ tasty-hspec,+ tasty-hunit,+ vector+++-- Running the 'comparison-containers' benchmark is expected+-- to be done in conjunction with the cabal.project.profiling project file:+-- > cabal bench comparison-containers --project=cabal.project.profiling+benchmark comparison-containers+ import: common+ type: exitcode-stdio-1.0+ ghc-options: -rtsopts+ hs-source-dirs: benchmarks+ main-is: Comparison.hs+ build-depends: base,+ containers,+ foldl,+ mono-traversable,+ javelin,+ vector, + criterion, + deepseq, + random, + directory+++-- Running the 'operations' benchmark is expected+-- to be done in conjunction with the cabal.project.profiling project file:+-- > cabal bench operations --project=cabal.project.profiling+benchmark operations+ import: common+ type: exitcode-stdio-1.0+ ghc-options: -rtsopts+ hs-source-dirs: benchmarks+ main-is: Operations.hs+ build-depends: base,+ containers,+ deepseq,+ foldl,+ javelin,+ criterion+++executable bench-report+ import: common+ main-is: bench-report.hs+ hs-source-dirs: scripts+ build-depends: base, + csv ^>=0.1
+ scripts/bench-report.hs view
@@ -0,0 +1,100 @@+-- This script has been forked from:+-- https://github.com/haskell-perf/sets/blob/master/Report.hs+{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}+module Main (main) where++import Data.Function ( on )+import Data.List ( groupBy, intercalate, nub )+import System.Environment ( getArgs )+import Text.CSV ( parseCSVFromFile )+import Text.Printf ( printf )++main :: IO ()+main = do+ from:to:_ <- getArgs+ reportFromCsv from to++reportFromCsv :: FilePath -> FilePath -> IO ()+reportFromCsv from to = do+ result <- parseCSVFromFile from+ case result of+ Right (_:rows) -> do+ writeFile to+ (unlines+ (map+ format+ (filter+ (not . all (all null))+ (groupBy (on (==) (takeWhile (/= '/') . concat . take 1)) rows))))+ _ -> error "Couldn't parse csv"++format :: [[String]] -> String+format rows =+ ("## " ++ takeWhile (/= '/') (concat (concat (take 1 (drop 1 rows))))) +++ "\n\n" +++ unlines+ [ "|Name|" ++ intercalate "|" scales ++ "|"+ , "|" ++ concat (replicate (1 + length scales) "---|")+ ] +++ unlines+ (map+ (\name ->+ "|" ++ name ++ "|" ++ intercalate "|" (valuesByName name) ++ "|")+ names)+ where+ valuesByName name =+ map+ (\row@(_:avg:_) ->+ let scale = rowScale row+ in float (valuesByScale scale) (read avg))+ (filter ((== name) . rowName) rows)+ valuesByScale scale =+ map (\(_:avg:_) -> read avg) (filter ((== scale) . rowScale) rows)+ names = nub (map rowName rows)+ scales = nub (map rowScale rows)+ rowName row =+ let s =+ takeWhile+ (/= ':')+ (dropWhile (== '/') (dropWhile (/= '/') (concat (take 1 row))))+ in s+ rowScale row =+ let scale = dropWhile (== ':') (dropWhile (/= ':') (concat (take 1 row)))+ in scale++float :: [Double] -> Double -> String+float others x = let (scale, ext) = secs (mean others)+ in with (x * scale) ext++-- | Convert a number of seconds to a string. The string will consist+-- of four decimal places, followed by a short description of the time+-- units.+secs :: Double -> (Double, String)+secs k+ | k >= 1 = 1 `pair` "s"+ | k >= 1e-3 = 1e3 `pair` "ms"+ | k >= 1e-6 = 1e6 `pair` "μs"+ | k >= 1e-9 = 1e9 `pair` "ns"+ | k >= 1e-12 = 1e12 `pair` "ps"+ | k >= 1e-15 = 1e15 `pair` "fs"+ | k >= 1e-18 = 1e18 `pair` "as"+ | otherwise = error "Bad scale"+ where pair= (,)++with :: Double -> String -> String+with (t :: Double) (u :: String)+ | t >= 1e9 = printf "%.4g %s" t u+ | t >= 1e3 = printf "%.0f %s" t u+ | t >= 1e2 = printf "%.1f %s" t u+ | t >= 1e1 = printf "%.2f %s" t u+ | otherwise = printf "%.3f %s" t u++-- | Simple rolling average.+mean :: [Double] -> Double+mean =+ snd .+ foldr+ (\x (cnt,avg) ->+ ( cnt + 1+ , (x + avg * cnt) / (cnt + 1)))+ (0, 0)
+ src/Data/Series.hs view
@@ -0,0 +1,1361 @@+-----------------------------------------------------------------------------+-- |+-- Module : Data.Series+-- Copyright : (c) Laurent P. René de Cotret+-- License : MIT+-- Maintainer : laurent.decotret@outlook.com+-- Portability : portable+--+-- This module contains data structures and functions to work with 'Series' capable of holding any Haskell value. +-- For better performance, at the cost of less flexibility, see the "Data.Series.Unboxed".+--+-- = Introduction to series+--+-- A 'Series' of type @Series k a@ is a labeled array of values of type @a@,+-- indexed by keys of type @k@.+--+-- Like `Data.Map.Strict.Map` from the @containers@ package, 'Series' support efficient:+--+-- * random access by key ( \(O(\log n)\) );+-- * slice by key ( \(O(\log n)\) ).+--+-- Like `Data.Vector.Vector`, they support efficient:+--+-- * random access by index ( \(O(1)\) );+-- * slice by index ( \(O(1)\) );+-- * numerical operations.+--+-- This module re-exports most of the content of "Data.Series.Generic", with type signatures +-- specialized to the boxed container type `Data.Vector.Vector`.+--+-- For better performance (at the cost of more constraints), especially when it comes to numerical calculations, prefer to+-- use "Data.Series.Unboxed", which contains an implementation of series specialized to the unboxed container type `Data.Vector.Unboxed.Vector`.+ +module Data.Series (+ Series, index, values,++ -- * Building/converting 'Series'+ singleton, fromIndex,+ -- ** Lists+ fromList, toList,+ -- ** Vectors+ fromVector, toVector,+ -- ** Handling duplicates+ Occurrence, fromListDuplicates, fromVectorDuplicates,+ -- ** Strict Maps+ fromStrictMap, toStrictMap,+ -- ** Lazy Maps+ fromLazyMap, toLazyMap,+ -- ** Ad-hoc conversion with other data structures+ IsSeries(..),+ -- ** Conversion between 'Series' types+ G.convert,++ -- * Mapping and filtering+ map, mapWithKey, mapIndex, concatMap,+ take, takeWhile, drop, dropWhile, filter, filterWithKey,+ -- ** Mapping with effects+ mapWithKeyM, mapWithKeyM_, forWithKeyM, forWithKeyM_, traverseWithKey,++ -- * Combining series+ zipWith, zipWithMatched, zipWithKey,+ zipWith3, zipWithMatched3, zipWithKey3,+ ZipStrategy, skipStrategy, mapStrategy, constStrategy, zipWithStrategy, zipWithStrategy3,+ zipWithMonoid, esum, eproduct, unzip, unzip3,++ -- * Index manipulation+ require, catMaybes, dropIndex,++ -- * Accessors+ -- ** Bulk access+ select, selectWhere, Range, to, from, upto, Selection, + -- ** Single-element access+ at, iat,++ -- * Replacing values+ replace, (|->), (<-|),++ -- * Scans+ forwardFill,++ -- * Grouping and windowing operations+ groupBy, Grouping, aggregateWith, foldWith, + windowing, expanding,++ -- * Folds+ fold, foldM, foldWithKey, foldMWithKey, foldMapWithKey,+ -- ** Specialized folds+ G.mean, G.variance, G.std,+ length, null, all, any, and, or, sum, product, maximum, maximumOn, minimum, minimumOn, + argmin, argmax,++ -- * Scans+ postscanl, prescanl,++ -- * Displaying 'Series'+ display, displayWith,+ noLongerThan,+ DisplayOptions(..), G.defaultDisplayOptions+) where++import Control.Foldl ( Fold, FoldM )+import qualified Data.Map.Lazy as ML+import qualified Data.Map.Strict as MS+import Data.Series.Index ( Index )+import Data.Series.Generic ( IsSeries(..), Range, Selection, ZipStrategy, Occurrence, DisplayOptions(..)+ , to, from, upto, skipStrategy, mapStrategy, constStrategy, noLongerThan+ )+import qualified Data.Series.Generic as G+import Data.Vector ( Vector )++import Prelude hiding ( map, concatMap, zipWith, zipWith3, filter, take, takeWhile, drop, dropWhile, last, unzip, unzip3+ , length, null, all, any, and, or, sum, product, maximum, minimum, + )++-- $setup+-- >>> import qualified Data.Series as Series+-- >>> import qualified Data.Series.Index as Index++infixl 1 `select` +infix 6 |->, <-|++-- | A series is a labeled array of values of type @a@,+-- indexed by keys of type @k@.+--+-- Like @Data.Map@ and @Data.HashMap@, they support efficient:+--+-- * random access by key ( \(O(\log n)\) );+-- * slice by key ( \(O(\log n)\) ).+--+-- Like @Data.Vector.Vector@, they support efficient:+--+-- * random access by index ( \(O(1)\) );+-- * slice by index ( \(O(1)\) );+-- * numerical operations.+type Series = G.Series Vector+++index :: Series k a -> Index k+{-# INLINE index #-}+index = G.index+++values :: Series k a -> Vector a+{-# INLINE values #-}+values = G.values+++-- | Create a 'Series' with a single element.+singleton :: k -> a -> Series k a+{-# INLINE singleton #-}+singleton = G.singleton+++-- | \(O(n)\) Generate a 'Series' by mapping every element of its index.+--+-- >>> fromIndex (const (0::Int)) $ Index.fromList ['a','b','c','d']+-- index | values+-- ----- | ------+-- 'a' | 0+-- 'b' | 0+-- 'c' | 0+-- 'd' | 0+fromIndex :: (k -> a) -> Index k -> Series k a+{-# INLINE fromIndex #-}+fromIndex = G.fromIndex+++-- | Construct a series from a list of key-value pairs. There is no+-- condition on the order of pairs.+--+-- >>> let xs = fromList [('b', 0::Int), ('a', 5), ('d', 1) ]+-- >>> xs+-- index | values+-- ----- | ------+-- 'a' | 5+-- 'b' | 0+-- 'd' | 1+--+-- If you need to handle duplicate keys, take a look at `fromListDuplicates`.+fromList :: Ord k => [(k, a)] -> Series k a+{-# INLINE fromList #-}+fromList = G.fromList+++-- | Construct a series from a list of key-value pairs.+-- Contrary to `fromList`, values at duplicate keys are preserved. To keep each+-- key unique, an `Occurrence` number counts up.+--+-- >>> let xs = fromListDuplicates [('b', 0::Int), ('a', 5), ('d', 1), ('d', -4), ('d', 7) ]+-- >>> xs+-- index | values+-- ----- | ------+-- ('a',0) | 5+-- ('b',0) | 0+-- ('d',0) | 1+-- ('d',1) | -4+-- ('d',2) | 7+fromListDuplicates :: Ord k => [(k, a)] -> Series (k, Occurrence) a+{-# INLINE fromListDuplicates #-}+fromListDuplicates = G.fromListDuplicates+++-- | Construct a list from key-value pairs. The elements are in order sorted by key:+--+-- >>> let xs = Series.fromList [ ('b', 0::Int), ('a', 5), ('d', 1) ]+-- >>> xs+-- index | values+-- ----- | ------+-- 'a' | 5+-- 'b' | 0+-- 'd' | 1+-- >>> toList xs+-- [('a',5),('b',0),('d',1)]+toList :: Series k a -> [(k, a)]+{-# INLINE toList #-}+toList = G.toList+++-- | Construct a 'Vector' of key-value pairs. The elements are in order sorted by key. +toVector :: Series k a -> Vector (k, a)+{-# INLINE toVector #-}+toVector = G.toVector+++-- | Construct a 'Series' from a 'Vector' of key-value pairs. There is no+-- condition on the order of pairs. Duplicate keys are silently dropped. If you+-- need to handle duplicate keys, see 'fromVectorDuplicates'.+--+-- Note that due to differences in sorting,+-- @'Series.fromList'@ and @'Series.fromVector' . 'Vector.fromList'@ +-- may not be equivalent if the input list contains duplicate keys.+fromVector :: Ord k => Vector (k, a) -> Series k a+{-# INLINE fromVector #-}+fromVector = G.fromVector+++-- | Construct a series from a 'Vector' of key-value pairs.+-- Contrary to 'fromVector', values at duplicate keys are preserved. To keep each+-- key unique, an 'Occurrence' number counts up.+--+-- >>> import qualified Data.Vector as Vector+-- >>> let xs = fromVectorDuplicates $ Vector.fromList [('b', 0::Int), ('a', 5), ('d', 1), ('d', -4), ('d', 7) ]+-- >>> xs+-- index | values+-- ----- | ------+-- ('a',0) | 5+-- ('b',0) | 0+-- ('d',0) | 1+-- ('d',1) | -4+-- ('d',2) | 7+fromVectorDuplicates :: Ord k => Vector (k, a) -> Series (k, Occurrence) a+{-# INLINE fromVectorDuplicates #-}+fromVectorDuplicates = G.fromVectorDuplicates+++-- | Convert a series into a lazy @Map@.+toLazyMap :: Series k a -> ML.Map k a+{-# INLINE toLazyMap #-}+toLazyMap = G.toLazyMap+++-- | Construct a series from a lazy @Map@.+fromLazyMap :: ML.Map k a -> Series k a+{-# INLINE fromLazyMap #-}+fromLazyMap = G.fromLazyMap+++-- | Convert a series into a strict @Map@.+toStrictMap :: Series k a -> MS.Map k a+{-# INLINE toStrictMap #-}+toStrictMap = G.toStrictMap+++-- | Construct a series from a strict @Map@.+fromStrictMap :: MS.Map k a -> Series k a+{-# INLINE fromStrictMap #-}+fromStrictMap = G.fromStrictMap+++-- | \(O(n)\) Map every element of a 'Series'.+map :: (a -> b) -> Series k a -> Series k b+{-# INLINE map #-}+map = G.map+++-- | \(O(n)\) Map every element of a 'Series', possibly using the key as well.+mapWithKey :: (k -> a -> b) -> Series k a -> Series k b+{-# INLINE mapWithKey #-}+mapWithKey = G.mapWithKey+++-- | \(O(n \log n)\).+-- Map each key in the index to another value. Note that the resulting series+-- may have less elements, because each key must be unique.+--+-- In case new keys are conflicting, the first element is kept.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> import qualified Data.List+-- >>> xs `mapIndex` (Data.List.take 1)+-- index | values+-- ----- | ------+-- "L" | 4+-- "P" | 1+mapIndex :: (Ord k, Ord g) => Series k a -> (k -> g) -> Series g a+{-# INLINE mapIndex #-}+mapIndex = G.mapIndex+++-- | Map a function over all the elements of a 'Series' and concatenate the result into a single 'Series'.+concatMap :: Ord k + => (a -> Series k b) + -> Series k a + -> Series k b+{-# INLINE concatMap #-}+concatMap = G.concatMap+++-- | \(O(n)\) Apply the monadic action to every element of a series and its+-- index, yielding a series of results.+mapWithKeyM :: (Monad m, Ord k) => (k -> a -> m b) -> Series k a -> m (Series k b)+{-# INLINE mapWithKeyM #-}+mapWithKeyM = G.mapWithKeyM+++-- | \(O(n)\) Apply the monadic action to every element of a series and its+-- index, discarding the results.+mapWithKeyM_ :: Monad m => (k -> a -> m b) -> Series k a -> m ()+{-# INLINE mapWithKeyM_ #-}+mapWithKeyM_ = G.mapWithKeyM_+++-- | \(O(n)\) Apply the monadic action to all elements of the series and their associated keys, +-- yielding a series of results.+forWithKeyM :: (Monad m, Ord k) => Series k a -> (k -> a -> m b) -> m (Series k b)+{-# INLINE forWithKeyM #-}+forWithKeyM = G.forWithKeyM+++-- | \(O(n)\) Apply the monadic action to all elements of the series and their associated keys, +-- discarding the results.+forWithKeyM_ :: Monad m => Series k a -> (k -> a -> m b) -> m ()+{-# INLINE forWithKeyM_ #-}+forWithKeyM_ = G.forWithKeyM_+++-- | \(O(n)\) Traverse a 'Series' with an Applicative action, taking into account both keys and values. +traverseWithKey :: (Applicative t, Ord k)+ => (k -> a -> t b) + -> Series k a + -> t (Series k b)+{-# INLINE traverseWithKey #-}+traverseWithKey = G.traverseWithKey+++-- | \(O(\log n)\) @'take' n xs@ returns at most @n@ elements of the 'Series' @xs@.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4), ("Vienna", 5)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- "Vienna" | 5+-- >>> take 2 xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+take :: Int -> Series k a -> Series k a+{-# INLINE take #-}+take = G.take+++-- | \(O(n)\) Returns the longest prefix (possibly empty) of the input 'Series' that satisfy a predicate.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4), ("Vienna", 5)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- "Vienna" | 5++-- >>> takeWhile (>1) xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+takeWhile :: (a -> Bool) -> Series k a -> Series k a+takeWhile = G.takeWhile+++-- | \(O(\log n)\) @'drop' n xs@ drops at most @n@ elements from the 'Series' @xs@.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4), ("Vienna", 5)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- "Vienna" | 5+-- >>> drop 2 xs+-- index | values+-- ----- | ------+-- "Paris" | 1+-- "Vienna" | 5+drop :: Int -> Series k a -> Series k a+{-# INLINE drop #-}+drop = G.drop+++-- | \(O(n)\) Returns the complement of `takeWhile`.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4), ("Vienna", 5)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- "Vienna" | 5++-- >>> dropWhile (>1) xs+-- index | values+-- ----- | ------+-- "Paris" | 1+-- "Vienna" | 5+dropWhile :: (a -> Bool) -> Series k a -> Series k a+dropWhile = G.dropWhile+++-- | Apply a function elementwise to two series, matching elements+-- based on their keys. For keys present only in the left or right series, +-- the value 'Nothing' is returned.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> zipWith (+) xs ys+-- index | values+-- ----- | ------+-- "alpha" | Just 10+-- "beta" | Just 12+-- "delta" | Nothing+-- "gamma" | Nothing+--+-- To only combine elements where keys are in both series, see 'zipWithMatched'.+zipWith :: (Ord k) + => (a -> b -> c) -> Series k a -> Series k b -> Series k (Maybe c)+zipWith = G.zipWith +{-# INLINE zipWith #-}++++-- | Apply a function elementwise to three series, matching elements+-- based on their keys. For keys present only in the left or right series, +-- the value 'Nothing' is returned.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> let zs = Series.fromList [ ("alpha", 20::Int), ("delta", 13), ("epsilon", 6) ]+-- >>> zipWith3 (\x y z -> x + y + z) xs ys zs+-- index | values+-- ----- | ------+-- "alpha" | Just 30+-- "beta" | Nothing+-- "delta" | Nothing+-- "epsilon" | Nothing+-- "gamma" | Nothing+--+-- To only combine elements where keys are in all series, see 'zipWithMatched3'+zipWith3 :: (Ord k) + => (a -> b -> c -> d) + -> Series k a + -> Series k b + -> Series k c + -> Series k (Maybe d)+{-# INLINE zipWith3 #-}+zipWith3 = G.zipWith3+++-- | Apply a function elementwise to two series, matching elements+-- based on their keys. Keys present only in the left or right series are dropped.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> zipWithMatched (+) xs ys+-- index | values+-- ----- | ------+-- "alpha" | 10+-- "beta" | 12+--+-- To combine elements where keys are in either series, see 'zipWith'.+zipWithMatched :: Ord k => (a -> b -> c) -> Series k a -> Series k b -> Series k c+{-# INLINE zipWithMatched #-}+zipWithMatched = G.zipWithMatched+++-- | Apply a function elementwise to three series, matching elements+-- based on their keys. Keys not present in all three series are dropped.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> let zs = Series.fromList [ ("alpha", 20::Int), ("delta", 13), ("epsilon", 6) ]+-- >>> zipWithMatched3 (\x y z -> x + y + z) xs ys zs+-- index | values+-- ----- | ------+-- "alpha" | 30+zipWithMatched3 :: (Ord k) + => (a -> b -> c -> d) + -> Series k a + -> Series k b + -> Series k c+ -> Series k d+{-# INLINE zipWithMatched3 #-}+zipWithMatched3 = G.zipWithMatched3+++-- | Apply a function elementwise to two series, matching elements+-- based on their keys. Keys present only in the left or right series are dropped.+--+-- To combine elements where keys are in either series, see 'zipWith'+zipWithKey :: (Ord k) + => (k -> a -> b -> c) -> Series k a -> Series k b -> Series k c+{-# INLINE zipWithKey #-}+zipWithKey = G.zipWithKey+++-- | Apply a function elementwise to three series, matching elements+-- based on their keys. Keys present only in the left or right series are dropped.+--+-- To combine elements where keys are in any series, see 'zipWith3'+zipWithKey3 :: (Ord k) + => (k -> a -> b -> c -> d) + -> Series k a + -> Series k b + -> Series k c+ -> Series k d+{-# INLINE zipWithKey3 #-}+zipWithKey3 = G.zipWithKey3+++-- | Zip two 'Series' with a combining function, applying a `ZipStrategy` when one key is present in one of the 'Series' but not both.+--+-- In the example below, we want to set the value to @-100@ (via @`constStrategy` (-100)@) for keys which are only present +-- in the left 'Series', and drop keys (via `skipStrategy`) which are only present in the `right 'Series' +--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> zipWithStrategy (+) (constStrategy (-100)) skipStrategy xs ys+-- index | values+-- ----- | ------+-- "alpha" | 10+-- "beta" | 12+-- "gamma" | -100+--+-- Note that if you want to drop keys missing in either 'Series', it is faster to use @`zipWithMatched` f@ +-- than using @`zipWithStrategy` f skipStrategy skipStrategy@.+zipWithStrategy :: (Ord k) + => (a -> b -> c) -- ^ Function to combine values when present in both series+ -> ZipStrategy k a c -- ^ Strategy for when the key is in the left series but not the right+ -> ZipStrategy k b c -- ^ Strategy for when the key is in the right series but not the left+ -> Series k a+ -> Series k b + -> Series k c+{-# INLINE zipWithStrategy #-}+zipWithStrategy = G.zipWithStrategy+++-- | Zip three 'Series' with a combining function, applying a 'ZipStrategy' when one key is +-- present in one of the 'Series' but not all of the others.+--+-- Note that if you want to drop keys missing in either 'Series', it is faster to use @'zipWithMatched3' f@ +-- than using @'zipWithStrategy3' f skipStrategy skipStrategy skipStrategy@.+zipWithStrategy3 :: (Ord k) + => (a -> b -> c -> d) -- ^ Function to combine values when present in all series+ -> ZipStrategy k a d -- ^ Strategy for when the key is in the left series but not in all the others+ -> ZipStrategy k b d -- ^ Strategy for when the key is in the center series but not in all the others+ -> ZipStrategy k c d -- ^ Strategy for when the key is in the right series but not in all the others+ -> Series k a+ -> Series k b + -> Series k c+ -> Series k d+{-# INLINE zipWithStrategy3 #-}+zipWithStrategy3 = G.zipWithStrategy3+++-- | Zip two 'Series' with a combining function. The value for keys which are missing from+-- either 'Series' is replaced with the appropriate `mempty` value.+--+-- >>> import Data.Monoid ( Sum(..) )+-- >>> let xs = Series.fromList [ ("2023-01-01", Sum (1::Int)), ("2023-01-02", Sum 2) ]+-- >>> let ys = Series.fromList [ ("2023-01-01", Sum (5::Int)), ("2023-01-03", Sum 7) ]+-- >>> Series.zipWith (<>) xs ys+-- index | values+-- ----- | ------+-- "2023-01-01" | Just (Sum {getSum = 6})+-- "2023-01-02" | Nothing+-- "2023-01-03" | Nothing+-- >>> zipWithMonoid (<>) xs ys+-- index | values+-- ----- | ------+-- "2023-01-01" | Sum {getSum = 6}+-- "2023-01-02" | Sum {getSum = 2}+-- "2023-01-03" | Sum {getSum = 7}+zipWithMonoid :: ( Monoid a, Monoid b, Ord k) + => (a -> b -> c)+ -> Series k a+ -> Series k b + -> Series k c+zipWithMonoid = G.zipWithMonoid+{-# INLINE zipWithMonoid #-}+++-- | Elementwise sum of two 'Series'. Elements missing in one or the other 'Series' is considered 0. +--+-- >>> let xs = Series.fromList [ ("2023-01-01", (1::Int)), ("2023-01-02", 2) ]+-- >>> let ys = Series.fromList [ ("2023-01-01", (5::Int)), ("2023-01-03", 7) ]+-- >>> xs `esum` ys+-- index | values+-- ----- | ------+-- "2023-01-01" | 6+-- "2023-01-02" | 2+-- "2023-01-03" | 7+esum :: (Ord k, Num a) + => Series k a + -> Series k a+ -> Series k a+esum = G.esum+{-# INLINE esum #-}+++-- | Elementwise product of two 'Series'. Elements missing in one or the other 'Series' is considered 1. +--+-- >>> let xs = Series.fromList [ ("2023-01-01", (2::Int)), ("2023-01-02", 3) ]+-- >>> let ys = Series.fromList [ ("2023-01-01", (5::Int)), ("2023-01-03", 7) ]+-- >>> xs `eproduct` ys+-- index | values+-- ----- | ------+-- "2023-01-01" | 10+-- "2023-01-02" | 3+-- "2023-01-03" | 7+eproduct :: (Ord k, Num a) + => Series k a + -> Series k a+ -> Series k a+eproduct = G.eproduct+{-# INLINE eproduct #-}+++-- | \(O(n)\) Unzip a 'Series' of 2-tuples.+unzip :: Series k (a, b)+ -> ( Series k a+ , Series k b+ )+unzip = G.unzip+{-# INLINE unzip #-}+++-- | \(O(n)\) Unzip a 'Series' of 3-tuples.+unzip3 :: Series k (a, b, c)+ -> ( Series k a+ , Series k b+ , Series k c+ )+unzip3 = G.unzip3+{-# INLINE unzip3 #-}+++-- | Require a series to have a specific `Index`.+-- Contrary to @select@, all keys in the `Index` will be present in the resulting series.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> xs `require` Index.fromList ["Paris", "Lisbon", "Taipei"]+-- index | values+-- ----- | ------+-- "Lisbon" | Just 4+-- "Paris" | Just 1+-- "Taipei" | Nothing+require :: Ord k => Series k a -> Index k -> Series k (Maybe a)+{-# INLINE require #-}+require = G.require +++-- | Drop the index of a series by replacing it with an `Int`-based index. Values will+-- be indexed from 0.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> dropIndex xs+-- index | values+-- ----- | ------+-- 0 | 4+-- 1 | 2+-- 2 | 1+dropIndex :: Series k a -> Series Int a+{-# INLINE dropIndex #-}+dropIndex = G.dropIndex+++-- | Filter elements. Only elements for which the predicate is @True@ are kept. +-- Notice that the filtering is done on the values, not on the keys.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> filter (>2) xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+--+-- See also 'filterWithKey'.+filter :: Ord k => (a -> Bool) -> Series k a -> Series k a+{-# INLINE filter #-}+filter = G.filter+++-- | Filter elements, taking into account the corresponding key. Only elements for which +-- the predicate is @True@ are kept. +filterWithKey :: Ord k + => (k -> a -> Bool) + -> Series k a + -> Series k a+{-# INLINE filterWithKey #-}+filterWithKey = G.filterWithKey+++-- | Drop elements which are not available (NA). +--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> let ys = xs `require` Index.fromList ["Paris", "London", "Lisbon", "Toronto"]+-- >>> ys+-- index | values+-- ----- | ------+-- "Lisbon" | Just 4+-- "London" | Just 2+-- "Paris" | Just 1+-- "Toronto" | Nothing+-- >>> catMaybes ys+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+catMaybes :: Ord k => Series k (Maybe a) -> Series k a+{-# INLINE catMaybes #-}+catMaybes = G.catMaybes+++-- | Select a subseries. There are a few ways to do this.+--+-- The first way to do this is to select a sub-series based on random keys. For example,+-- selecting a subseries from an `Index`:+--+-- >>> let xs = Series.fromList [('a', 10::Int), ('b', 20), ('c', 30), ('d', 40)]+-- >>> xs `select` Index.fromList ['a', 'd']+-- index | values+-- ----- | ------+-- 'a' | 10+-- 'd' | 40+--+-- The second way to select a sub-series is to select all keys in a range:+--+-- >>> xs `select` 'b' `to` 'c'+-- index | values+-- ----- | ------+-- 'b' | 20+-- 'c' | 30+--+-- Note that with `select`, you'll always get a sub-series; if you ask for a key which is not+-- in the series, it'll be ignored:+--+-- >>> xs `select` Index.fromList ['a', 'd', 'e']+-- index | values+-- ----- | ------+-- 'a' | 10+-- 'd' | 40+--+-- See `require` if you want to ensure that all keys are present.+select :: (Selection s, Ord k) => Series k a -> s k -> Series k a+select = G.select+++-- | Select a sub-series from a series matching a condition.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> xs `selectWhere` (fmap (>1) xs)+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+selectWhere :: Ord k => Series k a -> Series k Bool -> Series k a+{-# INLINE selectWhere #-}+selectWhere = G.selectWhere+++-- | \(O(\log n)\). Extract a single value from a series, by key.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs `at` "Paris"+-- Just 1+-- >>> xs `at` "Sydney"+-- Nothing+at :: Ord k => Series k a -> k -> Maybe a+{-# INLINE at #-}+at = G.at+++-- | \(O(1)\). Extract a single value from a series, by index.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> xs `iat` 0+-- Just 4+-- >>> xs `iat` 3+-- Nothing+iat :: Series k a -> Int -> Maybe a+{-# INLINE iat #-}+iat = G.iat+++-- | Replace values in the right series from values in the left series at matching keys.+-- Keys not in the right series are unaffected.+-- +-- See `(|->)` and `(<-|)`, which might be more readable.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> let ys = Series.singleton "Paris" (99::Int)+-- >>> ys `replace` xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 99+replace :: Ord k => Series k a -> Series k a -> Series k a+{-# INLINE replace #-}+replace = G.replace+++-- | Replace values in the right series from values in the left series at matching keys.+-- Keys not in the right series are unaffected.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> let ys = Series.singleton "Paris" (99::Int)+-- >>> ys |-> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 99+(|->) :: (Ord k) => Series k a -> Series k a -> Series k a+{-# INLINE (|->) #-}+(|->) = (G.|->)+++-- | Replace values in the left series from values in the right series at matching keys.+-- Keys not in the left series are unaffected.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> let ys = Series.singleton "Paris" (99::Int)+-- >>> xs <-| ys+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 99+(<-|) :: (Ord k) => Series k a -> Series k a -> Series k a+{-# INLINE (<-|) #-}+(<-|) = (G.<-|)+++-- | \(O(n)\) Replace all instances of 'Nothing' with the last previous+-- value which was not 'Nothing'.+--+-- >>> let xs = Series.fromList (zip [0..] [Just 1, Just 2,Nothing, Just 3]) :: Series Int (Maybe Int)+-- >>> xs+-- index | values+-- ----- | ------+-- 0 | Just 1+-- 1 | Just 2+-- 2 | Nothing+-- 3 | Just 3+-- >>> forwardFill 0 xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 2+-- 2 | 2+-- 3 | 3+--+-- If the first entry of the series is missing, the first input to 'forwardFill' will be used:+--+-- >>> let ys = Series.fromList (zip [0..] [Nothing, Just 2,Nothing, Just 3]) :: Series Int (Maybe Int)+-- >>> ys+-- index | values+-- ----- | ------+-- 0 | Nothing+-- 1 | Just 2+-- 2 | Nothing+-- 3 | Just 3+-- >>> forwardFill 0 ys+-- index | values+-- ----- | ------+-- 0 | 0+-- 1 | 2+-- 2 | 2+-- 3 | 3+forwardFill :: a -- ^ Until the first non-'Nothing' is found, 'Nothing' will be filled with this value.+ -> Series v (Maybe a)+ -> Series v a+{-# INLINE forwardFill #-}+forwardFill = G.forwardFill+++-- | \(O(n)\) Execute a 'Fold' over a 'Series'.+--+-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4]) :: Series Int Double+-- >>> xs+-- index | values+-- ----- | ------+-- 0 | 1.0+-- 1 | 2.0+-- 2 | 3.0+-- 3 | 4.0+-- >>> import Control.Foldl (variance)+-- >>> fold variance xs+-- 1.25+--+-- See also 'foldM' for monadic folds, and 'foldWithKey' to take keys into+-- account while folding.+fold :: Fold a b -> Series k a -> b+fold = G.fold+{-# INLINE fold #-}+++-- | \(O(n)\) Execute a monadic 'FoldM' over a 'Series'.+--+-- See also 'fold' for pure folds, and 'foldMWithKey' to take keys into+-- account while folding.+foldM :: (Monad m) + => FoldM m a b + -> Series k a + -> m b+foldM = G.foldM+{-# INLINE foldM #-}+++-- | \(O(n)\) Execute a 'Fold' over a 'Series', taking keys into account.+foldWithKey :: Fold (k, a) b -> Series k a -> b+foldWithKey = G.foldWithKey+{-# INLINE foldWithKey #-}+++-- | \(O(n)\) Execute a monadic 'FoldM' over a 'Series', where the 'FoldM' takes keys into account.+foldMWithKey :: (Monad m) + => FoldM m (k, a) b + -> Series k a + -> m b+foldMWithKey = G.foldMWithKey+{-# INLINE foldMWithKey #-}+++-- | \(O(n)\) Map each element and associated key of the structure to a monoid and combine+-- the results.+foldMapWithKey :: Monoid m => (k -> a -> m) -> Series k a -> m+{-# INLINE foldMapWithKey #-}+foldMapWithKey = G.foldMapWithKey+++-- | Group values in a 'Series' by some grouping function (@k -> g@).+-- The provided grouping function is guaranteed to operate on a non-empty 'Series'.+--+-- This function is expected to be used in conjunction with 'aggregateWith':+-- +-- >>> import Data.Maybe ( fromMaybe )+-- >>> type Date = (Int, String)+-- >>> month :: (Date -> String) = snd+-- >>> :{ +-- let xs = Series.fromList [ ((2020, "January") :: Date, 0 :: Int)+-- , ((2021, "January"), -5)+-- , ((2020, "June") , 20)+-- , ((2021, "June") , 25) +-- ]+-- in xs `groupBy` month `aggregateWith` (fromMaybe 0 . minimum)+-- :}+-- index | values+-- ----- | ------+-- "January" | -5+-- "June" | 20+groupBy :: Series k a -- ^ Grouping function+ ->(k -> g) -- ^ Input series+ -> Grouping k g a -- ^ Grouped series+{-# INLINE groupBy #-}+groupBy = G.groupBy++-- | Representation of a 'Series' being grouped.+type Grouping k g a = G.Grouping k g Vector a+++-- | Aggregate groups resulting from a call to 'groupBy':+-- +-- >>> import Data.Maybe ( fromMaybe )+-- >>> type Date = (Int, String)+-- >>> month :: (Date -> String) = snd+-- >>> :{ +-- let xs = Series.fromList [ ((2020, "January") :: Date, 0 :: Int)+-- , ((2021, "January"), -5)+-- , ((2020, "June") , 20)+-- , ((2021, "June") , 25) +-- ]+-- in xs `groupBy` month `aggregateWith` (fromMaybe 0 . minimum)+-- :}+-- index | values+-- ----- | ------+-- "January" | -5+-- "June" | 20+--+-- If you want to aggregate groups using a binary function, see 'foldWith' which+-- may be much faster.+aggregateWith :: (Ord g) + => Grouping k g a + -> (Series k a -> b) + -> Series g b+{-# INLINE aggregateWith #-}+aggregateWith = G.aggregateWith+++-- | Aggregate each group in a 'Grouping' using a binary function.+-- While this is not as expressive as 'aggregateWith', users looking for maximum+-- performance should use 'foldWith' as much as possible.+foldWith :: Ord g + => Grouping k g a+ -> (a -> a -> a)+ -> Series g a+{-# INLINE foldWith #-}+foldWith = G.foldWith+++-- | Expanding window aggregation.+--+-- >>> import qualified Data.Series as Series +-- >>> :{ +-- let (xs :: Series.Series Int Int) +-- = Series.fromList [ (1, 0)+-- , (2, 1)+-- , (3, 2)+-- , (4, 3)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in (xs `expanding` sum) :: Series.Series Int Int +-- :}+-- index | values+-- ----- | ------+-- 1 | 0+-- 2 | 1+-- 3 | 3+-- 4 | 6+-- 5 | 10+-- 6 | 15+expanding :: Series k a -- ^ Series vector+ -> (Series k a -> b) -- ^ Aggregation function+ -> Series k b -- ^ Resulting vector+{-# INLINE expanding #-}+expanding = G.expanding+++-- | General-purpose window aggregation.+--+-- >>> import qualified Data.Series as Series +-- >>> :{ +-- let (xs :: Series.Series Int Int) +-- = Series.fromList [ (1, 0)+-- , (2, 1)+-- , (3, 2)+-- , (4, 3)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in windowing (\k -> k `to` (k+2)) sum xs+-- :}+-- index | values+-- ----- | ------+-- 1 | 3+-- 2 | 6+-- 3 | 9+-- 4 | 12+-- 5 | 9+-- 6 | 5+windowing :: Ord k+ => (k -> Range k)+ -> (Series k a -> b)+ -> Series k a+ -> Series k b+{-# INLINE windowing #-}+windowing = G.windowing+++-- | \(O(1)\) Test whether a 'Series' is empty.+null :: Series k a -> Bool+{-# INLINE null #-}+null = G.null+++-- |\(O(1)\) Extract the length of a 'Series'.+length :: Series k a -> Int+{-# INLINE length #-}+length = G.length+++-- | \(O(n)\) Check if all elements satisfy the predicate.+all :: (a -> Bool) -> Series k a -> Bool+{-# INLINE all #-}+all = G.all+++-- | \(O(n)\) Check if any element satisfies the predicate.+any :: (a -> Bool) -> Series k a -> Bool+{-# INLINE any #-}+any = G.any+++-- | \(O(n)\) Check if all elements are 'True'.+and :: Series k Bool -> Bool+{-# INLINE and #-}+and = G.and+++-- | \(O(n)\) Check if any element is 'True'.+or :: Series k Bool -> Bool+{-# INLINE or #-}+or = G.or+++-- | \(O(n)\) Compute the sum of the elements.+sum :: (Num a) => Series k a -> a+{-# INLINE sum #-}+sum = G.sum+++-- | \(O(n)\) Compute the product of the elements.+product :: (Num a) => Series k a -> a+{-# INLINE product #-}+product = G.product+++-- | \(O(n)\) Yield the maximum element of the series. In case of a tie, the first occurrence wins.+-- If the 'Series' is empty, @Nothing@ is returned.+--+-- See also 'argmax'.+maximum :: (Ord a) => Series k a -> Maybe a+{-# INLINE maximum #-}+maximum = G.maximum+++-- | \(O(n)\) @'maximumOn' f xs@ teturns the maximum element of the series @xs@, as determined by the function @f@.+-- In case of a tie, the first occurrence wins. If the 'Series' is empty, @Nothing@ is returned.+maximumOn :: (Ord b) => (a -> b) -> Series k a -> Maybe a+{-# INLINE maximumOn #-}+maximumOn = G.maximumOn+++-- | \(O(n)\) Yield the minimum element of the series. In case of a tie, the first occurrence wins.+-- If the 'Series' is empty, @Nothing@ is returned.+--+-- See also 'argmin'.+minimum :: (Ord a) => Series k a -> Maybe a+{-# INLINE minimum #-}+minimum = G.minimum+++-- | \(O(n)\) @'minimumOn' f xs@ teturns the minimum element of the series @xs@, as determined by the function @f@.+-- In case of a tie, the first occurrence wins. If the 'Series' is empty, @Nothing@ is returned.+minimumOn :: (Ord b) => (a -> b) -> Series k a -> Maybe a+{-# INLINE minimumOn #-}+minimumOn = G.minimumOn+++-- | \(O(n)\) Find the index of the maximum element in the input series.+-- If the input series is empty, 'Nothing' is returned.+--+-- The index of the first occurrence of the maximum element is returned.+--+-- >>> :{ +-- let (xs :: Series Int Int) +-- = Series.fromList [ (1, 0)+-- , (2, 1)+-- , (3, 2)+-- , (4, 7)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in argmax xs +-- :}+-- Just 4+argmax :: Ord a => Series k a -> Maybe k+argmax = G.argmax+{-# INLINE argmax #-}+++-- | \(O(n)\) Find the index of the minimum element in the input series.+-- If the input series is empty, 'Nothing' is returned.+--+-- The index of the first occurrence of the minimum element is returned.+-- >>> :{ +-- let (xs :: Series Int Int) +-- = Series.fromList [ (1, 1)+-- , (2, 1)+-- , (3, 2)+-- , (4, 0)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in argmin xs +-- :}+-- Just 4+argmin :: Ord a => Series k a -> Maybe k+argmin = G.argmin+{-# INLINE argmin #-}+++-- | \(O(n)\) Left-to-right postscan.+--+-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4]) :: Series Int Int+-- >>> xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 2+-- 2 | 3+-- 3 | 4+-- >>> postscanl (+) 0 xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 3+-- 2 | 6+-- 3 | 10+postscanl :: (a -> b -> a) -> a -> Series k b -> Series k a+{-# INLINE postscanl #-}+postscanl = G.postscanl+++-- | \(O(n)\) Left-to-right prescan.+--+-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4]) :: Series Int Int+-- >>> xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 2+-- 2 | 3+-- 3 | 4+-- >>> prescanl (+) 0 xs+-- index | values+-- ----- | ------+-- 0 | 0+-- 1 | 1+-- 2 | 3+-- 3 | 6+prescanl :: (a -> b -> a) -> a -> Series k b -> Series k a+{-# INLINE prescanl #-}+prescanl = G.prescanl+++-- | Display a 'Series' using default 'DisplayOptions'.+--+-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4,5,6,7]) :: Series Int Int+-- >>> putStrLn $ display xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 2+-- 2 | 3+-- ... | ...+-- 4 | 5+-- 5 | 6+-- 6 | 7+display :: (Show k, Show a) + => Series k a + -> String+display = G.display+++-- | Display a 'Series' using customizable 'DisplayOptions'.+--+-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4,5,6,7]) :: Series Int Int+-- >>> import Data.List (replicate)+-- >>> :{+-- let opts = DisplayOptions { maximumNumberOfRows = 4+-- , indexHeader = "keys"+-- , valuesHeader = "vals"+-- , keyDisplayFunction = (\i -> replicate i 'x') `noLongerThan` 5+-- , valueDisplayFunction = (\i -> replicate i 'o') +-- }+-- in putStrLn $ displayWith opts xs+-- :}+-- keys | vals+-- ----- | ------+-- | o+-- x | oo+-- ... | ...+-- xxxxx | oooooo+-- xxx... | ooooooo+displayWith :: DisplayOptions k a+ -> Series k a + -> String+displayWith = G.displayWith
+ src/Data/Series/Generic.hs view
@@ -0,0 +1,86 @@+{-# LANGUAGE NoImplicitPrelude #-}+module Data.Series.Generic (+ -- * Definition+ Series(index, values),+ convert,++ -- * Building/converting 'Series'+ singleton, fromIndex,+ -- ** Lists+ fromList, toList,+ -- ** Vectors+ fromVector, toVector,+ -- ** Handling duplicates+ Occurrence, fromListDuplicates, fromVectorDuplicates,+ -- ** Strict Maps+ fromStrictMap, toStrictMap,+ -- ** Lazy Maps+ fromLazyMap, toLazyMap,+ -- ** Ad-hoc conversion with other data structures+ IsSeries(..),++ -- * Mapping and filtering+ map, mapWithKey, mapIndex, concatMap, filter, filterWithKey, + take, takeWhile, drop, dropWhile,+ -- ** Mapping with effects+ mapWithKeyM, mapWithKeyM_, forWithKeyM, forWithKeyM_, traverseWithKey,++ -- * Folding+ fold, foldM, foldWithKey, foldMWithKey, foldMap, foldMapWithKey,+ -- ** Specialized folds+ mean, variance, std, + length, null, all, any, and, or, sum, product, maximum, maximumOn, minimum, minimumOn,+ argmax, argmin,++ -- * Scans+ postscanl, prescanl, forwardFill,++ -- * Combining series+ zipWith, zipWithMatched, zipWithKey,+ zipWith3, zipWithMatched3, zipWithKey3,+ ZipStrategy, skipStrategy, mapStrategy, constStrategy, zipWithStrategy, zipWithStrategy3,+ zipWithMonoid, esum, eproduct, unzip, unzip3,++ -- * Index manipulation+ require, requireWith, catMaybes, dropIndex,++ -- * Accessors+ -- ** Bulk access+ select, selectWhere, Range, to, from, upto, Selection, + -- ** Single-element access+ at, iat,++ -- * Replacement+ replace, (|->), (<-|),++ -- * Grouping and windowing operations+ groupBy, Grouping, aggregateWith, foldWith, + windowing, expanding,++ -- * Displaying 'Series'+ display, displayWith,+ noLongerThan,+ DisplayOptions(..), defaultDisplayOptions+) where++import Data.Series.Generic.Aggregation ( groupBy, Grouping, aggregateWith, foldWith+ , windowing, expanding, all, any, and, or, sum, product, maximum, maximumOn, minimum, minimumOn+ , argmax, argmin,+ )+import Data.Series.Generic.Definition ( Series(index, values), IsSeries(..), Occurrence, convert, singleton, fromIndex, fromStrictMap+ , toStrictMap, fromLazyMap, toLazyMap, fromList, fromListDuplicates, toList+ , fromVector, fromVectorDuplicates, toVector+ , map, mapWithKey, mapIndex, concatMap, length, null, take, takeWhile, drop, dropWhile+ , mapWithKeyM, mapWithKeyM_, forWithKeyM, forWithKeyM_, traverseWithKey, fold, foldM+ , foldWithKey, foldMWithKey, foldMap, foldMapWithKey+ , display, displayWith, noLongerThan, DisplayOptions(..), defaultDisplayOptions+ )+import Data.Series.Generic.Numeric ( mean, variance, std )+import Data.Series.Generic.Scans ( postscanl, prescanl, forwardFill )+import Data.Series.Generic.View ( Range, Selection, at, iat, select, selectWhere, to, from, upto, filter, filterWithKey, require, requireWith+ , catMaybes, dropIndex,+ )+import Data.Series.Generic.Zip ( zipWith, zipWithMatched, zipWithKey, zipWith3, zipWithMatched3, zipWithKey3, replace+ , (|->), (<-|), zipWithStrategy, zipWithStrategy3, ZipStrategy, skipStrategy, mapStrategy, constStrategy+ , zipWithMonoid, esum, eproduct, unzip, unzip3+ )
+ src/Data/Series/Generic/Aggregation.hs view
@@ -0,0 +1,326 @@+module Data.Series.Generic.Aggregation ( + -- * Grouping+ Grouping,+ groupBy,+ aggregateWith,+ foldWith,++ -- * Windowing+ expanding,+ windowing,++ -- * Folding+ all, any, and, or, sum, product, maximum, maximumOn, minimum, minimumOn,+ argmax, argmin,+) where++import qualified Data.List +import qualified Data.Map.Strict as Map+import Data.Ord ( Down(..) )+import Data.Series.Generic.Definition ( Series(..) )+import qualified Data.Series.Generic.Definition as GSeries+import Data.Series.Generic.View ( Range, slice, select )+import qualified Data.Vector as Boxed+import Data.Vector.Generic ( Vector )+import qualified Data.Vector.Generic as Vector+import Prelude hiding ( last, null, length, all, any, and, or, sum, product, maximum, minimum )++-- $setup+-- >>> import qualified Data.Series as Series+-- >>> import qualified Data.Set as Set++-- | Group values in a 'Series' by some grouping function (@k -> g@).+-- The provided grouping function is guaranteed to operate on a non-empty 'Series'.+--+-- This function is expected to be used in conjunction with @aggregate@:+-- +-- >>> import Data.Maybe ( fromMaybe )+-- >>> type Date = (Int, String)+-- >>> month :: (Date -> String) = snd+-- >>> :{ +-- let xs = Series.fromList [ ((2020, "January") :: Date, 0 :: Int)+-- , ((2021, "January"), -5)+-- , ((2020, "June") , 20)+-- , ((2021, "June") , 25) +-- ]+-- in xs `groupBy` month `aggregateWith` (fromMaybe 0 . minimum)+-- :}+-- index | values+-- ----- | ------+-- "January" | -5+-- "June" | 20+groupBy :: Series v k a -- ^ Input series+ -> (k -> g) -- ^ Grouping function+ -> Grouping k g v a -- ^ Grouped series+{-# INLINE groupBy #-}+groupBy = MkGrouping+++-- | Representation of a 'Series' being grouped.+data Grouping k g v a + = MkGrouping (Series v k a) (k -> g)+++-- | Aggregate groups resulting from a call to 'groupBy':+-- +-- >>> import Data.Maybe ( fromMaybe )+-- >>> type Date = (Int, String)+-- >>> month :: (Date -> String) = snd+-- >>> :{ +-- let xs = Series.fromList [ ((2020, "January") :: Date, 0 :: Int)+-- , ((2021, "January"), -5)+-- , ((2020, "June") , 20)+-- , ((2021, "June") , 25) +-- ]+-- in xs `groupBy` month `aggregateWith` (fromMaybe 0 . minimum)+-- :}+-- index | values+-- ----- | ------+-- "January" | -5+-- "June" | 20+--+-- If you want to aggregate groups using a binary function, see 'foldWith' which+-- may be much faster.+aggregateWith :: (Ord g, Vector v a, Vector v b) + => Grouping k g v a + -> (Series v k a -> b) + -> Series v g b+{-# INLINE aggregateWith #-}+aggregateWith (MkGrouping xs by) f+ = GSeries.fromStrictMap + $ fmap (f . GSeries.fromDistinctAscList)+ -- We're using a list fold to limit the number of + -- type constraints. This is about as fast as it is + -- with a Vector fold+ $ Data.List.foldl' acc mempty + $ GSeries.toList xs+ where+ acc !m (key, val) = Map.insertWith (<>) (by key) (Data.List.singleton (key, val)) m+++-- | Fold over each group in a 'Grouping' using a binary function.+-- While this is not as expressive as 'aggregateWith', users looking for maximum+-- performance should use 'foldWith' as much as possible.+--+-- >>> type Date = (Int, String)+-- >>> month :: (Date -> String) = snd+-- >>> :{ +-- let xs = Series.fromList [ ((2020, "January") :: Date, 0 :: Int)+-- , ((2021, "January"), -5)+-- , ((2020, "June") , 20)+-- , ((2021, "June") , 25) +-- ]+-- in xs `groupBy` month `foldWith` min+-- :}+-- index | values+-- ----- | ------+-- "January" | -5+-- "June" | 20+foldWith :: (Ord g, Vector v a) + => Grouping k g v a+ -> (a -> a -> a)+ -> Series v g a+{-# INLINE foldWith #-}+foldWith (MkGrouping xs by) f + = GSeries.fromStrictMap + -- We're using a list fold to limit the number of + -- type constraints. This is about as fast as it is + -- with a Vector fold+ $ Data.List.foldl' acc mempty + $ GSeries.toList xs+ where+ acc !m (key, val) = Map.insertWith f (by key) val m+++-- | Expanding window aggregation.+--+-- >>> import qualified Data.Series as Series +-- >>> :{ +-- let (xs :: Series.Series Int Int) +-- = Series.fromList [ (1, 0)+-- , (2, 1)+-- , (3, 2)+-- , (4, 3)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in (xs `expanding` sum) :: Series.Series Int Int +-- :}+-- index | values+-- ----- | ------+-- 1 | 0+-- 2 | 1+-- 3 | 3+-- 4 | 6+-- 5 | 10+-- 6 | 15+expanding :: (Vector v a, Vector v b) + => Series v k a -- ^ Series vector+ -> (Series v k a -> b) -- ^ Aggregation function+ -> Series v k b -- ^ Resulting vector+{-# INLINE expanding #-}+expanding vs f = MkSeries (index vs) $ Vector.unfoldrExactN (GSeries.length vs) go 0+ where+ -- Recall that `slice` does NOT include the right index+ go ix = (f $ slice 0 (ix + 1) vs, ix + 1)+++-- | General-purpose window aggregation.+--+-- >>> import qualified Data.Series as Series +-- >>> import Data.Series ( to )+-- >>> :{ +-- let (xs :: Series.Series Int Int) +-- = Series.fromList [ (1, 0)+-- , (2, 1)+-- , (3, 2)+-- , (4, 3)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in windowing (\k -> k `to` (k + 2)) sum xs+-- :}+-- index | values+-- ----- | ------+-- 1 | 3+-- 2 | 6+-- 3 | 9+-- 4 | 12+-- 5 | 9+-- 6 | 5+windowing :: (Ord k, Vector v a, Vector v b)+ => (k -> Range k)+ -> (Series v k a -> b)+ -> Series v k a+ -> Series v k b+{-# INLINE windowing #-}+windowing range agg series + = GSeries.mapWithKey (\k _ -> agg $ series `select` range k) series+++-- | \(O(n)\) Check if all elements satisfy the predicate.+all :: Vector v a => (a -> Bool) -> Series v k a -> Bool+{-# INLINE all #-}+all f = Vector.all f . values+++-- | \(O(n)\) Check if any element satisfies the predicate.+any :: Vector v a => (a -> Bool) -> Series v k a -> Bool+{-# INLINE any #-}+any f = Vector.any f . values+++-- | \(O(n)\) Check if all elements are 'True'.+and :: Vector v Bool => Series v k Bool -> Bool+{-# INLINE and #-}+and = Vector.and . values+++-- | \(O(n)\) Check if any element is 'True'.+or :: Vector v Bool => Series v k Bool -> Bool+{-# INLINE or #-}+or = Vector.or . values+++-- | \(O(n)\) Compute the sum of the elements.+sum :: (Num a, Vector v a) => Series v k a -> a+{-# INLINE sum #-}+sum = Vector.sum . values+++-- | \(O(n)\) Compute the product of the elements.+product :: (Num a, Vector v a) => Series v k a -> a+{-# INLINE product #-}+product = Vector.product . values+++nothingIfEmpty :: Vector v a + => (Series v k a -> b) -> (Series v k a -> Maybe b)+nothingIfEmpty f xs = if GSeries.null xs then Nothing else Just (f xs) +++-- | \(O(n)\) Yield the maximum element of the series. In case of a tie, the first occurrence wins.+maximum :: (Ord a, Vector v a) => Series v k a -> Maybe a+{-# INLINE maximum #-}+maximum = nothingIfEmpty $ Vector.maximum . values+++-- | \(O(n)\) @'maximumOn' f xs@ teturns the maximum element of the series @xs@, as determined by the function @f@.+-- In case of a tie, the first occurrence wins.+-- If the 'Series' is empty, @Nothing@ is returned.+maximumOn :: (Ord b, Vector v a) => (a -> b) -> Series v k a -> Maybe a+{-# INLINE maximumOn #-}+maximumOn f = nothingIfEmpty $ Vector.maximumOn f . values+++-- | \(O(n)\) Yield the minimum element of the series. In case of a tie, the first occurrence wins.+-- If the 'Series' is empty, @Nothing@ is returned.+minimum :: (Ord a, Vector v a) => Series v k a -> Maybe a+{-# INLINE minimum #-}+minimum = nothingIfEmpty $ Vector.minimum . values+++-- | \(O(n)\) @'minimumOn' f xs@ teturns the minimum element of the series @xs@, as determined by the function @f@.+-- In case of a tie, the first occurrence wins.+-- If the 'Series' is empty, @Nothing@ is returned.+minimumOn :: (Ord b, Vector v a) => (a -> b) -> Series v k a -> Maybe a+{-# INLINE minimumOn #-}+minimumOn f = nothingIfEmpty $ Vector.minimumOn f . values+++-- | \(O(n)\) Find the index of the maximum element in the input series.+-- If the input series is empty, 'Nothing' is returned.+--+-- The index of the first occurrence of the maximum element is returned.+--+-- >>> import qualified Data.Series as Series +-- >>> :{ +-- let (xs :: Series.Series Int Int) +-- = Series.fromList [ (1, 0)+-- , (2, 1)+-- , (3, 2)+-- , (4, 7)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in argmax xs +-- :}+-- Just 4+argmax :: (Ord a, Vector v a)+ => Series v k a+ -> Maybe k+{-# INLINE argmax #-}+argmax xs | GSeries.null xs = Nothing+ | otherwise = Just + . fst + -- We're forcing the use of boxed vectors in order to+ -- reduce the constraints on the vector instance+ . Boxed.maximumOn snd + . GSeries.toVector+ . GSeries.convert+ $ xs+++-- | \(O(n)\) Find the index of the minimum element in the input series.+-- If the input series is empty, 'Nothing' is returned.+--+-- The index of the first occurrence of the minimum element is returned.+--+-- >>> import qualified Data.Series as Series +-- >>> :{ +-- let (xs :: Series.Series Int Int) +-- = Series.fromList [ (1, 1)+-- , (2, 1)+-- , (3, 2)+-- , (4, 0)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in argmin xs +-- :}+-- Just 4+argmin :: (Ord a, Vector v a, Vector v (Down a))+ => Series v k a+ -> Maybe k+{-# INLINE argmin #-}+argmin = argmax . GSeries.map Down
+ src/Data/Series/Generic/Definition.hs view
@@ -0,0 +1,832 @@+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE QuantifiedConstraints #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE UndecidableInstances #-}++module Data.Series.Generic.Definition ( + Series(..),++ convert,++ -- * Basic interface+ singleton,+ headM, lastM, map, mapWithKey, mapIndex, concatMap, fold, foldM, + foldWithKey, foldMWithKey, foldMap, bifoldMap, foldMapWithKey, + length, null, take, takeWhile, drop, dropWhile,+ mapWithKeyM, mapWithKeyM_, forWithKeyM, forWithKeyM_,+ traverseWithKey,++ fromIndex,+ -- * Conversion to/from Series+ IsSeries(..),+ -- ** Conversion to/from Maps+ fromStrictMap,+ toStrictMap,+ fromLazyMap,+ toLazyMap,+ -- ** Conversion to/from list+ fromList,+ toList,+ -- *** Unsafe construction+ fromDistinctAscList,+ -- ** Conversion to/from vectors+ fromVector,+ toVector,+ -- *** Unsafe construction+ fromDistinctAscVector,+ -- ** Handling duplicates+ Occurrence, fromListDuplicates, fromVectorDuplicates,++ -- * Displaying 'Series'+ display, displayWith,+ noLongerThan,+ DisplayOptions(..), defaultDisplayOptions+) where++import Control.DeepSeq ( NFData(rnf) )+import Control.Foldl ( Fold(..), FoldM(..) )+import Control.Monad.ST ( runST )+import Data.Bifoldable ( Bifoldable )+import qualified Data.Bifoldable as Bifoldable+import qualified Data.Foldable as Foldable+import Data.Foldable.WithIndex ( FoldableWithIndex(..))+import Data.Function ( on )+import Data.Functor.WithIndex ( FunctorWithIndex(imap) )++import Data.IntMap.Strict ( IntMap )+import qualified Data.IntMap.Strict as IntMap+import qualified Data.List as List+import qualified Data.Map.Lazy as ML+import Data.Map.Strict ( Map )+import qualified Data.Map.Strict as MS+import Data.Sequence ( Seq )+import qualified Data.Sequence as Seq+import Data.Semigroup ( Semigroup(..) )+import Data.Series.Index ( Index )+import qualified Data.Series.Index as Index+import qualified Data.Series.Index.Internal as Index.Internal+import Data.Set ( Set )+import qualified Data.Set as Set+import Data.Traversable.WithIndex ( TraversableWithIndex(..) )+import qualified Data.Vector as Boxed+import Data.Vector.Algorithms.Intro ( sortUniqBy, sortBy )+import Data.Vector.Generic ( Vector )+import qualified Data.Vector.Generic as Vector+import qualified Data.Vector.Generic.Mutable as GM+import qualified Data.Vector.Unboxed as U+import qualified Data.Vector.Unboxed.Mutable as UM+ +import Prelude hiding ( take, takeWhile, drop, dropWhile, map, concatMap, foldMap, sum, length, null )+import qualified Prelude as P++++-- | A @Series v k a@ is a labeled array of type @v@ filled with values of type @a@,+-- indexed by keys of type @k@.+--+-- Like 'Data.Map.Strict.Map', they support efficient:+--+-- * random access by key ( \(O(\log n)\) );+-- * slice by key ( \(O(\log n)\) ).+--+-- Like 'Data.Vector.Vector', they support efficient:+--+-- * random access by index ( \(O(1)\) );+-- * slice by index ( \(O(1)\) );+-- * numerical operations.+--+data Series v k a + -- The reason the index is a set of keys is that we *want* keys to be ordered.+ -- This allows for efficient slicing of the underlying values, because+ -- if @k1 < k2@, then the values are also at indices @ix1 < ix2@.+ = MkSeries { index :: Index k -- ^ The 'Index' of a series, which contains its (unique) keys in ascending order.+ , values :: v a -- ^ The values of a series, in the order of its (unique) keys.+ }+++-- | \(O(n)\) Convert between two types of 'Series'.+convert :: (Vector v1 a, Vector v2 a) => Series v1 k a -> Series v2 k a+{-# INLINE convert #-}+convert (MkSeries ix vs) = MkSeries ix $ Vector.convert vs +++-- | \(O(1)\) Create a 'Series' with a single element.+singleton :: Vector v a => k -> a -> Series v k a+{-# INLINE singleton #-}+singleton k v = MkSeries (Index.singleton k) $ Vector.singleton v+++-- | \(O(n)\) Generate a 'Series' by mapping every element of its index.+fromIndex :: (Vector v a) + => (k -> a) -> Index k -> Series v k a+{-# INLINE fromIndex #-}+fromIndex f ix = MkSeries ix $ Vector.convert + $ Boxed.map f -- Using boxed vector to prevent a (Vector v k) constraint+ $ Index.toAscVector ix+++-- | The 'IsSeries' typeclass allow for ad-hoc definition+-- of conversion functions, converting to / from 'Series'.+class IsSeries t v k a where+ -- | Construct a 'Series' from some container of key-values pairs. There is no+ -- condition on the order of pairs. Duplicate keys are silently dropped. If you+ -- need to handle duplicate keys, see 'fromListDuplicates' or 'fromVectorDuplicates'.+ toSeries :: t -> Series v k a++ -- | Construct a container from key-value pairs of a 'Series'. + -- The elements are returned in ascending order of keys. + fromSeries :: Series v k a -> t+++instance (Ord k, Vector v a) => IsSeries [(k, a)] v k a where+ -- | Construct a series from a list of key-value pairs. There is no+ -- condition on the order of pairs.+ --+ -- >>> let xs = toSeries [('b', 0::Int), ('a', 5), ('d', 1) ]+ -- >>> xs+ -- index | values+ -- ----- | ------+ -- 'a' | 5+ -- 'b' | 0+ -- 'd' | 1+ --+ -- If you need to handle duplicate keys, take a look at `fromListDuplicates`.+ toSeries :: [(k, a)] -> Series v k a+ toSeries = toSeries . MS.fromList+ {-# INLINE toSeries #-}++ -- | Construct a list from key-value pairs. The elements are in order sorted by key:+ --+ -- >>> let xs = Series.toSeries [ ('b', 0::Int), ('a', 5), ('d', 1) ]+ -- >>> xs+ -- index | values+ -- ----- | ------+ -- 'a' | 5+ -- 'b' | 0+ -- 'd' | 1+ -- >>> fromSeries xs+ -- [('a',5),('b',0),('d',1)]+ fromSeries :: Series v k a -> [(k, a)]+ fromSeries (MkSeries ks vs)= zip (Index.toAscList ks) (Vector.toList vs)+ {-# INLINE fromSeries #-}+++-- | Construct a 'Series' from a list of key-value pairs. There is no+-- condition on the order of pairs. Duplicate keys are silently dropped. If you+-- need to handle duplicate keys, see 'fromListDuplicates'.+fromList :: (Vector v a, Ord k) => [(k, a)] -> Series v k a+{-# INLINE fromList #-}+fromList = toSeries+++-- | \(O(n)\) Build a 'Series' from a list of pairs, where the first elements of the pairs (the keys)+-- are distinct elements in ascending order. The precondition that the keys be unique and sorted is not checked.+fromDistinctAscList :: (Vector v a) => [(k, a)] -> Series v k a+fromDistinctAscList xs + = let (!ks, !vs) = unzip xs + in MkSeries (Index.Internal.fromDistinctAscList ks) (Vector.fromListN (List.length vs) vs)+++-- | Integer-like, non-negative number that specifies how many occurrences+-- of a key is present in a 'Series'.+--+-- The easiest way to convert from an 'Occurrence' to another integer-like type+-- is the 'fromIntegral' function.+newtype Occurrence = MkOcc Int+ deriving (Eq, Enum, Num, Ord, Integral, Real)+ deriving newtype (Show, U.Unbox) ++-- Occurrence needs to be an 'U.Unbox' type+-- so that 'fromVectorDuplicates' works with unboxed vectors+-- and series.+newtype instance UM.MVector s Occurrence = MV_Occ (UM.MVector s Int)+newtype instance U.Vector Occurrence = V_Occ (U.Vector Int)+deriving instance GM.MVector UM.MVector Occurrence+deriving instance Vector U.Vector Occurrence +++-- | Construct a series from a list of key-value pairs.+-- Contrary to 'fromList', values at duplicate keys are preserved. To keep each+-- key unique, an 'Occurrence' number counts up.+fromListDuplicates :: (Vector v a, Ord k) => [(k, a)] -> Series v (k, Occurrence) a+{-# INLINE fromListDuplicates #-}+fromListDuplicates = convert . fromVectorDuplicates . Boxed.fromList+++-- | Construct a list from key-value pairs. The elements are in order sorted by key. +toList :: Vector v a => Series v k a -> [(k, a)]+{-# INLINE toList #-}+toList (MkSeries ks vs) = zip (Index.toAscList ks) (Vector.toList vs)+++instance (Ord k) => IsSeries (Boxed.Vector (k, a)) Boxed.Vector k a where+ toSeries = fromVector+ {-# INLINE toSeries #-}++ fromSeries = toVector+ {-# INLINE fromSeries #-}+++instance (Ord k, U.Unbox a, U.Unbox k) => IsSeries (U.Vector (k, a)) U.Vector k a where+ toSeries :: U.Vector (k, a) -> Series U.Vector k a+ toSeries = fromVector+ {-# INLINE toSeries #-}++ fromSeries :: Series U.Vector k a -> U.Vector (k, a)+ fromSeries = toVector+ {-# INLINE fromSeries #-}+++-- | Construct a 'Series' from a 'Vector' of key-value pairs. There is no+-- condition on the order of pairs. Duplicate keys are silently dropped. If you+-- need to handle duplicate keys, see 'fromVectorDuplicates'.+--+-- Note that due to differences in sorting,+-- 'Series.fromList' and @'Series.fromVector' . 'Vector.fromList'@+-- may not be equivalent if the input list contains duplicate keys.+fromVector :: (Ord k, Vector v k, Vector v a, Vector v (k, a))+ => v (k, a) -> Series v k a+{-# INLINE fromVector #-}+fromVector vec = let (indexVector, valuesVector) = Vector.unzip $ runST $ do+ mv <- Vector.thaw vec+ -- Note that we're using this particular flavor of `sortUniqBy`+ -- because it both sorts AND removes duplicate keys+ destMV <- sortUniqBy (compare `on` fst) mv+ v <- Vector.freeze destMV+ pure (Vector.force v)+ in MkSeries (Index.Internal.fromDistinctAscVector indexVector) valuesVector+++-- | \(O(n)\) Build a 'Series' from a vector of pairs, where the first elements of the pairs (the keys)+-- are distinct elements in ascending order. The precondition that the keys be unique and sorted is not checked.+fromDistinctAscVector :: (Vector v k, Vector v a, Vector v (k, a))+ => v (k, a) -> Series v k a+fromDistinctAscVector xs + = let (ks, vs) = Vector.unzip xs + in MkSeries (Index.Internal.fromDistinctAscVector ks) vs+++-- | Construct a 'Series' from a 'Vector' of key-value pairs, where there may be duplicate keys. +-- There is no condition on the order of pairs.+fromVectorDuplicates :: (Ord k, Vector v k, Vector v a, Vector v (k, a), Vector v (k, Occurrence))+ => v (k, a) -> Series v (k, Occurrence) a+{-# INLINE fromVectorDuplicates #-}+fromVectorDuplicates vec + = let (indexVector, valuesVector) + = Vector.unzip $ runST $ do+ mv <- Vector.thaw vec+ sortBy (compare `on` fst) mv+ v <- Vector.freeze mv+ pure (Vector.force v)+ in MkSeries (Index.Internal.fromDistinctAscVector (occurences indexVector)) valuesVector+ where+ occurences vs + | Vector.null vs = Vector.empty+ | Vector.length vs == 1 = Vector.map (,0) vs+ | otherwise = Vector.scanl f (Vector.head vs, 0) (Vector.tail vs)+ where+ f (lastKey, lastOcc) newKey + | lastKey == newKey = (newKey, lastOcc + 1)+ | otherwise = (newKey, 0)+++-- | Construct a 'Vector' of key-value pairs. The elements are in order sorted by key. +toVector :: (Vector v a, Vector v k, Vector v (k, a)) + => Series v k a -> v (k, a)+{-# INLINE toVector #-}+toVector (MkSeries ks vs) = Vector.zip (Index.toAscVector ks) vs+++instance (Vector v a) => IsSeries (Map k a) v k a where+ toSeries :: Map k a -> Series v k a+ toSeries mp = MkSeries + { index = Index.fromSet $ MS.keysSet mp+ , values = Vector.fromListN (MS.size mp) $ MS.elems mp+ }+ {-# INLINE toSeries #-}++ fromSeries :: Series v k a -> Map k a+ fromSeries (MkSeries ks vs)+ = MS.fromDistinctAscList $ zip (Index.toAscList ks) (Vector.toList vs)+ {-# INLINE fromSeries #-}+++toLazyMap :: (Vector v a) => Series v k a -> Map k a+{-# INLINE toLazyMap #-}+toLazyMap = fromSeries+++-- | Construct a series from a lazy 'Data.Map.Lazy.Map'.+fromLazyMap :: (Vector v a) => ML.Map k a -> Series v k a+{-# INLINE fromLazyMap #-}+fromLazyMap = toSeries+++-- | Convert a series into a strict 'Data.Map.Strict.Map'.+toStrictMap :: (Vector v a) => Series v k a -> Map k a+{-# INLINE toStrictMap #-}+toStrictMap (MkSeries ks vs) = MS.fromDistinctAscList $ zip (Index.toAscList ks) (Vector.toList vs)+++-- | Construct a series from a strict 'Data.Map.Strict.Map'.+fromStrictMap :: (Vector v a) => MS.Map k a -> Series v k a+{-# INLINE fromStrictMap #-}+fromStrictMap mp = MkSeries { index = Index.toIndex $ MS.keysSet mp+ , values = Vector.fromListN (MS.size mp) $ MS.elems mp+ }+++instance (Vector v a) => IsSeries (IntMap a) v Int a where+ toSeries :: IntMap a -> Series v Int a+ toSeries im = MkSeries + { index = Index.toIndex $ IntMap.keysSet im+ , values = Vector.fromListN (IntMap.size im) $ IntMap.elems im + }+ {-# INLINE toSeries #-}++ fromSeries :: Series v Int a -> IntMap a+ fromSeries (MkSeries ks vs) + = IntMap.fromDistinctAscList $ zip (Index.toAscList ks) (Vector.toList vs)+ {-# INLINE fromSeries #-}+++instance (Ord k, Vector v a) => IsSeries (Seq (k, a)) v k a where+ toSeries :: Seq (k, a) -> Series v k a+ toSeries = toSeries . Foldable.toList+ {-# INLINE toSeries #-}++ fromSeries :: Series v k a -> Seq (k, a)+ fromSeries = Seq.fromList . fromSeries+ {-# INLINE fromSeries #-}+++instance (Vector v a) => IsSeries (Set (k, a)) v k a where+ toSeries :: Set (k, a) -> Series v k a+ toSeries = fromDistinctAscList . Set.toAscList+ {-# INLINE toSeries #-}++ fromSeries :: Series v k a -> Set (k, a)+ fromSeries = Set.fromDistinctAscList . toList+ {-# INLINE fromSeries #-}+++-- | Get the first value of a 'Series'. If the 'Series' is empty,+-- this function returns 'Nothing'.+headM :: Vector v a => Series v k a -> Maybe a+{-# INLINE headM #-}+headM (MkSeries _ vs) = Vector.headM vs+++-- | Get the last value of a 'Series'. If the 'Series' is empty,+-- this function returns 'Nothing'.+lastM :: Vector v a => Series v k a -> Maybe a+{-# INLINE lastM #-}+lastM (MkSeries _ vs) = Vector.lastM vs+++-- | \(O(\log n)\) @'take' n xs@ returns at most @n@ elements of the 'Series' @xs@.+take :: Vector v a => Int -> Series v k a -> Series v k a+{-# INLINE take #-}+take n (MkSeries ks vs) + -- Index.take is O(log n) while Vector.take is O(1)+ = MkSeries (Index.take n ks) (Vector.take n vs)+++-- | \(O(\log n)\) @'drop' n xs@ drops at most @n@ elements from the 'Series' @xs@.+drop :: Vector v a => Int -> Series v k a -> Series v k a+{-# INLINE drop #-}+drop n (MkSeries ks vs) + -- Index.drop is O(log n) while Vector.drop is O(1)+ = MkSeries (Index.drop n ks) (Vector.drop n vs)+++-- | \(O(n)\) Returns the longest prefix (possibly empty) of the input 'Series' that satisfy a predicate.+takeWhile :: Vector v a => (a -> Bool) -> Series v k a -> Series v k a+{-# INLINE takeWhile #-}+takeWhile f (MkSeries ix vs) = let taken = Vector.takeWhile f vs+ in MkSeries { index = Index.take (Vector.length taken) ix+ , values = taken + }+++-- | \(O(n)\) Returns the complement of 'takeWhile'.+dropWhile :: Vector v a => (a -> Bool) -> Series v k a -> Series v k a+{-# INLINE dropWhile #-}+dropWhile f (MkSeries ix vs) = let dropped = Vector.dropWhile f vs+ in MkSeries { index = Index.drop (Index.size ix - Vector.length dropped) ix+ , values = dropped+ }+++-- | \(O(n)\) Map every element of a 'Series'.+map :: (Vector v a, Vector v b) + => (a -> b) -> Series v k a -> Series v k b+{-# INLINE map #-}+map f (MkSeries ix xs) = MkSeries ix $ Vector.map f xs+++-- | \(O(n)\) Map every element of a 'Series', possibly using the key as well.+mapWithKey :: (Vector v a, Vector v b) + => (k -> a -> b) -> Series v k a -> Series v k b+{-# INLINE mapWithKey #-}+mapWithKey f (MkSeries ix xs) + -- We're using boxed vectors to map because we don't want any restrictions+ -- on the index type, i.e. we don't want the constraint Vector v k+ = let vs = Boxed.zipWith f (Index.toAscVector ix) (Vector.convert xs)+ in MkSeries ix (Vector.convert vs)+++-- | \(O(n \log n)\).+-- Map each key in the index to another value. Note that the resulting series+-- may have less elements, because each key must be unique.+--+-- In case new keys are conflicting, the first element is kept.+mapIndex :: (Vector v a, Ord k, Ord g) => Series v k a -> (k -> g) -> Series v g a+{-# INLINE mapIndex #-}+mapIndex (MkSeries index values) f+ -- Note that the order in which items are kept appears to be backwards;+ -- See the examples for Data.Map.Strict.fromListWith+ = let mapping = MS.fromListWith (\_ x -> x) $ [(f k, k) | k <- Index.toAscList index]+ newvalues = fmap (\k -> values Vector.! Index.Internal.findIndex k index) mapping+ in toSeries newvalues+++-- | Map a function over all the elements of a 'Series' and concatenate the result into a single 'Series'.+concatMap :: (Vector v a, Vector v k, Vector v b, Vector v (k, a), Vector v (k, b), Ord k) + => (a -> Series v k b) + -> Series v k a + -> Series v k b+{-# INLINE concatMap #-}+concatMap f = fromVector + . Vector.concatMap (toVector . f . snd) + . toVector+++instance (Vector v a, Ord k) => Semigroup (Series v k a) where+ {-# INLINE (<>) #-}+ (<>) :: Series v k a -> Series v k a -> Series v k a+ -- Despite all my effort, merging via conversion to Map remains fastest.+ xs <> ys = toSeries $ toStrictMap xs <> toStrictMap ys++ {-# INLINE sconcat #-}+ sconcat = toSeries . sconcat . fmap toStrictMap+++instance (Vector v a, Ord k) => Monoid (Series v k a) where+ {-# INLINE mempty #-}+ mempty :: Series v k a+ mempty = MkSeries mempty Vector.empty++ {-# INLINE mappend #-}+ mappend :: Series v k a -> Series v k a -> Series v k a+ mappend = (<>)++ {-# INLINE mconcat #-}+ mconcat :: [Series v k a] -> Series v k a+ mconcat = toSeries . mconcat . fmap toStrictMap+++instance (Vector v a, Eq k, Eq a) => Eq (Series v k a) where+ {-# INLINE (==) #-}+ (==) :: Series v k a -> Series v k a -> Bool+ (MkSeries ks1 vs1) == (MkSeries ks2 vs2) = (ks1 == ks2) && (vs1 `Vector.eq` vs2)+++instance (Vector v a, Ord (v a), Ord k, Ord a) => Ord (Series v k a) where+ {-# INLINE compare #-}+ compare :: Series v k a -> Series v k a -> Ordering+ compare (MkSeries ks1 vs1) (MkSeries ks2 vs2) = compare (ks1, vs1) (ks2, vs2)+++instance (Functor v) => Functor (Series v k) where+ {-# INLINE fmap #-}+ fmap :: (a -> b) -> Series v k a -> Series v k b+ fmap f (MkSeries ks vs) = MkSeries ks (fmap f vs)+++instance (forall a. Vector v a, Functor v) => FunctorWithIndex k (Series v k) where+ {-# INLINE imap #-}+ imap :: (k -> a -> b) -> Series v k a -> Series v k b+ imap = mapWithKey+++-- Inlining all methods in 'Foldable'+-- is important in order for folds over a boxed+-- Series to have performance characteristics+-- be as close as possible to boxed vectors +instance (Foldable v) => Foldable (Series v k) where+ {-# INLINE fold #-}+ fold :: Monoid m => Series v k m -> m+ fold = Foldable.fold . values++ {-# INLINE foldMap #-}+ foldMap :: (Monoid m) => (a -> m) -> Series v k a -> m+ foldMap f = Foldable.foldMap f . values++ {-# INLINE foldMap' #-}+ foldMap' :: (Monoid m) => (a -> m) -> Series v k a -> m+ foldMap' f = Foldable.foldMap f . values++ {-# INLINE foldr #-}+ foldr :: (a -> b -> b) -> b -> Series v k a -> b+ foldr f i = Foldable.foldr f i . values++ {-# INLINE foldr' #-}+ foldr' :: (a -> b -> b) -> b -> Series v k a -> b+ foldr' f i = Foldable.foldr' f i . values++ {-# INLINE foldl #-}+ foldl :: (b -> a -> b) -> b -> Series v k a -> b+ foldl f i = Foldable.foldl f i . values++ {-# INLINE foldl' #-}+ foldl' :: (b -> a -> b) -> b -> Series v k a -> b+ foldl' f i = Foldable.foldl' f i . values++ {-# INLINE foldr1 #-}+ foldr1 :: (a -> a -> a) -> Series v k a -> a+ foldr1 f = Foldable.foldr1 f . values++ {-# INLINE foldl1 #-}+ foldl1 :: (a -> a -> a) -> Series v k a -> a+ foldl1 f = Foldable.foldl1 f . values++ {-# INLINE toList #-}+ toList :: Series v k a -> [a]+ toList = Foldable.toList . values++ {-# INLINE null #-}+ null :: Series v k a -> Bool+ null = Foldable.null . values++ {-# INLINE length #-}+ length :: Series v k a -> Int+ length = Foldable.length . values++ {-# INLINE elem #-}+ elem :: Eq a => a -> Series v k a -> Bool+ elem e = Foldable.elem e . values++ {-# INLINE maximum #-}+ maximum :: Ord a => Series v k a -> a+ maximum = Foldable.maximum . values++ {-# INLINE minimum #-}+ minimum :: Ord a => Series v k a -> a+ minimum = Foldable.minimum . values++ {-# INLINE sum #-}+ sum :: Num a => Series v k a -> a+ sum = Foldable.sum . values++ {-# INLINE product #-}+ product :: Num a => Series v k a -> a+ product = Foldable.product . values+++instance (forall a. Vector v a, Vector v k, Foldable v, Functor v) => FoldableWithIndex k (Series v k) where+ {-# INLINE ifoldMap #-}+ ifoldMap :: Monoid m => (k -> a -> m) -> Series v k a -> m+ ifoldMap = foldMapWithKey+++instance (Foldable v) => Bifoldable (Series v) where+ {-# INLINE bifoldMap #-}+ bifoldMap :: Monoid m => (k -> m) -> (a -> m) -> Series v k a -> m+ bifoldMap fk fv (MkSeries ks vs) = P.foldMap fk ks <> Foldable.foldMap fv vs+++instance (Traversable v) => Traversable (Series v k) where+ {-# INLINE traverse #-}+ traverse :: Applicative f+ => (a -> f b) -> Series v k a -> f (Series v k b)+ traverse f (MkSeries ix vs) = MkSeries ix <$> traverse f vs+++instance (forall a. Vector v a, Functor v, Foldable v, Ord k, Traversable v) => TraversableWithIndex k (Series v k) where+ {-# INLINE itraverse #-}+ itraverse :: Applicative f => (k -> a -> f b) -> Series v k a -> f (Series v k b)+ itraverse = traverseWithKey+++-- | \(O(n)\) Execute a 'Fold' over a 'Series'.+--+-- See also 'foldM' for monadic folds, and 'foldWithKey' to take keys into+-- account while folding.+fold :: Vector v a + => Fold a b + -> Series v k a + -> b+fold (Fold step init' extract) + = extract . Vector.foldl' step init' . values+{-# INLINE fold #-}+++-- | \(O(n)\) Execute a monadic 'FoldM' over a 'Series'.+--+-- See also 'fold' for pure folds, and 'foldMWithKey' to take keys into+-- account while folding.+foldM :: (Monad m, Vector v a)+ => FoldM m a b + -> Series v k a + -> m b+foldM (FoldM step init' extract) xs+ = init' >>= \i -> Vector.foldM' step i (values xs) >>= extract+{-# INLINE foldM #-}+++-- | \(O(n)\) Execute a 'Fold' over a 'Series', where the 'Fold' takes keys into account.+foldWithKey :: (Vector v a, Vector v k, Vector v (k, a)) + => Fold (k, a) b + -> Series v k a + -> b+foldWithKey (Fold step init' extract) + = extract . Vector.foldl' step init' . toVector+{-# INLINE foldWithKey #-}+++-- | \(O(n)\) Execute a monadic 'FoldM' over a 'Series', where the 'FoldM' takes keys into account.+foldMWithKey :: (Monad m, Vector v a, Vector v k, Vector v (k, a)) + => FoldM m (k, a) b+ -> Series v k a + -> m b+foldMWithKey (FoldM step init' extract) xs+ = init' >>= \i -> Vector.foldM' step i (toVector xs) >>= extract+{-# INLINE foldMWithKey #-}+++-- | \(O(n)\) Fold over elements in a 'Series'.+foldMap :: (Monoid m, Vector v a) => (a -> m) -> Series v k a -> m+{-# INLINE foldMap #-}+foldMap f = Vector.foldMap f . values+++-- | \(O(n)\) Fold over pairs of keys and elements in a 'Series'.+-- See also 'bifoldMap'.+foldMapWithKey :: (Monoid m, Vector v a, Vector v k, Vector v (k, a)) => (k -> a -> m) -> Series v k a -> m+{-# INLINE foldMapWithKey #-}+foldMapWithKey f = Vector.foldMap (uncurry f) . toVector+++-- | \(O(n)\) Fold over keys and elements separately in a 'Series'.+-- See also 'foldMapWithKey'.+bifoldMap :: (Vector v a, Monoid m) => (k -> m) -> (a -> m) -> Series v k a -> m+{-# INLINE bifoldMap #-}+bifoldMap fk fv (MkSeries ks vs) = P.foldMap fk ks <> Vector.foldMap fv vs+++-- | \(O(1)\) Extract the length of a 'Series'.+length :: Vector v a => Series v k a -> Int+{-# INLINE length #-}+length = Vector.length . values+++-- | \(O(1)\) Test whether a 'Series' is empty.+null :: Vector v a => Series v k a -> Bool+{-# INLINE null #-}+null = Vector.null . values+++-- | \(O(n)\) Apply the monadic action to every element of a series and its+-- index, yielding a series of results.+mapWithKeyM :: (Vector v a, Vector v b, Monad m, Ord k) + => (k -> a -> m b) -> Series v k a -> m (Series v k b)+{-# INLINE mapWithKeyM #-}+mapWithKeyM f xs = let f' (key, val) = (key,) <$> f key val+ in fmap fromList $ traverse f' $ toList xs+++-- | \(O(n)\) Apply the monadic action to every element of a series and its+-- index, discarding the results.+mapWithKeyM_ :: (Vector v a, Monad m) + => (k -> a -> m b) -> Series v k a -> m ()+{-# INLINE mapWithKeyM_ #-}+mapWithKeyM_ f xs = let f' (key, val) = (key,) <$> f key val+ in mapM_ f' $ toList xs+++-- | \(O(n)\) Apply the monadic action to all elements of the series and their associated keys, +-- yielding a series of results.+forWithKeyM :: (Vector v a, Vector v b, Monad m, Ord k) => Series v k a -> (k -> a -> m b) -> m (Series v k b)+{-# INLINE forWithKeyM #-}+forWithKeyM = flip mapWithKeyM+++-- | \(O(n)\) Apply the monadic action to all elements of the series and their associated keys, +-- discarding the results.+forWithKeyM_ :: (Vector v a, Monad m) => Series v k a -> (k -> a -> m b) -> m ()+{-# INLINE forWithKeyM_ #-}+forWithKeyM_ = flip mapWithKeyM_+++-- | \(O(n)\) Traverse a 'Series' with an Applicative action, taking into account both keys and values. +traverseWithKey :: (Applicative t, Ord k, Traversable v, Vector v a, Vector v b, Vector v k, Vector v (k, a), Vector v (k, b))+ => (k -> a -> t b) + -> Series v k a + -> t (Series v k b)+{-# INLINE traverseWithKey #-}+traverseWithKey f = fmap fromVector + . traverse (\(k, x) -> (k,) <$> f k x) + . toVector+++instance (NFData (v a), NFData k) => NFData (Series v k a) where+ rnf :: Series v k a -> ()+ rnf (MkSeries ks vs) = rnf ks `seq` rnf vs+++instance (Vector v a, Ord k, Show k, Show a) => Show (Series v k a) where+ show :: Series v k a -> String+ show = display+++-- | Options controlling how to display 'Series' in the 'displayWith' function.+-- Default options are provided by 'defaultDisplayOptions'.+--+-- To help with creating 'DisplayOptions', see 'noLongerThan'.+data DisplayOptions k a+ = DisplayOptions+ { maximumNumberOfRows :: Int+ -- ^ Maximum number of rows shown. These rows will be distributed evenly+ -- between the start of the 'Series' and the end. + , indexHeader :: String+ -- ^ Header of the index column.+ , valuesHeader :: String+ -- ^ Header of the values column.+ , keyDisplayFunction :: k -> String+ -- ^ Function used to display keys from the 'Series'. Use 'noLongerThan'+ -- to control the width of the index column.+ , valueDisplayFunction :: a -> String+ -- ^ Function used to display values from the 'Series'. Use 'noLongerThan'+ -- to control the width of the values column.+ }+++-- | Default 'Series' display options.+defaultDisplayOptions :: (Show k, Show a) => DisplayOptions k a+defaultDisplayOptions + = DisplayOptions { maximumNumberOfRows = 6+ , indexHeader = "index"+ , valuesHeader = "values"+ , keyDisplayFunction = show+ , valueDisplayFunction = show+ }+++-- | This function modifies existing functions to limit the width of its result.+--+-- >>> let limit7 = (show :: Int -> String) `noLongerThan` 7+-- >>> limit7 123456789+-- "123456..."+noLongerThan :: (a -> String) -> Int -> (a -> String)+noLongerThan f len x + = let raw = f x+ in if List.length raw <= max 0 len+ then raw+ else List.take (List.length raw - 3) raw <> "..."+++-- | Display a 'Series' using default 'DisplayOptions'.+display :: (Vector v a, Show k, Show a) + => Series v k a + -> String+display = displayWith defaultDisplayOptions+++-- | Display a 'Series' using customizable 'DisplayOptions'.+displayWith :: (Vector v a) + => DisplayOptions k a+ -> Series v k a + -> String+displayWith DisplayOptions{..} xs+ = formatGrid $ if length xs > max 0 maximumNumberOfRows+ then let headlength = max 0 maximumNumberOfRows `div` 2+ taillength = max 0 maximumNumberOfRows - headlength+ in mconcat [ [ (keyDisplayFunction k, valueDisplayFunction v) | (k, v) <- toList $ take headlength xs]+ , [ ("...", "...") ]+ , [ (keyDisplayFunction k, valueDisplayFunction v) | (k, v) <- toList $ drop (length xs - taillength) xs]+ ] + else [ (keyDisplayFunction k, valueDisplayFunction v) | (k, v) <- toList xs ]++ where+ -- | Format a grid represented by a list of rows, where every row is a list of items+ -- All columns will have a fixed width+ formatGrid :: [ (String, String) ] -- List of rows+ -> String+ formatGrid rows = mconcat $ List.intersperse "\n" + $ [ pad indexWidth k <> " | " <> pad valuesWidth v + | (k, v) <- rows'+ ] + where+ rows' = [ (indexHeader, valuesHeader) ] <> [ ("-----", "------")] <> rows+ (indexCol, valuesCol) = unzip rows'+ width col = maximum (P.length <$> col)+ indexWidth = width indexCol+ valuesWidth = width valuesCol++ -- | Pad a string to a minimum of @n@ characters wide.+ pad :: Int -> String -> String + pad n s+ | n <= P.length s = s+ | otherwise = replicate (n - P.length s) ' ' <> s
+ src/Data/Series/Generic/Internal.hs view
@@ -0,0 +1,27 @@+-----------------------------------------------------------------------------+-- |+-- Module : Data.Series.Generic.Internal+-- Copyright : (c) Laurent P. René de Cotret+-- License : MIT+-- Maintainer : laurent.decotret@outlook.com+-- Portability : portable+--+-- = WARNING+--+-- This module is considered __internal__. Using the 'Series' constructor+-- directly may result in loss or corruption of data if not handled carefully.+--+-- The Package Versioning Policy still applies.++module Data.Series.Generic.Internal ( + -- * Constructor+ Series(..),+ -- * Unsafe construction+ fromDistinctAscList,+ fromDistinctAscVector,+ -- * Unsafe selection+ selectSubset+) where++import Data.Series.Generic.Definition ( Series(..), fromDistinctAscList, fromDistinctAscVector )+import Data.Series.Generic.View ( selectSubset )
+ src/Data/Series/Generic/Numeric.hs view
@@ -0,0 +1,7 @@+module Data.Series.Generic.Numeric ( + module Control.Foldl+) where++import Control.Foldl ( sum, product, mean, variance, std )++
+ src/Data/Series/Generic/Scans.hs view
@@ -0,0 +1,112 @@++module Data.Series.Generic.Scans (+ postscanl,+ prescanl,++ -- * Filling missing data+ forwardFill,+) where++import Data.Series.Generic.Definition ( Series(..) )++import Data.Vector.Generic ( Vector )+import qualified Data.Vector.Generic as Vector ++-- $setup+-- >>> import qualified Data.Series.Generic ( Series )+-- >>> import qualified Data.Series.Generic as Series+-- >>> import qualified Data.Series.Index as Index++-- | \(O(n)\) Left-to-right postscan.+--+-- >>> import qualified Data.Vector as V +-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4]) :: Series V.Vector Int Int+-- >>> xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 2+-- 2 | 3+-- 3 | 4+-- >>> postscanl (+) 0 xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 3+-- 2 | 6+-- 3 | 10+postscanl :: (Vector v a, Vector v b) => (a -> b -> a) -> a -> Series v k b -> Series v k a+{-# INLINE postscanl #-}+postscanl f s (MkSeries ix vs) = MkSeries ix $ Vector.postscanl f s vs+++-- | \(O(n)\) Left-to-right prescan.+--+-- >>> import qualified Data.Vector as V +-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4]) :: Series V.Vector Int Int+-- >>> xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 2+-- 2 | 3+-- 3 | 4+-- >>> prescanl (+) 0 xs+-- index | values+-- ----- | ------+-- 0 | 0+-- 1 | 1+-- 2 | 3+-- 3 | 6+prescanl :: (Vector v a, Vector v b) => (a -> b -> a) -> a -> Series v k b -> Series v k a+{-# INLINE prescanl #-}+prescanl f s (MkSeries ix vs) = MkSeries ix $ Vector.prescanl f s vs+++-- | \(O(n)\) Replace all instances of 'Nothing' with the last previous+-- value which was not 'Nothing'.+--+-- >>> import qualified Data.Vector as V +-- >>> let xs = Series.fromList (zip [0..] [Just 1, Just 2,Nothing, Just 3]) :: Series V.Vector Int (Maybe Int)+-- >>> xs+-- index | values+-- ----- | ------+-- 0 | Just 1+-- 1 | Just 2+-- 2 | Nothing+-- 3 | Just 3+-- >>> forwardFill 0 xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 2+-- 2 | 2+-- 3 | 3+--+-- If the first entry of the series is missing, the first input to 'forwardFill' will be used:+--+-- >>> let ys = Series.fromList (zip [0..] [Nothing, Just 2,Nothing, Just 3]) :: Series V.Vector Int (Maybe Int)+-- >>> ys+-- index | values+-- ----- | ------+-- 0 | Nothing+-- 1 | Just 2+-- 2 | Nothing+-- 3 | Just 3+-- >>> forwardFill 0 ys+-- index | values+-- ----- | ------+-- 0 | 0+-- 1 | 2+-- 2 | 2+-- 3 | 3+forwardFill :: (Vector v a, Vector v (Maybe a))+ => a -- ^ Until the first non-'Nothing' is found, 'Nothing' will be filled with this value.+ -> Series v k (Maybe a)+ -> Series v k a+{-# INLINE forwardFill #-}+forwardFill = postscanl go+ where+ go :: a -> Maybe a -> a+ go lastValid Nothing = lastValid+ go _ (Just v) = v
+ src/Data/Series/Generic/View.hs view
@@ -0,0 +1,333 @@+module Data.Series.Generic.View (+ -- * Accessing a single element+ (!),+ at,+ iat,++ -- * Bulk access+ select,+ slice,+ selectWhere,+ selectSubset,+ Selection,++ -- * Resizing+ require,+ requireWith,+ filter,+ filterWithKey,+ catMaybes,+ dropIndex,++ -- * Creating and accessing ranges+ Range(..),+ to,+ from,+ upto,+) where+++import Data.Series.Index ( Index )+import qualified Data.Series.Index as Index+import qualified Data.Series.Index.Internal as Index.Internal+import Data.Maybe ( fromJust, isJust )+import Data.Series.Generic.Definition ( Series(..) )+import qualified Data.Series.Generic.Definition as G+import Data.Set ( Set )+import qualified Data.Set as Set+import qualified Data.Vector as Boxed+import Data.Vector.Generic ( Vector )+import qualified Data.Vector.Generic as Vector++import Prelude hiding ( filter )++-- $setup+-- >>> import qualified Data.Series as Series+-- >>> import qualified Data.Series.Index as Index ++infixr 9 `to` -- Ensure that @to@ binds strongest+infixl 1 `select` +++-- | \(O(1)\). Extract a single value from a series, by index. +-- An exception is thrown if the index is out-of-bounds.+--+-- A safer alternative is @iat@, which returns 'Nothing' if the index is+-- out-of-bounds.+(!) :: Vector v a => Series v k a -> Int -> a+(MkSeries _ vs) ! ix = (Vector.!) vs ix+++-- | \(O(\log n)\). Extract a single value from a series, by key.+at :: (Vector v a, Ord k) => Series v k a -> k -> Maybe a+at (MkSeries ks vs) k = do+ ix <- Index.lookupIndex k ks+ pure $ Vector.unsafeIndex vs ix +{-# INLINE at #-}+++-- | \(O(1)\). Extract a single value from a series, by index.+iat :: Vector v a => Series v k a -> Int -> Maybe a+iat (MkSeries _ vs) = (Vector.!?) vs+{-# INLINE iat #-}+++-- | require a series with a new index.+-- Contrary to 'select', all keys in @'Set' k@ will be present in the re-indexed series.+require :: (Vector v a, Vector v (Maybe a), Ord k) + => Series v k a -> Index k -> Series v k (Maybe a)+{-# INLINE require #-}+require = requireWith (const Nothing) Just+++-- | Generalization of 'require', which maps missing keys to values.+-- This is particularly useful for 'Vector' instances which don't support 'Maybe', like "Data.Vector.Unboxed".+requireWith :: (Vector v a, Vector v b, Ord k)+ => (k -> b) -- ^ Function to apply to keys which are missing from the input series, but required in the input index+ -> (a -> b) -- ^ Function to apply to values which are in the input series and input index.+ -> Series v k a + -> Index k + -> Series v k b+{-# INLINE requireWith #-}+requireWith replacement f xs ss + = let existingKeys = index xs `Index.intersection` ss+ newKeys = ss `Index.difference` existingKeys+ in G.map f (xs `selectSubset` existingKeys) <> MkSeries newKeys (Vector.fromListN (Index.size newKeys) (replacement <$> Index.toAscList newKeys))+++-- | Drop the index of a series by replacing it with an @Int@-based index. Values will+-- be indexed from 0.+dropIndex :: Series v k a -> Series v Int a+{-# INLINE dropIndex #-}+dropIndex (MkSeries ks vs) = MkSeries (Index.Internal.fromDistinctAscList [0..Index.size ks - 1]) vs+++-- | Filter elements. Only elements for which the predicate is @True@ are kept. +-- Notice that the filtering is done on the values, not on the keys; see 'filterWithKey'+-- to filter while taking keys into account.+filter :: (Vector v a, Vector v Int, Ord k) + => (a -> Bool) -> Series v k a -> Series v k a+{-# INLINE filter #-}+filter predicate xs@(MkSeries ks vs) + = let indicesToKeep = Vector.findIndices predicate vs+ keysToKeep = Index.Internal.fromDistinctAscList [Index.Internal.elemAt ix ks | ix <- Vector.toList indicesToKeep]+ in xs `select` keysToKeep+++-- | Filter elements, taking into account the corresponding key. Only elements for which +-- the predicate is @True@ are kept. +filterWithKey :: (Vector v a, Vector v Int, Vector v Bool, Ord k) + => (k -> a -> Bool) + -> Series v k a + -> Series v k a+{-# INLINE filterWithKey #-}+filterWithKey predicate xs = xs `selectWhere` G.mapWithKey predicate xs+++-- | \(O(n)\) Only keep elements which are @'Just' v@. +catMaybes :: (Vector v a, Vector v (Maybe a), Vector v Int, Ord k) + => Series v k (Maybe a) -> Series v k a+{-# INLINE catMaybes #-}+catMaybes = G.map fromJust . filter isJust+++-- | Datatype representing an /inclusive/ range of keys, which can either be bounded+-- or unbounded. The canonical ways to construct a 'Range' are to use 'to', 'from', and 'upto':+--+-- >>> 'a' `to` 'z'+-- Range (from 'a' to 'z')+-- >>> from 'd'+-- Range (from 'd')+-- >>> upto 'q'+-- Range (up to 'q')+--+-- A 'Range' can be used to efficiently select a sub-series with 'select'.+data Range k + = BoundedRange k k+ | From k+ | UpTo k+ deriving (Eq)+++instance Show k => Show (Range k) where+ show :: Range k -> String+ show (BoundedRange start stop) = mconcat ["Range (from ", show start, " to ", show stop, ")"]+ show (From start) = mconcat ["Range (from ", show start, ")"]+ show (UpTo stop) = mconcat ["Range (up to ", show stop, ")"]+++-- | Find the keys which are in range. In case of an empty 'Series',+-- the returned value is 'Nothing'.+keysInRange :: Ord k => Series v k a -> Range k -> Maybe (k, k)+{-# INLINE keysInRange #-}+keysInRange (MkSeries ks _) rng+ = let inrange = inRange rng+ in if Set.null inrange + then Nothing+ else Just (Set.findMin inrange, Set.findMax inrange)+ where+ inRange (BoundedRange start stop) = Set.takeWhileAntitone (<= stop) + $ Set.dropWhileAntitone (< start) $ Index.toSet ks+ inRange (From start) = Set.dropWhileAntitone (< start) $ Index.toSet ks+ inRange (UpTo stop) = Set.takeWhileAntitone (<= stop) $ Index.toSet ks+++-- | Create a bounded 'Range' which can be used for slicing. This function+-- is expected to be used in conjunction with 'select'.+--+-- For unbound ranges, see 'from' and 'upto'.+to :: Ord k => k -> k -> Range k+to k1 k2 = BoundedRange (min k1 k2) (max k1 k2)+++-- | Create an unbounded 'Range' which can be used for slicing. +-- This function is expected to be used in conjunction with 'select'. +--+-- For bound ranges, see 'to'.+from :: k -> Range k+from = From+++-- | Create an unbounded 'Range' which can be used for slicing. This function+-- is expected to be used in conjunction with 'select'. +--+-- For bound ranges, see 'to'.+upto :: k -> Range k+upto = UpTo+++-- | Class for datatypes which can be used to select sub-series using 'select'.+--+-- There are two use-cases for 'select':+--+-- * Bulk random-access (selecting from an 'Index' of keys);+-- * Bulk ordered access (selecting from a 'Range' of keys).+--+-- See the documentation for 'select'.+class Selection s where+ -- | Select a subseries. There are two main ways to do this.+ --+ -- The first way to do this is to select a sub-series based on keys:+ --+ -- >>> let xs = Series.fromList [('a', 10::Int), ('b', 20), ('c', 30), ('d', 40)]+ -- >>> xs `select` Index.fromList ['a', 'd']+ -- index | values+ -- ----- | ------+ -- 'a' | 10+ -- 'd' | 40+ --+ -- The second way to select a sub-series is to select all keys in a range:+ --+ -- >>> xs `select` 'b' `to` 'c'+ -- index | values+ -- ----- | ------+ -- 'b' | 20+ -- 'c' | 30+ --+ -- Such ranges can also be unbounded. (i.e. all keys smaller or larger than some key), like so:+ --+ -- >>> xs `select` upto 'c'+ -- index | values+ -- ----- | ------+ -- 'a' | 10+ -- 'b' | 20+ -- 'c' | 30+ -- >>> xs `select` from 'c'+ -- index | values+ -- ----- | ------+ -- 'c' | 30+ -- 'd' | 40+ --+ -- Note that with 'select', you'll always get a sub-series; if you ask for a key which is not+ -- in the series, it'll be ignored:+ --+ -- >>> xs `select` Index.fromList ['a', 'd', 'e']+ -- index | values+ -- ----- | ------+ -- 'a' | 10+ -- 'd' | 40+ --+ -- See 'require' if you want to ensure that all keys are present.+ select :: (Vector v a, Ord k) => Series v k a -> s k -> Series v k a+++instance Selection Index where+ -- | Select all keys in 'Index' from a series. Keys which are not+ -- in the series are ignored.+ select :: (Vector v a, Ord k) => Series v k a -> Index k -> Series v k a+ {-# INLINE select #-}+ select xs ss+ = let selectedKeys = index xs `Index.intersection` ss+ -- Surprisingly, using `Vector.backpermute` does not+ -- perform as well as `Vector.map (Vector.unsafeIndex vs)`+ -- for large Series+ in xs `selectSubset` selectedKeys++-- | Selecting a sub-series from a 'Set' is a convenience+-- function. Internally, the 'Set' is converted to an index first.+instance Selection Set where+ select :: (Vector v a, Ord k) => Series v k a -> Set k -> Series v k a+ {-# INLINE select #-}+ select xs = select xs . Index.fromSet+++-- | Selecting a sub-series from a list is a convenience+-- function. Internally, the list is converted to an index first.+instance Selection [] where+ select :: (Vector v a, Ord k) => Series v k a -> [k] -> Series v k a+ {-# INLINE select #-}+ select xs = select xs . Index.fromList+++-- | Selecting a sub-series based on a @Range@ is most performant.+-- Constructing a @Range@ is most convenient using the 'to' function.+instance Selection Range where+ select :: (Vector v a, Ord k) => Series v k a -> Range k -> Series v k a+ {-# INLINE select #-}+ select series rng = case keysInRange series rng of + Nothing -> mempty+ Just (kstart, kstop) -> let indexOf xs k = Index.Internal.findIndex k (index xs)+ in slice (series `indexOf` kstart) (1 + indexOf series kstop) series+++-- | Select a sub-series from a series matching a condition.+selectWhere :: (Vector v a, Vector v Int, Vector v Bool, Ord k) => Series v k a -> Series v k Bool -> Series v k a+{-# INLINE selectWhere #-}+selectWhere xs ys = xs `select` Index.fromSet keysWhereTrue+ where+ (MkSeries _ cond) = ys `select` index xs+ whereValuesAreTrue = Set.fromDistinctAscList $ Vector.toList (Vector.findIndices id cond)+ keysWhereTrue = Set.mapMonotonic (`Index.Internal.elemAt` index xs) whereValuesAreTrue+++-- | Implementation of `select` where the selection keys are known+-- to be a subset of the series. This precondition is NOT checked.+--+-- This is a performance optimization and therefore is not normally exposed.+selectSubset :: (Vector v a, Ord k) => Series v k a -> Index k -> Series v k a+{-# INLINE selectSubset #-}+selectSubset (MkSeries ks vs) ss+ -- TODO: + -- Is it possible to scan over the series once+ -- while filtering away on keys? Initial attempts did not lead+ -- to performance improvements, but I can't imagine that calling+ -- `Index.Internal.findIndex` repeatedly is efficient+ = MkSeries ss $ Boxed.convert+ $ Boxed.map (Vector.unsafeIndex vs . (`Index.Internal.findIndex` ks))+ $ Index.toAscVector ss+++-- | Yield a subseries based on indices. The end index is not included.+slice :: Vector v a+ => Int -- ^ Start index+ -> Int -- ^ End index, which is not included+ -> Series v k a + -> Series v k a+{-# INLINE slice #-}+slice start stop (MkSeries ks vs) + = let stop' = min (Vector.length vs) stop+ in MkSeries { index = Index.take (stop' - start) $ Index.drop start ks+ , values = Vector.slice start (stop' - start) vs+ }++
+ src/Data/Series/Generic/Zip.hs view
@@ -0,0 +1,463 @@+module Data.Series.Generic.Zip (+ zipWith, zipWithMatched, zipWithKey,+ zipWith3, zipWithMatched3, zipWithKey3,+ replace, (|->), (<-|),+ + -- * Generalized zipping with strategies+ zipWithStrategy,+ zipWithStrategy3,+ ZipStrategy,+ skipStrategy,+ mapStrategy,+ constStrategy,++ -- * Special case of zipping monoids+ zipWithMonoid,+ esum, eproduct,++ -- * Unzipping+ unzip, unzip3,+) where++import qualified Data.Map.Strict as Map+import Data.Monoid ( Sum(..), Product(..) )+import Data.Series.Generic.Definition ( Series(MkSeries, index, values) )+import qualified Data.Series.Generic.Definition as G+import Data.Series.Generic.View ( selectSubset, requireWith )+import Data.Vector.Generic ( Vector )+import qualified Data.Vector.Generic as Vector+import qualified Data.Series.Index as Index+import qualified Data.Series.Index.Internal as Index.Internal+import Prelude hiding ( zipWith, zipWith3, unzip, unzip3 ) ++-- $setup+-- >>> import qualified Data.Series as Series++infix 6 |->, <-|++-- | Apply a function elementwise to two series, matching elements+-- based on their keys. For keys present only in the left or right series, +-- the value 'Nothing' is returned.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> zipWith (+) xs ys+-- index | values+-- ----- | ------+-- "alpha" | Just 10+-- "beta" | Just 12+-- "delta" | Nothing+-- "gamma" | Nothing+--+-- To only combine elements where keys are in both series, see 'zipWithMatched'+zipWith :: (Vector v a, Vector v b, Vector v c, Vector v (Maybe c), Ord k) + => (a -> b -> c) -> Series v k a -> Series v k b -> Series v k (Maybe c)+zipWith f left right+ = let matched = zipWithMatched f left right+ matchedKeys = index matched+ allKeys = index left `Index.union` index right+ unmatchedKeys = allKeys `Index.difference` matchedKeys+ unmatched = MkSeries unmatchedKeys (Vector.replicate (Index.size unmatchedKeys) Nothing)+ in G.map Just matched <> unmatched+{-# INLINE zipWith #-}+++-- | Apply a function elementwise to three series, matching elements+-- based on their keys. For keys present only in the left or right series, +-- the value 'Nothing' is returned.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> let zs = Series.fromList [ ("alpha", 20::Int), ("delta", 13), ("epsilon", 6) ]+-- >>> zipWith3 (\x y z -> x + y + z) xs ys zs+-- index | values+-- ----- | ------+-- "alpha" | Just 30+-- "beta" | Nothing+-- "delta" | Nothing+-- "epsilon" | Nothing+-- "gamma" | Nothing+--+-- To only combine elements where keys are in all series, see 'zipWithMatched3'+zipWith3 :: (Vector v a, Vector v b, Vector v c, Vector v d, Vector v (Maybe d), Ord k) + => (a -> b -> c -> d) + -> Series v k a + -> Series v k b + -> Series v k c + -> Series v k (Maybe d)+zipWith3 f left center right+ = let matched = zipWithMatched3 f left center right+ matchedKeys = index matched+ allKeys = index left `Index.union` index center `Index.union` index right+ unmatchedKeys = allKeys `Index.difference` matchedKeys+ unmatched = MkSeries unmatchedKeys (Vector.replicate (Index.size unmatchedKeys) Nothing)+ in G.map Just matched <> unmatched+{-# INLINE zipWith3 #-}++++-- | Apply a function elementwise to two series, matching elements+-- based on their keys. Keys present only in the left or right series are dropped.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> zipWithMatched (+) xs ys+-- index | values+-- ----- | ------+-- "alpha" | 10+-- "beta" | 12+--+-- To combine elements where keys are in either series, see 'zipWith'. To combine+-- three series, see 'zipWithMatched3'.+zipWithMatched :: (Vector v a, Vector v b, Vector v c, Ord k) + => (a -> b -> c) -> Series v k a -> Series v k b -> Series v k c+zipWithMatched f left right+ = let matchedKeys = index left `Index.intersection` index right+ -- Recall that `selectSubset` is a performance optimization+ -- and is generally unsafe to use; however, in this case, we know+ -- that `matchedKeys` are subsets of the index of both series+ (MkSeries _ !xs) = left `selectSubset` matchedKeys+ (MkSeries _ !ys) = right `selectSubset` matchedKeys+ -- The following construction relies on the fact that keys are always sorted+ in MkSeries matchedKeys $ Vector.zipWith f xs ys+{-# INLINE zipWithMatched #-}+++-- | Apply a function elementwise to three series, matching elements+-- based on their keys. Keys not present in all three series are dropped.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> let zs = Series.fromList [ ("alpha", 20::Int), ("delta", 13), ("epsilon", 6) ]+-- >>> zipWithMatched3 (\x y z -> x + y + z) xs ys zs+-- index | values+-- ----- | ------+-- "alpha" | 30+zipWithMatched3 :: (Vector v a, Vector v b, Vector v c, Vector v d, Ord k) + => (a -> b -> c -> d) + -> Series v k a + -> Series v k b + -> Series v k c+ -> Series v k d+zipWithMatched3 f left center right+ = let matchedKeys = index left `Index.intersection` index center `Index.intersection` index right+ -- Recall that `selectSubset` is a performance optimization+ -- and is generally unsafe to use; however, in this case, we know+ -- that `matchedKeys` are subsets of the index of all series+ (MkSeries _ !xs) = left `selectSubset` matchedKeys+ (MkSeries _ !ys) = center `selectSubset` matchedKeys+ (MkSeries _ !zs) = right `selectSubset` matchedKeys+ -- The following construction relies on the fact that keys are always sorted+ in MkSeries matchedKeys $ Vector.zipWith3 f xs ys zs+{-# INLINE zipWithMatched3 #-}+++-- | Apply a function elementwise to two series, matching elements+-- based on their keys. Keys present only in the left or right series are dropped.+-- +-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> zipWithKey (\k x y -> length k + x + y) xs ys+-- index | values+-- ----- | ------+-- "alpha" | 15+-- "beta" | 16+--+-- To combine elements where keys are in either series, see 'zipWith'+zipWithKey :: (Vector v a, Vector v b, Vector v c, Vector v k, Ord k) + => (k -> a -> b -> c) -> Series v k a -> Series v k b -> Series v k c+zipWithKey f left right+ = let matchedKeys = index left `Index.intersection` index right+ -- Recall that `selectSubset` is a performance optimization+ -- and is generally unsafe to use; however, in this case, we know+ -- that `matchedKeys` are subsets of the index of both series+ (MkSeries _ xs) = left `selectSubset` matchedKeys+ (MkSeries _ ys) = right `selectSubset` matchedKeys+ ks = Index.toAscVector matchedKeys+ -- The following construction relies on the fact that keys are always sorted+ in MkSeries matchedKeys $ Vector.zipWith3 f ks xs ys+{-# INLINE zipWithKey #-}+++-- | Apply a function elementwise to three series, matching elements+-- based on their keys. Keys not present in all series are dropped.+-- +-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> let zs = Series.fromList [ ("alpha", 20::Int), ("beta", 7), ("delta", 5) ]+-- >>> zipWithKey3 (\k x y z -> length k + x + y + z) xs ys zs+-- index | values+-- ----- | ------+-- "alpha" | 35+-- "beta" | 23++zipWithKey3 :: (Vector v a, Vector v b, Vector v c, Vector v d, Vector v k, Ord k) + => (k -> a -> b -> c -> d) + -> Series v k a + -> Series v k b + -> Series v k c+ -> Series v k d+zipWithKey3 f left center right+ = let matchedKeys = index left `Index.intersection` index right+ -- Recall that `selectSubset` is a performance optimization+ -- and is generally unsafe to use; however, in this case, we know+ -- that `matchedKeys` are subsets of the index of all series+ (MkSeries _ xs) = left `selectSubset` matchedKeys+ (MkSeries _ ys) = center `selectSubset` matchedKeys+ (MkSeries _ zs) = right `selectSubset` matchedKeys+ ks = Index.toAscVector matchedKeys+ -- The following construction relies on the fact that keys are always sorted+ in MkSeries matchedKeys $ Vector.zipWith4 f ks xs ys zs+{-# INLINE zipWithKey3 #-}+++-- | Replace values from the right series with values from the left series at matching keys.+-- Keys in the right series but not in the right series are unaffected.+replace :: (Vector v a, Vector v Int, Ord k) + => Series v k a -> Series v k a -> Series v k a+{-# INLINE replace #-}+xs `replace` ys + = let keysToReplace = index xs `Index.intersection` index ys+ iixs = Index.toAscVector $ Index.Internal.mapMonotonic (\k -> Index.Internal.findIndex k (index ys)) keysToReplace+ in MkSeries (index ys) $ Vector.update_ (values ys) iixs (values (xs `selectSubset` keysToReplace))+++-- | Infix version of 'replace'+(|->) :: (Vector v a, Vector v Int, Ord k)+ => Series v k a -> Series v k a -> Series v k a+{-# INLINE (|->) #-}+(|->) = replace+++-- | Flipped version of '|->',+(<-|) :: (Vector v a, Vector v Int, Ord k) + => Series v k a -> Series v k a -> Series v k a+{-# INLINE (<-|) #-}+(<-|) = flip replace+++-- | A 'ZipStrategy' is a function which is used to decide what to do when a key is missing from one+-- of two 'Series' being zipped together with 'zipWithStrategy'.+--+-- If a 'ZipStrategy' returns 'Nothing', the key is dropped.+-- If a 'ZipStrategy' returns @'Just' v@ for key @k@, then the value @v@ is inserted at key @k@.+--+-- For example, the most basic 'ZipStrategy' is to skip over any key which is missing from the other series.+-- Such a strategy can be written as @skip key value = 'Nothing'@ (see 'skipStrategy').+type ZipStrategy k a b = (k -> a -> Maybe b)+++-- | This 'ZipStrategy' drops keys which are not present in both 'Series'.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> zipWithStrategy (+) skipStrategy skipStrategy xs ys+-- index | values+-- ----- | ------+-- "alpha" | 10+-- "beta" | 12+skipStrategy :: ZipStrategy k a b+skipStrategy _ _ = Nothing+{-# INLINE skipStrategy #-}+++-- | This 'ZipStrategy' sets the value at keys which are not present in both 'Series' +-- to the some mapping from the value present in one of the series. See the example below.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 5::Int), ("beta", 6), ("delta", 7) ]+-- >>> zipWithStrategy (+) (mapStrategy id) (mapStrategy (*10)) xs ys+-- index | values+-- ----- | ------+-- "alpha" | 5+-- "beta" | 7+-- "delta" | 70+-- "gamma" | 2+mapStrategy :: (a -> b) -> ZipStrategy k a b+mapStrategy f _ x = Just (f x)+{-# INLINE mapStrategy #-}+++-- | This 'ZipStrategy' sets a constant value at keys which are not present in both 'Series'.+--+-- >>> let xs = Series.fromList [ ("alpha", 0::Int), ("beta", 1), ("gamma", 2) ]+-- >>> let ys = Series.fromList [ ("alpha", 10::Int), ("beta", 11), ("delta", 13) ]+-- >>> zipWith (+) xs ys+-- index | values+-- ----- | ------+-- "alpha" | Just 10+-- "beta" | Just 12+-- "delta" | Nothing+-- "gamma" | Nothing+-- >>> zipWithStrategy (+) (constStrategy (-100)) (constStrategy 200) xs ys+-- index | values+-- ----- | ------+-- "alpha" | 10+-- "beta" | 12+-- "delta" | 200+-- "gamma" | -100+constStrategy :: b -> ZipStrategy k a b+constStrategy v = mapStrategy (const v)+{-# INLINE constStrategy #-}+++-- | Zip two 'Series' with a combining function, applying a 'ZipStrategy' when one key is present in one of the 'Series' but not both.+--+-- Note that if you want to drop keys missing in either 'Series', it is faster to use @'zipWithMatched' f@ +-- than using @'zipWithStrategy' f skipStrategy skipStrategy@.+zipWithStrategy :: (Vector v a, Vector v b, Vector v c, Ord k) + => (a -> b -> c) -- ^ Function to combine values when present in both series+ -> ZipStrategy k a c -- ^ Strategy for when the key is in the left series but not the right+ -> ZipStrategy k b c -- ^ Strategy for when the key is in the right series but not the left+ -> Series v k a+ -> Series v k b + -> Series v k c+zipWithStrategy f whenLeft whenRight left right + = let onlyLeftKeys = index left `Index.difference` index right+ onlyRightKeys = index right `Index.difference` index left+ -- Recall that `selectSubset` is a performance optimization+ -- and is generally unsafe to use; however, in this case, we know+ -- that `matchedKeys` are subsets of the index of both series+ leftZip = applyStrategy whenLeft $ left `selectSubset` onlyLeftKeys+ rightZip = applyStrategy whenRight $ right `selectSubset` onlyRightKeys+ + in zipWithMatched f left right <> leftZip <> rightZip+ where+ -- Application of the 'ZipStrategy' is done on a `Map` rather than+ -- the 'Series' directly to keep the type contraints of `zipWithStrategy` to+ -- a minimum. Recall that unboxed 'Series' cannot contain `Maybe a`. + applyStrategy strat = G.toSeries + . Map.mapMaybeWithKey strat+ . G.fromSeries+{-# INLINE zipWithStrategy #-}+++-- | Zip three 'Series' with a combining function, applying a 'ZipStrategy' when one key is +-- present in one of the 'Series' but not all of the others.+--+-- Note that if you want to drop keys missing in either 'Series', it is faster to use @'zipWithMatched3' f@ +-- than using @'zipWithStrategy3' f skipStrategy skipStrategy skipStrategy@.+zipWithStrategy3 :: (Vector v a, Vector v b, Vector v c, Vector v d, Ord k) + => (a -> b -> c -> d) -- ^ Function to combine values when present in all series+ -> ZipStrategy k a d -- ^ Strategy for when the key is in the left series but not in all the others+ -> ZipStrategy k b d -- ^ Strategy for when the key is in the center series but not in all the others+ -> ZipStrategy k c d -- ^ Strategy for when the key is in the right series but not in all the others+ -> Series v k a+ -> Series v k b + -> Series v k c+ -> Series v k d+zipWithStrategy3 f whenLeft whenCenter whenRight left center right + = let onlyLeftKeys = index left `Index.difference` (index center `Index.union` index right)+ onlyCenterKeys = index center `Index.difference` (index left `Index.union` index right)+ onlyRightKeys = index right `Index.difference` (index center `Index.union` index left)+ -- Recall that `selectSubset` is a performance optimization+ -- and is generally unsafe to use; however, in this case, we know+ -- that `matchedKeys` are subsets of the index of all series+ leftZip = applyStrategy whenLeft $ left `selectSubset` onlyLeftKeys+ centerZip = applyStrategy whenCenter $ center `selectSubset` onlyCenterKeys+ rightZip = applyStrategy whenRight $ right `selectSubset` onlyRightKeys+ + in zipWithMatched3 f left center right <> leftZip <> centerZip <> rightZip+ where+ -- Application of the 'ZipStrategy' is done on a `Map` rather than+ -- the 'Series' directly to keep the type contraints of `zipWithStrategy` to+ -- a minimum. Recall that unboxed 'Series' cannot contain `Maybe a`. + applyStrategy strat = G.toSeries + . Map.mapMaybeWithKey strat+ . G.fromSeries+{-# INLINE zipWithStrategy3 #-}+++-- | Zip two 'Series' with a combining function. The value for keys which are missing from+-- either 'Series' is replaced with the appropriate 'mempty' value.+--+-- >>> import Data.Monoid ( Sum(..) )+-- >>> let xs = Series.fromList [ ("2023-01-01", Sum (1::Int)), ("2023-01-02", Sum 2) ]+-- >>> let ys = Series.fromList [ ("2023-01-01", Sum (5::Int)), ("2023-01-03", Sum 7) ]+-- >>> zipWith (<>) xs ys+-- index | values+-- ----- | ------+-- "2023-01-01" | Just (Sum {getSum = 6})+-- "2023-01-02" | Nothing+-- "2023-01-03" | Nothing+-- >>> zipWithMonoid (<>) xs ys+-- index | values+-- ----- | ------+-- "2023-01-01" | Sum {getSum = 6}+-- "2023-01-02" | Sum {getSum = 2}+-- "2023-01-03" | Sum {getSum = 7}+zipWithMonoid :: ( Monoid a, Monoid b+ , Vector v a, Vector v b, Vector v c+ , Ord k+ ) + => (a -> b -> c)+ -> Series v k a+ -> Series v k b + -> Series v k c+zipWithMonoid f left right + = let fullindex = index left `Index.union` index right+ (MkSeries ix ls) = requireWith (const mempty) id left fullindex+ (MkSeries _ rs) = requireWith (const mempty) id right fullindex + in MkSeries ix $ Vector.zipWith f ls rs+{-# INLINE zipWithMonoid #-}+++-- | Elementwise sum of two 'Series'. Elements missing in one or the other 'Series' is considered 0. +--+-- >>> let xs = Series.fromList [ ("2023-01-01", (1::Int)), ("2023-01-02", 2) ]+-- >>> let ys = Series.fromList [ ("2023-01-01", (5::Int)), ("2023-01-03", 7) ]+-- >>> xs `esum` ys+-- index | values+-- ----- | ------+-- "2023-01-01" | 6+-- "2023-01-02" | 2+-- "2023-01-03" | 7+esum :: (Ord k, Num a, Vector v a, Vector v (Sum a)) + => Series v k a + -> Series v k a+ -> Series v k a+esum ls rs = G.map getSum $ zipWithMonoid (<>) (G.map Sum ls) (G.map Sum rs)+{-# INLINE esum #-}+++-- | Elementwise product of two 'Series'. Elements missing in one or the other 'Series' is considered 1. +--+-- >>> let xs = Series.fromList [ ("2023-01-01", (2::Int)), ("2023-01-02", 3) ]+-- >>> let ys = Series.fromList [ ("2023-01-01", (5::Int)), ("2023-01-03", 7) ]+-- >>> xs `eproduct` ys+-- index | values+-- ----- | ------+-- "2023-01-01" | 10+-- "2023-01-02" | 3+-- "2023-01-03" | 7+eproduct :: (Ord k, Num a, Vector v a, Vector v (Product a)) + => Series v k a + -> Series v k a+ -> Series v k a+eproduct ls rs = G.map getProduct $ zipWithMonoid (<>) (G.map Product ls) (G.map Product rs)+{-# INLINE eproduct #-}+++-- | \(O(n)\) Unzip a 'Series' of 2-tuples.+unzip :: (Vector v a, Vector v b, Vector v (a, b)) + => Series v k (a, b)+ -> ( Series v k a+ , Series v k b+ )+unzip (MkSeries ix vs) + = let (left, right) = Vector.unzip vs+ in (MkSeries ix left, MkSeries ix right)+{-# INLINE unzip #-}+++-- | \(O(n)\) Unzip a 'Series' of 3-tuples.+unzip3 :: (Vector v a, Vector v b, Vector v c, Vector v (a, b, c)) + => Series v k (a, b, c)+ -> ( Series v k a+ , Series v k b+ , Series v k c+ )+unzip3 (MkSeries ix vs) + = let (left, center, right) = Vector.unzip3 vs+ in (MkSeries ix left, MkSeries ix center, MkSeries ix right)+{-# INLINE unzip3 #-}
+ src/Data/Series/Index.hs view
@@ -0,0 +1,107 @@+-----------------------------------------------------------------------------+-- |+-- Module : $header+-- Copyright : (c) Laurent P. René de Cotret+-- License : MIT-style+-- Maintainer : Laurent P. René de Cotret+-- Portability : portable+--+-- This module contains the definition of 'Index', a sequence of /unique/ and /sorted/+-- keys which can be used to efficient index a 'Data.Series.Series'.+--+-- = Construction+--+-- Constructing an 'Index' can be done from the usual list using `fromList`. Note that +-- the 'Index' length could be smaller than the input list, due to the requirement that+-- an 'Index' be a sequence of unique keys. A better way to construct an 'Index' is +-- to use a 'Data.Set' (`fromSet`)+--+-- For quick inline definitions of an 'Index', you can also make use of the @OverloadedLists@ extension:+-- +-- >>> :set -XOverloadedLists+-- >>> let (ix :: Index Int) = [1,2,3,4,5,5,5]+-- >>> ix+-- Index [1,2,3,4,5] +--+-- Another useful function to construct an 'Index' is `range`. This allows to build an 'Index'+-- from a starting value up to an ending value, with a custom step function. For example,+-- here's an 'Index' with values from 1 to 10, in steps of 3:+--+-- >>> range (+3) (1 :: Int) 10+-- Index [1,4,7,10]+--+-- Note that `range` is a special case of the `unfoldr` function, which is also provided in this module.+--+-- = Set operations+-- +-- Just like a 'Data.Set', 'Index' supports efficient `member`, `notMember`, `union`, `intersection`, and `difference` operations.+-- Like 'Data.Set', the `Semigroup` and `Monoid` instance of 'Index' are defined using the `union` operation:+--+-- >>> fromList ['a', 'b', 'c'] <> fromList ['b', 'c', 'd']+-- Index "abcd"+--+-- = Mapping+--+-- Because of the restriction that all keys be unique, an 'Index' is not a true `Functor`; you can't use+-- `fmap` to map elements of an index. Instead, you can use the general-purpose function 'map'. If you want+-- to map elements of an 'Index' with a monotonic function (i.e. a function which will not re-order elements and won't+-- create duplicate elements), you can use the 'Data.Series.mapMonotonic' function which operates faster.+--+-- = Indexing+--+-- One of the key operations for 'Data.Series.Series' is to find the integer index of an element in an 'Index'. For this purpose, you+-- can use `lookupIndex`:+--+-- >>> lookupIndex 'b' $ fromList ['a', 'b', 'c']+-- Just 1+-- >>> lookupIndex 'd' $ fromList ['a', 'b', 'c']+-- Nothing++module Data.Series.Index (+ Index,++ -- * Creation and Conversion+ singleton,+ unfoldr,+ range,+ IsIndex(..),+ fromSet,+ fromList,+ fromVector,+ toSet,+ toAscList,+ toAscVector,++ -- * Set-like operations+ null,+ member,+ notMember,+ union,+ intersection,+ difference,+ symmetricDifference,+ contains,+ size,+ take,+ drop,++ -- * Mapping and filtering+ map,+ filter,+ traverse,+ + -- * Indexing+ lookupIndex,++ -- * Insertion and deletion+ insert,+ delete,+) where++import Data.Series.Index.Definition ( Index, IsIndex(..), singleton, unfoldr, range, fromSet, fromList, fromVector, toSet+ , toAscList, toAscVector, null, member, notMember, union, intersection+ , difference, symmetricDifference, contains, size, take, drop, map+ , filter, traverse, lookupIndex, insert, delete + )+import Prelude hiding ( null, take, drop, map, filter, traverse )+
+ src/Data/Series/Index/Definition.hs view
@@ -0,0 +1,503 @@+{-# LANGUAGE TypeFamilies #-}+{-# OPTIONS_GHC -Wno-redundant-constraints #-}++-----------------------------------------------------------------------------+-- |+-- Module : $header+-- Copyright : (c) Laurent P. René de Cotret+-- License : MIT-style+-- Maintainer : Laurent P. René de Cotret+-- Portability : portable+--+-- This module contains the definition of 'Index', a sequence of /unique/ and /sorted/+-- keys which can be used to efficient index a 'Series'.+++module Data.Series.Index.Definition (+ Index(..),++ -- * Creation and Conversion+ singleton,+ unfoldr,+ range,+ fromSet, toSet,+ fromList, toAscList,+ fromAscList, fromDistinctAscList,+ fromVector, toAscVector,+ fromAscVector, fromDistinctAscVector,+ -- ** Ad-hoc conversion with other data structures+ IsIndex(..),+ + -- * Set-like operations+ null,+ member,+ notMember,+ union,+ intersection,+ difference,+ symmetricDifference,+ cartesianProduct,+ contains,+ size,+ take,+ drop,++ -- * Mapping and filtering+ map,+ mapMonotonic,+ filter,+ traverse,+ + -- * Indexing+ findIndex,+ lookupIndex,+ elemAt,++ -- * Insertion and deletion+ insert,+ delete,+) where++import Control.DeepSeq ( NFData )+import Control.Monad ( guard )+import Control.Monad.ST ( runST )+import Data.Coerce ( coerce )+import qualified Data.Foldable as Foldable+import Data.Functor ( ($>) )+import Data.IntSet ( IntSet )+import qualified Data.IntSet as IntSet+import qualified Data.List as List+import Data.Sequence ( Seq )+import qualified Data.Sequence as Seq+import Data.Set ( Set )+import qualified Data.Set as Set+import qualified Data.Traversable as Traversable+import qualified Data.Vector as Boxed+import Data.Vector.Algorithms.Intro ( sortUniq )+import Data.Vector.Generic ( Vector )+import qualified Data.Vector.Generic as Vector+import qualified Data.Vector.Generic.Mutable as M+import qualified Data.Vector.Unboxed as Unboxed+import GHC.Exts ( IsList )+import qualified GHC.Exts as Exts+import GHC.Stack ( HasCallStack )+import Prelude as P hiding ( null, take, drop, map, filter, traverse, product )++-- $setup+-- >>> import Data.Series.Index+-- >>> import qualified Data.Vector as Vector+++-- | Representation of the index of a series.+-- An index is a sequence of sorted elements. All elements are unique, much like a 'Set'.+--+-- You can construct an 'Index' from a set ('fromSet'), from a list ('fromList'), or from a vector ('fromVector'). You can +-- also make use of the @OverloadedLists@ extension:+--+-- >>> :set -XOverloadedLists+-- >>> let (ix :: Index Int) = [1, 2, 3]+-- >>> ix+-- Index [1,2,3]+--+-- Since keys in an 'Index' are always sorted and unique, 'Index' is not a 'Functor'. To map a function+-- over an 'Index', use 'map'.+newtype Index k = MkIndex (Set k)+ deriving (Eq, Ord, Semigroup, Monoid, Foldable, NFData)+++instance Ord k => IsList (Index k) where+ type Item (Index k) = k+ fromList :: [k] -> Index k+ fromList = fromList+ toList :: Index k -> [Exts.Item (Index k)]+ toList = toAscList+++instance Show k => Show (Index k) where+ show :: Index k -> String+ show (MkIndex s) = "Index " ++ show (Set.toList s)+++-- | \(O(1)\) Create a singleton 'Index'.+singleton :: k -> Index k+singleton = MkIndex . Set.singleton+{-# INLINE singleton #-}+++-- | \(O(n \log n)\) Create an 'Index' from a seed value. +-- Note that the order in which elements are generated does not matter; elements are stored+-- in order. See the example below.+--+-- >>> unfoldr (\x -> if x < 1 then Nothing else Just (x, x-1)) (7 :: Int)+-- Index [1,2,3,4,5,6,7]+unfoldr :: Ord a => (b -> Maybe (a, b)) -> b -> Index a+unfoldr f = fromList . List.unfoldr f+{-# INLINE unfoldr #-}+++-- | \(O(n \log n)\) Create an 'Index' as a range of values. @range f start end@ will generate +-- an 'Index' with values @[start, f start, f (f start), ... ]@ such that the largest element+-- less or equal to @end@ is included. See examples below.+--+-- >>> range (+3) (1 :: Int) 10+-- Index [1,4,7,10]+-- >>> range (+3) (1 :: Int) 11+-- Index [1,4,7,10]+range :: Ord a + => (a -> a) -- ^ Function to generate the next element in the index+ -> a -- ^ Starting value of the 'Index'+ -> a -- ^ Ending value of the 'Index', which may or may not be contained+ -> Index a+range next start end + = unfoldr (\x -> guard (x <= end) $> (x, next x)) start+{-# INLINE range #-}+++-- | The 'IsIndex' typeclass allow for ad-hoc definition+-- of conversion functions, converting to / from 'Index'.+class IsIndex t k where+ -- | Construct an 'Index' from some container of keys. There is no+ -- condition on the order of keys. Duplicate keys are silently dropped.+ toIndex :: t -> Index k++ -- | Construct a container from keys of an 'Index'. + -- The elements are returned in ascending order of keys.+ fromIndex :: Index k -> t+++instance IsIndex (Set k) k where+ -- | \(O(1)\) Build an 'Index' from a 'Set'.+ toIndex :: Set k -> Index k+ toIndex = coerce+ {-# INLINE toIndex #-}++ -- | \(O(1)\) Build an 'Index' from a 'Set'.+ fromIndex :: Index k -> Set k+ fromIndex = coerce+ {-# INLINE fromIndex #-}+++instance Ord k => IsIndex [k] k where+ -- | \(O(n \log n)\) Build an 'Index' from a list.+ toIndex :: [k] -> Index k+ toIndex = fromList+ {-# INLINE toIndex #-}++ -- | \(O(n)\) Convert an 'Index' to a list.+ fromIndex :: Index k -> [k]+ fromIndex = toAscList+ {-# INLINE fromIndex #-}+++instance Ord k => IsIndex (Seq k) k where+ -- | \(O(n \log n)\) Build an 'Index' from a 'Seq'.+ toIndex :: Seq k -> Index k+ toIndex = fromList . Foldable.toList+ {-# INLINE toIndex #-}++ -- | \(O(n)\) Convert an 'Index' to a 'Seq'.+ fromIndex :: Index k -> Seq k+ fromIndex = Seq.fromList . toAscList+ {-# INLINE fromIndex #-}+++instance IsIndex IntSet Int where+ -- | \(O(n \min(n,W))\), where \W\ is the number of bits in an 'Int' on your platform (32 or 64).+ toIndex :: IntSet -> Index Int+ toIndex = fromDistinctAscList . IntSet.toList+ {-# INLINE toIndex #-}+ + -- | \(O(n)\) Convert an 'Index' to an 'IntSet.+ fromIndex :: Index Int -> IntSet+ fromIndex = IntSet.fromDistinctAscList . toAscList+ {-# INLINE fromIndex #-}+++instance (Ord k) => IsIndex (Boxed.Vector k) k where+ toIndex :: Boxed.Vector k -> Index k+ toIndex = fromVector+ {-# INLINE toIndex #-} ++ fromIndex :: Index k -> Boxed.Vector k+ fromIndex = toAscVector+ {-# INLINE fromIndex #-}+++instance (Ord k, Unboxed.Unbox k) => IsIndex (Unboxed.Vector k) k where+ toIndex :: Unboxed.Vector k -> Index k+ toIndex = fromVector+ {-# INLINE toIndex #-} ++ fromIndex :: Index k -> Unboxed.Vector k+ fromIndex ix = runST $ M.generate (size ix) (`elemAt` ix) >>= Vector.freeze+ {-# INLINE fromIndex #-}+++-- | \(O(1)\) Build an 'Index' from a 'Set'.+fromSet :: Set k -> Index k+fromSet = toIndex+{-# INLINE fromSet #-}+++-- | \(O(n \log n)\) Build an 'Index' from a list. Note that since an 'Index' is+-- composed of unique elements, the length of the index may not be+-- the same as the length of the input list:+--+-- >>> fromList ['c', 'a', 'b', 'b']+-- Index "abc"+--+-- If the list is already sorted, `fromAscList` is generally faster.+fromList :: Ord k => [k] -> Index k+fromList = fromSet . Set.fromList+{-# INLINE fromList #-}+++-- | \(O(n)\) Build an 'Index' from a list of elements in ascending order. The precondition+-- that elements already be sorted is not checked.+-- +-- Note that since an 'Index' is composed of unique elements, the length of +-- the index may not be the same as the length of the input list.+fromAscList :: Eq k => [k] -> Index k+fromAscList = toIndex . Set.fromAscList+{-# INLINE fromAscList #-}+++-- | \(O(n)\) Build an 'Index' from a list of distinct elements in ascending order. The precondition+-- that elements be unique and sorted is not checked.+fromDistinctAscList :: [k] -> Index k+fromDistinctAscList = MkIndex . Set.fromDistinctAscList+{-# INLINE fromDistinctAscList #-}+++-- | \(O(n \log n)\) Build an 'Index' from a 'Vector'. Note that since an 'Index' is+-- composed of unique elements, the length of the index may not be+-- the same as the length of the input vector:+--+-- >>> import Data.Vector as V+-- >>> fromVector $ V.fromList ['c', 'a', 'b', 'b']+-- Index "abc"+--+-- If the 'Vector' is already sorted, 'fromAscVector' is generally faster.+fromVector :: (Vector v k, Ord k) => v k -> Index k+fromVector vs = fromDistinctAscVector $ runST $ Vector.thaw vs >>= sortUniq >>= Vector.freeze+{-# INLINE fromVector #-}+++-- | \(O(n \log n)\) Build an 'Index' from a 'Vector' of elements in ascending order. The precondition+-- that elements already be sorted is not checked. +--+-- Note that since an 'Index' is composed of unique elements, +-- the length of the index may not be the same as the length of the input vector:+--+-- >>> import Data.Vector as V+-- >>> fromAscVector $ V.fromList ['a', 'b', 'b', 'c']+-- Index "abc"+fromAscVector :: (Vector v k, Ord k) => v k -> Index k+fromAscVector = fromAscList . Vector.toList+{-# INLINE fromAscVector #-}+++-- | \(O(n)\) Build an 'Index' from a 'Vector' of unique elements in ascending order. The precondition+-- that elements already be unique and sorted is not checked.+fromDistinctAscVector :: Vector v k => v k -> Index k+fromDistinctAscVector = fromDistinctAscList . Vector.toList+{-# INLINE fromDistinctAscVector #-}+++-- | \(O(1)\) Convert an 'Index' to a 'Set'.+toSet :: Index k -> Set k+toSet = fromIndex+{-# INLINE toSet #-}+++-- | \(O(n)\) Convert an 'Index' to a list. Elements will be produced in ascending order.+toAscList :: Index k -> [k]+toAscList (MkIndex s) = Set.toAscList s+{-# INLINE toAscList #-}+++-- | \(O(n)\) Convert an 'Index' to a list. Elements will be produced in ascending order.+toAscVector :: Vector v k => Index k -> v k+toAscVector ix = runST $ M.generate (size ix) (`elemAt` ix) >>= Vector.freeze+{-# INLINE toAscVector #-}+++-- | \(O(1)\) Returns 'True' for an empty 'Index', and @False@ otherwise.+null :: Index k -> Bool+null (MkIndex ix) = Set.null ix+{-# INLINE null #-}+++-- | \(O(n \log n)\) Check whether the element is in the index.+member :: Ord k => k -> Index k -> Bool+member k (MkIndex ix) = k `Set.member` ix+{-# INLINE member #-}+++-- | \(O(n \log n)\) Check whether the element is NOT in the index.+notMember :: Ord k => k -> Index k -> Bool+notMember k = not . member k+{-# INLINE notMember #-}+++-- | \(O\bigl(m \log\bigl(\frac{n+1}{m+1}\bigr)\bigr), \; m \leq n\) Union of two 'Index', containing+-- elements either in the left index, right right index, or both.+union :: Ord k => Index k -> Index k -> Index k+union = (<>)+{-# INLINE union #-}+++-- | \(O\bigl(m \log\bigl(\frac{n+1}{m+1}\bigr)\bigr), \; m \leq n\) Intersection of two 'Index', containing+-- elements which are in both the left index and the right index.+intersection :: Ord k => Index k -> Index k -> Index k+intersection (MkIndex ix) (MkIndex jx) = MkIndex $ ix `Set.intersection` jx+{-# INLINE intersection #-}+++-- | \(O\bigl(m \log\bigl(\frac{n+1}{m+1}\bigr)\bigr), \; m \leq n\) Returns the elements of the first index +-- which are not found in the second index.+--+-- >>> difference (fromList ['a', 'b', 'c']) (fromList ['b', 'c', 'd'])+-- Index "a"+difference :: Ord k => Index k -> Index k -> Index k+difference (MkIndex ix) (MkIndex jx) = MkIndex $ Set.difference ix jx+{-# INLINE difference #-}+++-- | \(O(n+m)\). The symmetric difference of two 'Index'.+-- The first element of the tuple is an 'Index' containing all elements which+-- are only found in the left 'Index', while the second element of the tuple is an 'Index' containing+-- all elements which are only found in the right 'Index':+--+-- >>> left = fromList ['a', 'b', 'c']+-- >>> right = fromList ['c', 'd', 'e']+-- >>> left `symmetricDifference` right+-- (Index "ab",Index "de")+symmetricDifference :: Ord k => Index k -> Index k -> (Index k, Index k)+symmetricDifference left right = (left `difference` right, right `difference` left)+{-# INLINE symmetricDifference #-}+++-- | \(O(n m)\) Take the cartesian product of two 'Index':+--+-- >>> (range (+1) (1 :: Int) 2) `cartesianProduct` (range (+1) (3 :: Int) 4)+-- Index [(1,3),(1,4),(2,3),(2,4)]+cartesianProduct :: Index k -> Index g -> Index (k, g)+cartesianProduct (MkIndex xs) (MkIndex ys) + = MkIndex $ Set.cartesianProduct xs ys+{-# INLINE cartesianProduct #-}+++-- | \(O\bigl(m \log\bigl(\frac{n+1}{m+1}\bigr)\bigr), \; m \leq n\).+-- @(ix1 \'contains\' ix2)@ indicates whether all keys in @ix2@ are also in @ix1@.+contains :: Ord k => Index k -> Index k -> Bool+contains (MkIndex ix1) (MkIndex ix2)= ix2 `Set.isSubsetOf` ix1+{-# INLINE contains #-}+++-- | \(O(1)\) Returns the number of keys in the index.+size :: Index k -> Int+size (MkIndex ix) = Set.size ix+{-# INLINE size #-}+++-- | \(O(\log n)\). Take @n@ elements from the index, in ascending order.+-- Taking more than the number of elements in the index is a no-op:+--+-- >>> take 10 $ fromList [1::Int,2,3]+-- Index [1,2,3]+take :: Int -> Index k -> Index k+take n (MkIndex ix) = MkIndex (Set.take n ix)+{-# INLINE take #-}+++-- | \(O(\log n)\). Drop @n@ elements from the index, in ascending order.+drop :: Int -> Index k -> Index k+drop n (MkIndex ix) = MkIndex (Set.drop n ix)+{-# INLINE drop #-}+++-- | \(O(n \log n)\) Map a function over keys in the index.+-- Note that since keys in an 'Index' are unique, the length of the resulting+-- index may not be the same as the input:+--+-- >>> map (\x -> if even x then 0::Int else 1) $ fromList [0::Int,1,2,3,4]+-- Index [0,1]+--+-- If the mapping is monotonic, see 'mapMonotonic', which has better performance+-- characteristics.+map :: Ord g => (k -> g) -> Index k -> Index g+map f (MkIndex ix) = MkIndex $ Set.map f ix+{-# INLINE map #-}+++-- | \(O(n)\) Map a monotonic function over keys in the index. /Monotonic/ means that if @a < b@, then @f a < f b@.+-- Using 'mapMonononic' can be much faster than using 'map' for a large 'Index'.+-- Note that the precondiction that the function be monotonic is not checked.+--+-- >>> mapMonotonic (+1) $ fromList [0::Int,1,2,3,4,5]+-- Index [1,2,3,4,5,6]+mapMonotonic :: (k -> g) -> Index k -> Index g+mapMonotonic f (MkIndex ix) = MkIndex $ Set.mapMonotonic f ix+{-# INLINE mapMonotonic #-}+++-- | \(O(n)\) Filter elements satisfying a predicate.+--+-- >>> filter even $ fromList [1::Int,2,3,4,5]+-- Index [2,4]+filter :: (k -> Bool) -> Index k -> Index k+filter p (MkIndex ix) = MkIndex $ Set.filter p ix+{-# INLINE filter #-}+++-- | \(O(\log n)\). Returns the integer /index/ of a key. This function raises an exception+-- if the key is not in the 'Index'; see 'lookupIndex' for a safe version.+--+-- >>> findIndex 'b' $ fromList ['a', 'b', 'c']+-- 1+findIndex :: HasCallStack => Ord k => k -> Index k -> Int+findIndex e (MkIndex ix) = Set.findIndex e ix +{-# INLINE findIndex #-}+++-- | \(O(\log n)\). Returns the integer /index/ of a key, if the key is in the index.+--+-- >>> lookupIndex 'b' $ fromList ['a', 'b', 'c']+-- Just 1+-- >>> lookupIndex 'd' $ fromList ['a', 'b', 'c']+-- Nothing+lookupIndex :: Ord k => k -> Index k -> Maybe Int+lookupIndex e (MkIndex ix) = Set.lookupIndex e ix+{-# INLINE lookupIndex #-}+++-- | \(O(\log n)\) Returns the element at some integer index. This function raises+-- an exception if the integer index is out-of-bounds.+elemAt :: HasCallStack => Int -> Index k -> k+elemAt n (MkIndex ix) = Set.elemAt n ix+{-# INLINE elemAt #-}+++-- | \(O(\log n)\). Insert a key in an 'Index'. If the key is already +-- present, the 'Index' will not change.+insert :: Ord k => k -> Index k -> Index k+insert k (MkIndex ix) = MkIndex $ k `Set.insert` ix+{-# INLINE insert #-}+++-- | \(O(\log n)\). Delete a key from an 'Index', if this key is present+-- in the index.+delete :: Ord k => k -> Index k -> Index k+delete k (MkIndex ix) = MkIndex $ k `Set.delete` ix+{-# INLINE delete #-}+++-- | \(O(n \log n)\). Map each element of an 'Index' to an applicative action, +-- evaluate these actions from left to right, and collect the results.+--+-- Note that the data type 'Index' is not a member of 'Traversable'+-- because it is not a 'Functor'.+traverse :: (Applicative f, Ord b) => (k -> f b) -> Index k -> f (Index b)+traverse f = fmap fromList . Traversable.traverse f . toAscList+{-# INLINE traverse #-}
+ src/Data/Series/Index/Internal.hs view
@@ -0,0 +1,39 @@+{-# LANGUAGE TypeFamilies #-}++-----------------------------------------------------------------------------+-- |+-- Module : Data.Series.Generic.Internal+-- Copyright : (c) Laurent P. René de Cotret+-- License : MIT+-- Maintainer : laurent.decotret@outlook.com+-- Portability : portable+--+-- = WARNING+--+-- This module is considered __internal__. It contains functions+-- which may be unsafe to use in general, for example requiring +-- the data to be pre-sorted like 'fromDistinctAscList'.+--+-- The Package Versioning Policy still applies.++module Data.Series.Index.Internal(+ Index(..),++ -- * Unsafe construction+ fromAscList,+ fromDistinctAscList,+ fromAscVector,+ fromDistinctAscVector,++ -- * Functions with unchecked pre-conditions+ mapMonotonic,++ -- * Unsafe indexing+ elemAt,+ findIndex,++) where++import Data.Series.Index.Definition ( Index(..), fromAscList, fromDistinctAscList, fromAscVector+ , fromDistinctAscVector, mapMonotonic, elemAt, findIndex+ )
+ src/Data/Series/Tutorial.hs view
@@ -0,0 +1,770 @@+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++module Data.Series.Tutorial (+ -- * Introduction+ -- $introduction++ -- * Construction+ -- $construction++ -- * Index+ -- $index++ -- * Selections+ -- ** Single-key selection+ -- $singlekey++ -- ** Bulk selections+ -- $multikey++ -- * Filtering and mapping+ -- $filteringandmapping++ -- * Folding+ -- $folding++ -- * Grouping+ -- $grouping++ -- * Window aggregation+ -- $windowing++ -- * Combining 'Series' together+ -- $zipping++ -- * Conclusion+ -- $conclusion and further reading+ + -- * Advanced topics+ -- ** Handling duplicate keys+ -- $duplicates++ -- ** Unboxed and generic series+ -- $unboxed++ -- ** Replacing values+ -- $replacement++ -- ** Comparison with other data structures+ -- $comparison++) where++import Control.Foldl ( Fold )+import Data.Series ( IsSeries(..), Series, Occurrence, at, iat, select, to, from, upto, require+ , groupBy, aggregateWith, (<-|), (|->), Range, windowing+ )+import qualified Data.Series as Series+import qualified Data.Series.Generic+import Data.Series.Index ( Index )+import qualified Data.Series.Index as Index+import qualified Data.Series.Unboxed+import Data.Set ( Set )+import qualified Data.Set+import Data.Map.Strict ( Map )+import qualified Data.Map.Strict+import qualified Data.Map.Merge.Strict+import Numeric.Natural ( Natural)+import qualified Data.List+import qualified Data.Vector+import qualified Data.Vector.Unboxed++{- $introduction++This is a short user guide on how to get started using @javelin@ and its various modules.++The central data structure at the heart of this package is the 'Series'. A @'Series' k a@ +is a labeled array of type @v@ filled with values of type @a@, indexed by keys of type @k@.++Like 'Data.Map.Strict.Map', 'Series' support efficient:++* random access by key ( \(O(\log n)\) );+* slice by key ( \(O(\log n)\) ).++Like 'Data.Vector.Vector', 'Series' support efficient:++* numerical operations.+* random access by index ( \(O(1)\) );+* slice by index ( \(O(1)\) ); ++To follow along this tutorial, the following imports are expected:++>>> import Data.Series as Series+-}++{- $construction ++The easiest way to create a 'Series' is to do it from a list using 'Data.Series.fromList':++>>> Series.fromList [ ('a', 1::Int), ('b', 2), ('c', 3), ('d', 4) ]+index | values+----- | ------+ 'a' | 1+ 'b' | 2+ 'c' | 3+ 'd' | 4++Note what happens when we have the same key (@\'a\'@) attached to multiple values:++>>> Series.fromList [ ('a', 1::Int), ('a', 0), ('b', 2), ('c', 3), ('d', 4) ]+index | values+----- | ------+ 'a' | 0+ 'b' | 2+ 'c' | 3+ 'd' | 4++'Series', like 'Map's, have unique keys; therefore, the output series may +not be the same length as the input series. See further below for an +explanation of how to handle duplicate keys. ++Since 'Series' are like 'Map', it's easy to convert between the two:++>>> let mp = Data.Map.Strict.fromList [ ('a', 0::Int), ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]+>>> mp+fromList [('a',1),('b',2),('c',3),('d',4)]+>>> Series.fromStrictMap mp+index | values+----- | ------+ 'a' | 1+ 'b' | 2+ 'c' | 3+ 'd' | 4++Of course, 'Series.fromLazyMap' is also available. In fact, conversion to/from 'Series' is supported for+many types; see the 'IsSeries' typeclass and its methods, 'toSeries' and 'fromSeries'.++-}++{- $index++'Series' have two components: values and an index.++The index (of type @'Index' k@) is an ordered set of unique elements which allows to determine +where are each values in the series. Since all keys in an 'Index' are unique and sorted, it+is fast to find the value associated to any random key.++As we'll see soon, 'Index' is an important data structure which can be used to slice through a 'Series', +so let's get comfortable with them.++>>> import qualified Data.Series.Index as Index++An 'Index' can be constructed from a list:++>>> Index.fromList [5::Int,5,4,3,2,1,5,5,5]+Index [1,2,3,4,5]++As you see above, repeated elements (in this case, @5@) won't be repeated in the 'Index'. Therefore, it often makes +more sense to construct an 'Index' using 'Index.fromSet' from a 'Set' from "Data.Set".++One common way to construct an 'Index' is to programmatically __unfold__ a seed value using +'Index.unfoldr'. Below, we want to generate numbers from 7 down to 1:++>>> Index.unfoldr (\x -> if x < 1 then Nothing else Just (x, x-1)) (7 :: Int)+Index [1,2,3,4,5,6,7]++This task is so common that there is a convenience function to create ranges, 'Index.range'. +For example, if you want to create an 'Index' of values starting at 1 and ending at 10, in +steps of 3:++>>> Index.range (+3) (1 :: Int) 10+Index [1,4,7,10]++An 'Index' is very much like a 'Set', so you can ++* check for membership using 'Index.member';+* combine two 'Index' using 'Index.union', 'Index.intersection', and 'Index.difference';+* find the integer index of a key using 'Index.lookupIndex';++and more.++-}++{- $singlekey ++Single-element selections are performed using 'at', which selects a single element by key. 'at' is safe;+if the key is missing, 'Nothing' is returned:++>>> let xs = Series.fromList [ ('a', 1::Int), ('b', 2), ('c', 3), ('d', 4) ]+>>> xs+index | values+----- | ------+ 'a' | 1+ 'b' | 2+ 'c' | 3+ 'd' | 4+>>> xs `at` 'a'+Just 1+>>> xs `at` 'z'+Nothing++-}++{- $multikey ++Bulk selection, also known as *slicing*, is the method by which we extract a sub-series from a series.+In the examples below, we'll assume that we have the series @aapl_close@ is available in-scope, which represents+the closing price of Apple stock:++>>> :{+let aapl_close = Series.fromList [ ("2010-01-04", 6.5522 :: Double)+ , ("2010-01-05", 6.5636)+ , ("2010-01-06", 6.4592)+ , ("2010-01-07", 6.4472)+ , ("2010-01-08", 6.4901)+ -- No prices during the weekend+ , ("2010-01-11", 6.5152)+ , ("2010-01-12", 6.4047)+ , ("2010-01-13", 6.3642)+ , ("2010-01-14", 6.4328)+ , ("2010-01-15", 6.4579)+ ]+ :}++Bulk selection is done via the 'select' function. 'select' works with many types of inputs. +For example, we can query for a contiguous range of keys by using 'to':++>>> aapl_close `select` "2010-01-04" `to` "2010-01-08"+ index | values+ ----- | ------+"2010-01-04" | 6.5522+"2010-01-05" | 6.5636+"2010-01-06" | 6.4592+"2010-01-07" | 6.4472+"2010-01-08" | 6.4901++You can also request unbounded ranges. For example all dates up to @"2010-01-08"@ using 'upto':++>>> aapl_close `select` upto "2010-01-08"+ index | values+ ----- | ------+"2010-01-04" | 6.5522+"2010-01-05" | 6.5636+"2010-01-06" | 6.4592+"2010-01-07" | 6.4472+"2010-01-08" | 6.4901++There's also the other unbound range, 'from':++>>> aapl_close `select` from "2010-01-11"+ index | values+ ----- | ------+"2010-01-11" | 6.5152+"2010-01-12" | 6.4047+"2010-01-13" | 6.3642+"2010-01-14" | 6.4328+"2010-01-15" | 6.4579++Note that the bounds may contain less data than you think! For example, +let's look at a 5-day range:++>>> aapl_close `select` "2010-01-08" `to` "2010-01-12"+ index | values+ ----- | ------+"2010-01-08" | 6.4901+"2010-01-11" | 6.5152+"2010-01-12" | 6.4047++We've requested a range of 5 days (@"2010-01-08"@, @"2010-01-09"@, @"2010-01-10"@, @"2010-01-11"@, @"2010-01-12"@), +but there's no data in our series with the keys @"2010-01-09"@ and @"2010-01-10"@, because it was the week-end +(stock markets are usually closed on week-ends). ++Sometimes you want to be more specific than a contiguous range of data; 'select' +also supports bulk *random* access like so:++>>> aapl_close `select` ["2010-01-08", "2010-01-10", "2010-01-12"]+ index | values+ ----- | ------+"2010-01-08" | 6.4901+"2010-01-12" | 6.4047++Note above that we've requested data for the date @"2010-01-10"@, but it's missing. Therefore, +the data isn't returned. If you want to get a sub-series which has the exact index that +you've asked for, you can use 'require' in combination with an 'Index':++>>> import qualified Data.Series.Index as Index+>>> aapl_close `require` Index.fromList ["2010-01-08", "2010-01-10", "2010-01-12"]+ index | values+ ----- | ------+"2010-01-08" | Just 6.4901+"2010-01-10" | Nothing+"2010-01-12" | Just 6.4047++Using 'require' or 'select' in conjunction with 'Index.range' is very powerful.++-}++{- $filteringandmapping ++'Series' support operations on both their index and their values. To illustrate +this, let's load some latitude and longitude data for some cities.++We'll assume that the following types are in scope:++>>> import Data.Fixed (Centi)+>>> data Position = Pos { latitude :: Centi, longitude :: Centi } deriving (Show)+>>> :{+ let cities = Series.fromList [ ("Paris"::String , Pos 48.86 2.35)+ , ("New York City" , Pos 40.71 (-74.01))+ , ("Taipei" , Pos 25.04 121.56)+ , ("Buenos Aires" , Pos (-34.60) (-58.38)) + ]+ :}++We can easily filter for data just like you would filter a list. +In this example, let's find cities in the western hemisphere (i.e. cities +which have negative longitudes), using 'Series.filter':++>>> Series.filter (\pos -> longitude pos < 0) cities+ index | values+ ----- | ------+ "Buenos Aires" | Pos {latitude = -34.60, longitude = -58.38}+"New York City" | Pos {latitude = 40.71, longitude = -74.01}++We can transform the values of a 'Series' using 'Series.map'. In this example, +let's isolate the latitude of cities in the western hemisphere:++>>> let western_cities = Series.filter (\pos -> longitude pos < 0) cities+>>> Series.map latitude western_cities+ index | values+ ----- | ------+ "Buenos Aires" | -34.60+"New York City" | 40.71++Finally, we can summarize the 'Series' by reducing all its values. +Let's average the latitude of cities in the western hemisphere:++>>> import Data.Series ( mean )+>>> let latitudes = Series.map latitude western_cities+>>> Series.fold mean latitudes+3.05++The next section introduces 'Series.fold' more generally.+-}++{- $folding++Folding refers to the action of aggregating values in a 'Series' to a single value.+Folding 'Series' is done through the 'Series.fold' function. Its type signature is:++>>> :t Series.fold+Series.fold :: Fold a b -> Series k a -> b++Here, @'Fold' a b@ represents a calculation which takes in values of type @a@, and will ultimately produce a+final value of type b. Such calculations are provided by the @foldl@ package (see 'Control.Foldl'), although+some of its functions are re-exported by "Data.Series" (and "Data.Series.Unboxed"), such as 'Data.Series.mean'.++Let's look at an example. First, we'll need some data. We'll use end-of-day stock prices for Apple Inc:++>>> import Data.Fixed ( Centi )+>>> (aapl_closing :: Series String Double) <- (Series.fromList . read) <$> readFile "files/aapl.txt"+>>> aapl_closing + index | values+ ----- | ------+"1980-12-12" | 0.1007+"1980-12-15" | 9.54e-2+"1980-12-16" | 8.84e-2+ ... | ...+"2022-01-05" | 174.92+"2022-01-06" | 172.0+"2022-01-07" | 172.17++Normally we would use an appropriate datetime type for the index of @aapl_closing@, +for example from the @time@ package, but we're keeping it simple for this tutorial. ++Prices have changed a lot over the years, so we'll restrict ourselves to 2021:++>>> let aapl_closing_2021 = aapl_closing `select` "2021-01-01" `to` "2021-12-31"+>>> aapl_closing_2021+ index | values+ ----- | ------+"2021-01-04" | 128.6174+"2021-01-05" | 130.2076+"2021-01-06" | 125.8246+ ... | ...+"2021-12-29" | 179.38+"2021-12-30" | 178.2+"2021-12-31" | 177.57++To calculate the average closing price over the year 2021, we use 'Data.Series.fold' in conjunction with+'Data.Series.mean':++>>> Series.fold Series.mean aapl_closing_2021+140.61256349206354++One of the magic things about 'Fold' is that it's possible to combine them in such a way that you can +traverse a 'Series' only once, which is important for good performance. As an example, we'll calculate+both the mean closing price AND the standard deviation of closing prices.++>>> let meanAndStdDev = (,) <$> Data.Series.mean <*> Data.Series.std+>>> Series.fold meanAndStdDev aapl_closing_2021+(140.61256349206354,14.811663837435361)++See 'Control.Foldl' from the @foldl@ package for more information on 'Fold'.+-}++{- $grouping++One important feature of 'Series' is the ability to efficiently group values +together based on their keys.++Let's load some stock price data again for this part:++>>> import Data.Fixed ( Centi )+>>> (aapl_closing :: Series String Double) <- (Series.fromList . read) <$> readFile "files/aapl.txt"+>>> aapl_closing + index | values+ ----- | ------+"1980-12-12" | 0.1007+"1980-12-15" | 9.54e-2+"1980-12-16" | 8.84e-2+ ... | ...+"2022-01-05" | 174.92+"2022-01-06" | 172.0+"2022-01-07" | 172.17++Grouping involves two steps:++ (1) Grouping keys in some way using 'groupBy';+ (2) Aggregating the values in each group using 'aggregateWith' or other variants.++Let's find the highest closing price of each month. First, we need to define+our grouping function:++>>> :{ + -- | Extract the year and month from a date like XXXX-YY-ZZ. For example:+ -- + -- >>> month "2023-01-01"+ -- "2023-01"+ month :: String -> String+ month = take 7+ :}++Then, we can group keys by month and take the 'maximum' of each group:++>>> aapl_closing `groupBy` month `aggregateWith` maximum+ index | values+ ----- | ------+"1980-12" | 0.1261+"1981-01" | 0.1208+"1981-02" | 0.1007+ ... | ...+"2021-11" | 165.3+"2021-12" | 180.33+"2022-01" | 182.01++This means, for example, that the maximum closing price for Apple stock in the +month of November 2021 was $165.30 per share. This library also contains +numerical aggregation functions such as 'Data.Series.mean' and 'Data.Series.std'. Therefore, in order +to find the monthly average Apple closing price, rounded to the nearest cent:++>>> import Data.Series (mean)+>>> let (roundToCent :: Double -> Double) = \x -> fromIntegral ((round $ x * 100) :: Int) / 100+>>> aapl_closing `groupBy` month `aggregateWith` (roundToCent . Series.fold mean)+ index | values+ ----- | ------+"1980-12" | 0.11+"1981-01" | 0.11+"1981-02" | 9.0e-2+ ... | ...+"2021-11" | 154.21+"2021-12" | 173.55+"2022-01" | 176.16++-}++{- $windowing++Windowing aggregation refers to the practice of aggregating values in a window around every key.++General-purpose windowing is done using the 'windowing' function. Let's look at its+type signature:++>>> :t windowing+windowing+ :: Ord k =>+ (k -> Range k) -> (Series k a -> b) -> Series k a -> Series k b++Here, @`windowing` window aggfunc xs@ is a new series @'Series' k b@ where+for every key @k@, the values in the range @window k@ are aggregated by @aggfunc@+and placed in the resulting series at key @k@. Here's an example where+for every key @k@, we add the values at @k@ and @k+1@:++>>> :{ +let (xs :: Series Int Int) + = Series.fromList [ (1, 0)+ , (2, 1)+ , (3, 2)+ , (4, 3)+ , (5, 4)+ , (6, 5)+ ]+in windowing (\k -> k `to` (k + 1)) sum xs+:}+index | values+----- | ------+ 1 | 1+ 2 | 3+ 3 | 5+ 4 | 7+ 5 | 9+ 6 | 5++'windowing' can be used to compute so-called rolling aggregations. An example of+this is to compute the rolling mean of the last 3 keys:++>>> import Data.Series ( mean )+>>> :{ +let rollingMean = windowing (\k -> (k-3) `to` k) (Series.fold mean)+ (xs :: Series Int Double) + = Series.fromList [ (1, 0)+ , (2, 1)+ , (3, 2)+ , (4, 3)+ , (5, 4)+ , (6, 5)+ ]+ in (rollingMean xs) :: Series Int Double+:}+index | values+----- | ------+ 1 | 0.0+ 2 | 0.5+ 3 | 1.0+ 4 | 1.5+ 5 | 2.5+ 6 | 3.5++-}++{- $zipping ++An important class of operations are combining two 'Series' together, also known as *zipping*. +For lists, Haskell has 'Data.List.zipWith'. 'Series' also have 'Series.zipWith' and variants:++* 'Series.zipWith', which combines two series with some elementwise function;+* 'Series.zipWithMatched', which combines two series with some elementwise function + on keys which are in *both* maps;+* 'Series.zipWithStrategy', which combines two series with some elementwise + function and supports custom operations to deal with missing keys;++To illustrate the differences between the various zipping functions, +consider the following two series. There's population:++>>> :set -XNumericUnderscores+>>> import Data.Fixed (Centi)+>>> :{ + -- Most recent population estimate rounded to the nearest million+ let population = Series.fromList [ ("Canada"::String, 40_000_000::Centi)+ , ("Kenya" , 56_000_000)+ , ("Poland" , 38_000_000)+ , ("Singapore" , 6_000_000)+ ]+ :}++and there's total land mass:++>>> :{ + -- Land mass in square kilometer+ let landmass = Series.fromList [ ("Brazil"::String, 8_520_000::Centi)+ , ("Canada", 9_990_000)+ , ("Kenya", 580_000)+ , ("Poland", 313_000)+ ] + :}++@'Series.zipWith' f left right@ combines the series @left@ and @right@ using the +function @f@ which admits two arguments, for all keys one-by-one. If a key +is missing from either @left@ or @right@, 'Series.zipWith' returns 'Nothing'. For example, +the population density per country would be:++>>> Series.zipWith (/) population landmass+ index | values+ ----- | ------+ "Brazil" | Nothing+ "Canada" | Just 4.00+ "Kenya" | Just 96.55+ "Poland" | Just 121.40+"Singapore" | Nothing++Since we don't have population estimates for Brazil and no land mass +information for Singapore, we can't calculate their population densities.++Sometimes, we only care about the results of @'Series.zipWith' f@ where keys are +in both series. In this case, we can use 'Series.zipWithMatched':++>>> Series.zipWithMatched (/) population landmass+ index | values+ ----- | ------+"Canada" | 4.00+ "Kenya" | 96.55+"Poland" | 121.40++Finally, in case we want full control over what to do when a key is missing, +we can use @Series.zipWithStrategy'. For example, consider the case where:++* If population numbers are missing, I want to set the density to 0;+* If land mass information is missing, I wait to skip calculating the density of this country. ++>>> import Data.Series (skipStrategy, constStrategy)+>>> let noPopulationStrategy = Series.constStrategy 0+>>> let noLandmassStrategy = Series.skipStrategy+>>> Series.zipWithStrategy (/) noPopulationStrategy noLandmassStrategy population landmass+ index | values+ ----- | ------+ "Canada" | 4.00+ "Kenya" | 96.55+ "Poland" | 121.40+"Singapore" | 0.00++As you can imagine, 'Series.zipWithStrategy' is the most general and gives the most control, but is less easy +to use than 'Series.zipWith' and 'Series.zipWithMatched'.++-}++{- $conclusion++This section concludes the introductory tutorial to the @javelin@ package and its "Data.Series" module.++For a more in-depth look at this package, you can read the full documentation for each module:++* "Data.Series"+* "Data.Series.Index"+* "Data.Series.Unboxed"+* "Data.Series.Generic"++-}++{- $duplicates++If you must build a 'Series' with duplicate keys, you can use the 'Data.Series.fromListDuplicates' or +'Data.Series.fromVectorDuplicates' functions. +In the example below, the key @\'d\'@ is repeated three times:++>>> Series.fromListDuplicates [('b', 0::Int), ('a', 5), ('d', 1), ('d', -4), ('d', 7) ]+ index | values+ ----- | ------+('a',0) | 5+('b',0) | 0+('d',0) | 1+('d',1) | -4+('d',2) | 7++Note that the 'Series' produced by 'Data.Series.fromListDuplicates' still has unique keys, but each key is a +composite of a character and an occurrence. This is reflected in the type:++>>> :t Series.fromListDuplicates [('b', 0::Int), ('a', 5), ('d', 1), ('d', -4), ('d', 7) ]+Series.fromListDuplicates [('b', 0::Int), ('a', 5), ('d', 1), ('d', -4), ('d', 7) ]+ :: Series (Char, Occurrence) Int++Here, 'Data.Series.Occurrence' is a non-negative number, and can be converted to +other integer-like numbers using 'fromIntegral'. In practice, you should aim to aggregate your 'Series' to remove duplicate keys, for example+using 'Data.Series.groupBy' and grouping on the first element of the key ('fst'):++>>> let xs = Series.fromListDuplicates [('b', 0::Int), ('a', 5), ('d', 1), ('d', -4), ('d', 7) ]+>>> xs `groupBy` fst `aggregateWith` sum+index | values+----- | ------+ 'a' | 5+ 'b' | 0+ 'd' | 4++-}++{- $unboxed ++The 'Data.Series.Series' defined in "Data.Series" are based on 'Data.Vector.Vector' from "Data.Vector". +This implementation is nice because such 'Series' can hold _any_ Haskell type. However, because+Haskell types can be arbitrarily complex, numerical operations on 'Series' may not be as fast+as could be.++For simpler types such as 'Double' and 'Int', a different kind of series can be used to+speed up numerical calculations: 'Data.Series.Unboxed.Series' from the "Data.Series.Unboxed" module.+Such 'Data.Series.Unboxed.Series' are much more limited: they can only contain datatypes which are+instances of 'Data.Vector.Unboxed.Unbox'. ++This then brings the question: how can you write software which supports both ordinary 'Data.Series.Series'+__and__ unboxed 'Data.Series.Unboxed.Series'? The answer is to use functions from the "Data.Series.Generic".++For example, we could implement the dot product of two series as:++>>> import qualified Data.Series.Generic as G+>>> import Data.Vector.Generic ( Vector )+>>> :{+ dot :: (Ord k, Num a, Vector v a) => G.Series v k a -> G.Series v k a -> a+ dot v1 v2 = G.sum $ G.zipWithMatched (*) v1 v2+ :}++You can convert between the two types of series using the 'Data.Series.Generic.convert' function.++-}++{- $replacement ++'Series.map' allows to map every value of a series. How about replacing *some* +values in a series? The function 'Data.Series.replace' (and its infix variant, '|->') replaces values in the right operand +which have an analogue in the left operand:++>>> import Data.Series ( (|->) )+>>> let nan = (0/0) :: Double+>>> let right = Series.fromList [('a', 1), ('b', nan), ('c', 3), ('d', nan)]+>>> right+index | values+----- | ------+ 'a' | 1.0+ 'b' | NaN+ 'c' | 3.0+ 'd' | NaN+>>> let left = Series.fromList [('b', 0::Double), ('d', 0), ('e', 0)]+>>> left+index | values+----- | ------+ 'b' | 0.0+ 'd' | 0.0+ 'e' | 0.0+>>> left |-> right+index | values+----- | ------+ 'a' | 1.0+ 'b' | 0.0+ 'c' | 3.0+ 'd' | 0.0++In the example above, the key @\'e\'@ is ignored since it was not in the @right@ +series to begin with.++The flipped version, '<-|', is also available.++-}++{- $comparison ++Below is a table showing which operations on "Data.Series" have analogues for +other data structures.+++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------++| Action | "Data.Series" | "Data.Map.Strict" | "Data.List" | "Data.Vector" |++=================================+================================+=================================+===================+======================++| Mapping values | 'Data.Series.map' | 'Data.Map.Strict.map' | 'map' | 'Data.Vector.map' |++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------++| Mapping index | 'Data.Series.mapIndex' | 'Data.Map.Strict.mapKeys' | | |++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------++| Mapping values with key | 'Data.Series.mapWithKey' | 'Data.Map.Strict.mapWithKey' | | |++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------++| Filtering values | 'Data.Series.filter' | 'Data.Map.Strict.filter' | 'filter' | 'Data.Vector.filter' |++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------++| Filtering index | 'Data.Series.select', | 'Data.Map.Strict.filterWithKey' | | |+| | 'Data.Series.filterWithKey' | | | |++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------++| Indexing by key | 'Data.Series.at' | 'Data.Map.Strict.lookup' | | |++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------++| Indexing by position | 'Data.Series.iat' | | 'Data.List.!' | 'Data.Vector.!' |++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------++| Combine two structures key-wise | 'Data.Series.zipWith' | 'Data.Map.Merge.Strict.merge' | | |++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------++| Union | 'Data.Series.<>' | 'Data.Map.Strict.union' | 'Data.List.union' | |++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------++| Group keys | 'Data.Series.groupBy' | | | |++---------------------------------+--------------------------------+---------------------------------+-------------------+----------------------+++-}
+ src/Data/Series/Unboxed.hs view
@@ -0,0 +1,1291 @@+-----------------------------------------------------------------------------+-- |+-- Module : Data.Series.Unboxed+-- Copyright : (c) Laurent P. René de Cotret+-- License : MIT+-- Maintainer : laurent.decotret@outlook.com+-- Portability : portable+--+-- This module contains data structures and functions to work with 'Series' capable of holding unboxed values,+-- i.e. values of types which are instances of `Unbox`.+--+-- = Why use unboxed series?+--+-- Unboxed series can have much better performance, at the cost of less flexibility. For example,+-- an unboxed series cannot contain values of type @`Maybe` a@. Moreover, unboxed series aren't instances of +-- `Functor` or `Foldable`.+--+-- If you are hesitating, you should prefer the series implementation in the "Data.Series" module.+--+-- = Introduction to series+--+-- A 'Series' of type @Series k a@ is a labeled array of values of type @a@,+-- indexed by keys of type @k@.+--+-- Like `Data.Map.Strict.Map` from the @containers@ package, 'Series' support efficient:+--+-- * random access by key ( \(O(\log n)\) );+-- * slice by key ( \(O(\log n)\) ).+--+-- Like `Data.Vector.Vector`, they support efficient:+--+-- * random access by index ( \(O(1)\) );+-- * slice by index ( \(O(1)\) );+-- * numerical operations.+--+-- This module re-exports most of the content of "Data.Series.Generic", with type signatures +-- specialized to the unboxed vector type `Data.Vector.Unboxed.Vector`.+ +module Data.Series.Unboxed (+ Series, index, values,++ -- * Building/converting 'Series'+ singleton, fromIndex,+ -- ** Lists+ fromList, toList,+ -- ** Vectors+ fromVector, toVector,+ -- ** Handling duplicates+ Occurrence, fromListDuplicates, fromVectorDuplicates,+ -- ** Strict Maps+ fromStrictMap, toStrictMap,+ -- ** Lazy Maps+ fromLazyMap, toLazyMap,+ -- ** Ad-hoc conversion with other data structures+ IsSeries(..),+ -- ** Conversion between 'Series' types+ G.convert,++ -- * Mapping and filtering+ map, mapWithKey, mapIndex, concatMap,+ take, takeWhile, drop, dropWhile, filter, filterWithKey,+ -- ** Mapping with effects+ mapWithKeyM, mapWithKeyM_, forWithKeyM, forWithKeyM_,++ -- * Combining series+ zipWithMatched, zipWithKey,+ zipWithMatched3, zipWithKey3,+ ZipStrategy, skipStrategy, mapStrategy, constStrategy, zipWithStrategy, zipWithStrategy3,+ zipWithMonoid, esum, eproduct, unzip, unzip3,++ -- * Index manipulation+ require, dropIndex,++ -- * Accessors+ -- ** Bulk access+ select, selectWhere, Range, to, from, upto, Selection, + -- ** Single-element access+ at, iat,++ -- * Replacement+ replace, (|->), (<-|),++ -- * Grouping and windowing operations+ groupBy, Grouping, aggregateWith, foldWith, + windowing, expanding,++ -- * Folds+ -- ** General folds+ fold, foldM, foldWithKey, foldMWithKey, foldMap, foldMap', foldMapWithKey,+ -- ** Specialized folds+ G.mean, G.variance, G.std,+ null, length, all, any, and, or, sum, product, maximum, maximumOn, minimum, minimumOn,+ argmin, argmax,++ -- * Scans+ postscanl, prescanl,++ -- * Displaying 'Series'+ display, displayWith,+ noLongerThan,+ DisplayOptions(..), G.defaultDisplayOptions+) where++import Control.Foldl ( Fold, FoldM )+import qualified Data.Map.Lazy as ML+import qualified Data.Map.Strict as MS+import Data.Series.Index ( Index )+import Data.Series.Generic.View + ( Range, Selection, to, from, upto )+import Data.Series.Generic ( IsSeries(..), ZipStrategy, Occurrence, DisplayOptions(..), skipStrategy, mapStrategy, constStrategy+ , noLongerThan + )+import qualified Data.Series.Generic as G+import Data.Vector.Unboxed ( Vector, Unbox )+import qualified Data.Vector.Unboxed as Vector++import Prelude hiding ( map, concatMap, zipWith, filter, foldMap, null, length, all, any, and, or+ , sum, product, maximum, minimum, take, takeWhile, drop, dropWhile+ , last, unzip, unzip3+ )++-- $setup+-- >>> import qualified Data.Series.Unboxed as Series+-- >>> import qualified Data.Series.Index as Index++infixl 1 `select` +infix 6 |->, <-|++-- | A series is a labeled array of values of type @a@,+-- indexed by keys of type @k@.+--+-- Like @Data.Map@ and @Data.HashMap@, they support efficient:+--+-- * random access by key ( \(O(\log n)\) );+-- * slice by key ( \(O(\log n)\) ).+--+-- Like @Data.Vector.Vector@, they support efficient:+--+-- * random access by index ( \(O(1)\) );+-- * slice by index ( \(O(1)\) );+-- * numerical operations.+type Series = G.Series Vector+++index :: Series k a -> Index k+{-# INLINE index #-}+index = G.index+++values :: Series k a -> Vector a+{-# INLINE values #-}+values = G.values+++-- | Create a 'Series' with a single element.+singleton :: Unbox a => k -> a -> Series k a+{-# INLINE singleton #-}+singleton = G.singleton+++-- | \(O(n)\) Generate a 'Series' by mapping every element of its index.+--+-- >>> fromIndex (const (0::Int)) $ Index.fromList ['a','b','c','d']+-- index | values+-- ----- | ------+-- 'a' | 0+-- 'b' | 0+-- 'c' | 0+-- 'd' | 0+fromIndex :: Unbox a+ => (k -> a) -> Index k -> Series k a+{-# INLINE fromIndex #-}+fromIndex = G.fromIndex+++-- | Construct a series from a list of key-value pairs. There is no+-- condition on the order of pairs.+--+-- >>> let xs = fromList [('b', 0::Int), ('a', 5), ('d', 1) ]+-- >>> xs+-- index | values+-- ----- | ------+-- 'a' | 5+-- 'b' | 0+-- 'd' | 1+--+-- If you need to handle duplicate keys, take a look at `fromListDuplicates`.+fromList :: (Ord k, Unbox a) => [(k, a)] -> Series k a+{-# INLINE fromList #-}+fromList = G.fromList+++-- | Construct a series from a list of key-value pairs.+-- Contrary to `fromList`, values at duplicate keys are preserved. To keep each+-- key unique, an `Occurrence` number counts up.+--+-- >>> let xs = fromListDuplicates [('b', 0::Int), ('a', 5), ('d', 1), ('d', -4), ('d', 7) ]+-- >>> xs+-- index | values+-- ----- | ------+-- ('a',0) | 5+-- ('b',0) | 0+-- ('d',0) | 1+-- ('d',1) | -4+-- ('d',2) | 7+fromListDuplicates :: (Ord k, Unbox a) => [(k, a)] -> Series (k, Occurrence) a+{-# INLINE fromListDuplicates #-}+fromListDuplicates = G.fromListDuplicates+++-- | Construct a list from key-value pairs. The elements are in order sorted by key:+--+-- >>> let xs = Series.fromList [ ('b', 0::Int), ('a', 5), ('d', 1) ]+-- >>> xs+-- index | values+-- ----- | ------+-- 'a' | 5+-- 'b' | 0+-- 'd' | 1+-- >>> toList xs+-- [('a',5),('b',0),('d',1)]+toList :: Unbox a => Series k a -> [(k, a)]+{-# INLINE toList #-}+toList = G.toList+++-- | Construct a 'Vector' of key-value pairs. The elements are in order sorted by key. +toVector :: (Unbox a, Unbox k) => Series k a -> Vector (k, a)+{-# INLINE toVector #-}+toVector = G.toVector+++-- | Construct a 'Series' from a 'Vector' of key-value pairs. There is no+-- condition on the order of pairs. Duplicate keys are silently dropped. If you+-- need to handle duplicate keys, see 'fromVectorDuplicates'.+--+-- Note that due to differences in sorting,+-- @Series.fromList@ and @Series.fromVector . Vector.fromList@ +-- may not be equivalent if the input list contains duplicate keys.+fromVector :: (Ord k, Unbox k, Unbox a)+ => Vector (k, a) -> Series k a+{-# INLINE fromVector #-}+fromVector = G.fromVector+++-- | Construct a series from a 'Vector' of key-value pairs.+-- Contrary to 'fromVector', values at duplicate keys are preserved. To keep each+-- key unique, an 'Occurrence' number counts up.+--+-- >>> import qualified Data.Vector.Unboxed as Unboxed+-- >>> let xs = fromVectorDuplicates $ Unboxed.fromList [('b', 0::Int), ('a', 5), ('d', 1), ('d', -4), ('d', 7) ]+-- >>> xs+-- index | values+-- ----- | ------+-- ('a',0) | 5+-- ('b',0) | 0+-- ('d',0) | 1+-- ('d',1) | -4+-- ('d',2) | 7+fromVectorDuplicates :: (Unbox k, Unbox a, Ord k) => Vector (k, a) -> Series (k, Occurrence) a+{-# INLINE fromVectorDuplicates #-}+fromVectorDuplicates = G.fromVectorDuplicates+++-- | Convert a series into a lazy @Map@.+toLazyMap :: (Unbox a) => Series k a -> ML.Map k a+{-# INLINE toLazyMap #-}+toLazyMap = G.toLazyMap+++-- | Construct a series from a lazy @Map@.+fromLazyMap :: (Unbox a) => ML.Map k a -> Series k a+{-# INLINE fromLazyMap #-}+fromLazyMap = G.fromLazyMap+++-- | Convert a series into a strict @Map@.+toStrictMap :: (Unbox a) => Series k a -> MS.Map k a+{-# INLINE toStrictMap #-}+toStrictMap = G.toStrictMap++-- | Construct a series from a strict @Map@.+fromStrictMap :: (Unbox a) => MS.Map k a -> Series k a+{-# INLINE fromStrictMap #-}+fromStrictMap = G.fromStrictMap+++-- | \(O(n)\) Map every element of a 'Series'.+map :: (Unbox a, Unbox b) => (a -> b) -> Series k a -> Series k b+{-# INLINE map #-}+map = G.map+++-- | \(O(n)\) Map every element of a 'Series', possibly using the key as well.+mapWithKey :: (Unbox a, Unbox b) => (k -> a -> b) -> Series k a -> Series k b+{-# INLINE mapWithKey #-}+mapWithKey = G.mapWithKey+++-- | \(O(n \log n)\).+-- Map each key in the index to another value. Note that the resulting series+-- may have less elements, because each key must be unique.+--+-- In case new keys are conflicting, the first element is kept.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> import qualified Data.List+-- >>> xs `mapIndex` (Data.List.take 1)+-- index | values+-- ----- | ------+-- "L" | 4+-- "P" | 1+mapIndex :: (Unbox a, Ord k, Ord g) => Series k a -> (k -> g) -> Series g a+{-# INLINE mapIndex #-}+mapIndex = G.mapIndex+++-- | Map a function over all the elements of a 'Series' and concatenate the result into a single 'Series'.+concatMap :: (Unbox a, Unbox k, Unbox b, Ord k) + => (a -> Series k b) + -> Series k a + -> Series k b+{-# INLINE concatMap #-}+concatMap = G.concatMap+++-- | \(O(n)\) Apply the monadic action to every element of a series and its+-- index, yielding a series of results.+mapWithKeyM :: (Unbox a, Unbox b, Monad m, Ord k) => (k -> a -> m b) -> Series k a -> m (Series k b)+{-# INLINE mapWithKeyM #-}+mapWithKeyM = G.mapWithKeyM+++-- | \(O(n)\) Apply the monadic action to every element of a series and its+-- index, discarding the results.+mapWithKeyM_ :: (Unbox a, Monad m) => (k -> a -> m b) -> Series k a -> m ()+{-# INLINE mapWithKeyM_ #-}+mapWithKeyM_ = G.mapWithKeyM_+++-- | \(O(n)\) Apply the monadic action to all elements of the series and their associated keys, +-- yielding a series of results.+forWithKeyM :: (Unbox a, Unbox b, Monad m, Ord k) => Series k a -> (k -> a -> m b) -> m (Series k b)+{-# INLINE forWithKeyM #-}+forWithKeyM = G.forWithKeyM+++-- | \(O(n)\) Apply the monadic action to all elements of the series and their associated keys, +-- discarding the results.+forWithKeyM_ :: (Unbox a, Monad m) => Series k a -> (k -> a -> m b) -> m ()+{-# INLINE forWithKeyM_ #-}+forWithKeyM_ = G.forWithKeyM_+++-- | \(O(\log n)\) @'take' n xs@ returns at most @n@ elements of the 'Series' @xs@.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4), ("Vienna", 5)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- "Vienna" | 5+-- >>> take 2 xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+take :: Unbox a => Int -> Series k a -> Series k a+{-# INLINE take #-}+take = G.take+++-- | \(O(n)\) Returns the longest prefix (possibly empty) of the input 'Series' that satisfy a predicate.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4), ("Vienna", 5)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- "Vienna" | 5++-- >>> takeWhile (>1) xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+takeWhile :: Unbox a => (a -> Bool) -> Series k a -> Series k a+takeWhile = G.takeWhile+++-- | \(O(\log n)\) @'drop' n xs@ drops at most @n@ elements from the 'Series' @xs@.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4), ("Vienna", 5)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- "Vienna" | 5+-- >>> drop 2 xs+-- index | values+-- ----- | ------+-- "Paris" | 1+-- "Vienna" | 5+drop :: Unbox a => Int -> Series k a -> Series k a+{-# INLINE drop #-}+drop = G.drop+++-- | \(O(n)\) Returns the complement of `takeWhile`.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4), ("Vienna", 5)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- "Vienna" | 5++-- >>> dropWhile (>1) xs+-- index | values+-- ----- | ------+-- "Paris" | 1+-- "Vienna" | 5+dropWhile :: Unbox a => (a -> Bool) -> Series k a -> Series k a+dropWhile = G.dropWhile+++-- | Apply a function elementwise to two series, matching elements+-- based on their keys. Keys present only in the left or right series are dropped.+--+-- >>> let xs = Series.fromList [ ('a', 0::Int), ('b', 1), ('g', 2) ]+-- >>> let ys = Series.fromList [ ('a', 10::Int), ('b', 11), ('d', 13) ]+-- >>> zipWithMatched (+) xs ys+-- index | values+-- ----- | ------+-- 'a' | 10+-- 'b' | 12+zipWithMatched :: (Unbox a, Unbox b, Unbox c, Ord k) + => (a -> b -> c) -> Series k a -> Series k b -> Series k c+{-# INLINE zipWithMatched #-}+zipWithMatched = G.zipWithMatched+++-- | Apply a function elementwise to three series, matching elements+-- based on their keys. Keys not present in all three series are dropped.+--+-- >>> let xs = Series.fromList [ ('a', 0::Int), ('b', 1), ('g', 2) ]+-- >>> let ys = Series.fromList [ ('a', 10::Int), ('b', 11), ('d', 13) ]+-- >>> let zs = Series.fromList [ ('a', 20::Int), ('d', 13), ('e', 6) ]+-- >>> zipWithMatched3 (\x y z -> x + y + z) xs ys zs+-- index | values+-- ----- | ------+-- 'a' | 30+zipWithMatched3 :: (Unbox a, Unbox b, Unbox c, Unbox d, Ord k) + => (a -> b -> c -> d) + -> Series k a + -> Series k b + -> Series k c+ -> Series k d+{-# INLINE zipWithMatched3 #-}+zipWithMatched3 = G.zipWithMatched3+++-- | Apply a function elementwise to two series, matching elements+-- based on their keys. Keys present only in the left or right series are dropped.+-- +--+-- >>> import Data.Char ( ord )+-- >>> let xs = Series.fromList [ ('a', 0::Int), ('b', 1), ('c', 2) ]+-- >>> let ys = Series.fromList [ ('a', 10::Int), ('b', 11), ('d', 13) ]+-- >>> zipWithKey (\k x y -> ord k + x + y) xs ys+-- index | values+-- ----- | ------+-- 'a' | 107+-- 'b' | 110+zipWithKey :: (Unbox a, Unbox b, Unbox c, Unbox k, Ord k) + => (k -> a -> b -> c) -> Series k a -> Series k b -> Series k c+{-# INLINE zipWithKey #-}+zipWithKey = G.zipWithKey+++-- | Apply a function elementwise to three series, matching elements+-- based on their keys. Keys present only in the left or right series are dropped.+-- +-- >>> import Data.Char ( ord )+-- >>> let xs = Series.fromList [ ('a', 0::Int), ('b', 1), ('g', 2) ]+-- >>> let ys = Series.fromList [ ('a', 10::Int), ('b', 11), ('d', 13) ]+-- >>> let zs = Series.fromList [ ('a', 20::Int), ('b', 7), ('d', 5) ]+-- >>> zipWithKey3 (\k x y z -> ord k + x + y + z) xs ys zs+-- index | values+-- ----- | ------+-- 'a' | 127+-- 'b' | 117+zipWithKey3 :: (Unbox a, Unbox b, Unbox c, Unbox d, Unbox k, Ord k) + => (k -> a -> b -> c -> d) + -> Series k a + -> Series k b + -> Series k c+ -> Series k d+{-# INLINE zipWithKey3 #-}+zipWithKey3 = G.zipWithKey3+++-- | Zip two 'Series' with a combining function, applying a 'ZipStrategy' when one key is present in one of the 'Series' but not both.+--+-- In the example below, we want to set the value to @-100@ (via @'constStrategy' (-100)@) for keys which are only present +-- in the left 'Series', and drop keys (via 'skipStrategy') which are only present in the `right 'Series' +--+-- >>> let xs = Series.fromList [ ('a', 0::Int), ('b', 1), ('g', 2) ]+-- >>> let ys = Series.fromList [ ('a', 10::Int), ('b', 11), ('d', 13) ]+-- >>> zipWithStrategy (+) (constStrategy (-100)) skipStrategy xs ys+-- index | values+-- ----- | ------+-- 'a' | 10+-- 'b' | 12+-- 'g' | -100+--+-- Note that if you want to drop keys missing in either 'Series', it is faster to use @'zipWithMatched' f@ +-- than using @'zipWithStrategy' f 'skipStrategy' 'skipStrategy'@.+zipWithStrategy :: (Ord k, Unbox a, Unbox b, Unbox c) + => (a -> b -> c) -- ^ Function to combine values when present in both series+ -> ZipStrategy k a c -- ^ Strategy for when the key is in the left series but not the right+ -> ZipStrategy k b c -- ^ Strategy for when the key is in the right series but not the left+ -> Series k a+ -> Series k b + -> Series k c+{-# INLINE zipWithStrategy #-}+zipWithStrategy = G.zipWithStrategy+++-- | Zip three 'Series' with a combining function, applying a 'ZipStrategy' when one key is +-- present in one of the 'Series' but not all of the others.+--+-- Note that if you want to drop keys missing in either 'Series', it is faster to use @'zipWithMatched3' f@ +-- than using @'zipWithStrategy3' f skipStrategy skipStrategy skipStrategy@.+zipWithStrategy3 :: (Ord k, Unbox a, Unbox b, Unbox c, Unbox d) + => (a -> b -> c -> d) -- ^ Function to combine values when present in all series+ -> ZipStrategy k a d -- ^ Strategy for when the key is in the left series but not in all the others+ -> ZipStrategy k b d -- ^ Strategy for when the key is in the center series but not in all the others+ -> ZipStrategy k c d -- ^ Strategy for when the key is in the right series but not in all the others+ -> Series k a+ -> Series k b + -> Series k c+ -> Series k d+zipWithStrategy3 = G.zipWithStrategy3+{-# INLINE zipWithStrategy3 #-}+++-- | Zip two 'Series' with a combining function. The value for keys which are missing from+-- either 'Series' is replaced with the appropriate `mempty` value.+--+-- >>> import Data.Monoid ( Sum(..) )+-- >>> let xs = Series.fromList [ ("2023-01-01", Sum (1::Int)), ("2023-01-02", Sum 2) ]+-- >>> let ys = Series.fromList [ ("2023-01-01", Sum (5::Int)), ("2023-01-03", Sum 7) ]+-- >>> zipWithMonoid (<>) xs ys+-- index | values+-- ----- | ------+-- "2023-01-01" | Sum {getSum = 6}+-- "2023-01-02" | Sum {getSum = 2}+-- "2023-01-03" | Sum {getSum = 7}+zipWithMonoid :: ( Monoid a, Monoid b+ , Unbox a, Unbox b, Unbox c+ , Ord k+ ) + => (a -> b -> c)+ -> Series k a+ -> Series k b + -> Series k c+zipWithMonoid = G.zipWithMonoid+{-# INLINE zipWithMonoid #-}+++-- | Elementwise sum of two 'Series'. Elements missing in one or the other 'Series' is considered 0. +--+-- >>> let xs = Series.fromList [ ("2023-01-01", (1::Int)), ("2023-01-02", 2) ]+-- >>> let ys = Series.fromList [ ("2023-01-01", (5::Int)), ("2023-01-03", 7) ]+-- >>> xs `esum` ys+-- index | values+-- ----- | ------+-- "2023-01-01" | 6+-- "2023-01-02" | 2+-- "2023-01-03" | 7+esum :: (Ord k, Num a, Unbox a) + => Series k a + -> Series k a+ -> Series k a+esum = G.esum+{-# INLINE esum #-}+++-- | Elementwise product of two 'Series'. Elements missing in one or the other 'Series' is considered 1. +--+-- >>> let xs = Series.fromList [ ("2023-01-01", (2::Int)), ("2023-01-02", 3) ]+-- >>> let ys = Series.fromList [ ("2023-01-01", (5::Int)), ("2023-01-03", 7) ]+-- >>> xs `eproduct` ys+-- index | values+-- ----- | ------+-- "2023-01-01" | 10+-- "2023-01-02" | 3+-- "2023-01-03" | 7+eproduct :: (Ord k, Num a, Unbox a) + => Series k a + -> Series k a+ -> Series k a+eproduct = G.eproduct+{-# INLINE eproduct #-}+++-- | \(O(n)\) Unzip a 'Series' of 2-tuples.+unzip :: (Unbox a, Unbox b) + => Series k (a, b)+ -> ( Series k a+ , Series k b+ )+unzip = G.unzip+{-# INLINE unzip #-}+++-- | \(O(n)\) Unzip a 'Series' of 3-tuples.+unzip3 :: (Unbox a, Unbox b, Unbox c) + => Series k (a, b, c)+ -> ( Series k a+ , Series k b+ , Series k c+ )+unzip3 = G.unzip3+{-# INLINE unzip3 #-}+++-- | Require a series to have a specific `Index`. +-- Contrary to @select@, all keys in the `Index` will be present in the resulting series.+--+-- Note that unlike the implementation for boxed series (`Data.Series.require`), missing keys need to be mapped to some values because unboxed+-- series cannot contain values of type @`Maybe` a@. +--+-- In the example below, the missing value for key @\"Taipei\"@ is mapped to 0:+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> require (const 0) xs (Index.fromList ["Paris", "Lisbon", "Taipei"])+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "Paris" | 1+-- "Taipei" | 0+require :: (Unbox a, Ord k) + => (k -> a) -> Series k a -> Index k -> Series k a+{-# INLINE require #-}+require f = G.requireWith f id+++-- | Drop the index of a series by replacing it with an `Int`-based index. Values will+-- be indexed from 0.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> dropIndex xs+-- index | values+-- ----- | ------+-- 0 | 4+-- 1 | 2+-- 2 | 1+dropIndex :: Series k a -> Series Int a+{-# INLINE dropIndex #-}+dropIndex = G.dropIndex+++-- | Filter elements. Only elements for which the predicate is @True@ are kept. +-- Notice that the filtering is done on the values, not on the keys.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> filter (>2) xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+--+-- See also 'filterWithKey'.+filter :: (Unbox a, Ord k) => (a -> Bool) -> Series k a -> Series k a+{-# INLINE filter #-}+filter = G.filter+++-- | Filter elements, taking into account the corresponding key. Only elements for which +-- the predicate is @True@ are kept. +filterWithKey :: (Unbox a, Ord k) + => (k -> a -> Bool) + -> Series k a + -> Series k a+{-# INLINE filterWithKey #-}+filterWithKey = G.filterWithKey+++-- | Select a subseries. There are a few ways to do this.+--+-- The first way to do this is to select a sub-series based on random keys. For example,+-- selecting a subseries from an `Index`:+--+-- >>> let xs = Series.fromList [('a', 10::Int), ('b', 20), ('c', 30), ('d', 40)]+-- >>> xs `select` Index.fromList ['a', 'd']+-- index | values+-- ----- | ------+-- 'a' | 10+-- 'd' | 40+--+-- The second way to select a sub-series is to select all keys in a range:+--+-- >>> xs `select` 'b' `to` 'c'+-- index | values+-- ----- | ------+-- 'b' | 20+-- 'c' | 30+--+-- Note that with `select`, you'll always get a sub-series; if you ask for a key which is not+-- in the series, it'll be ignored:+--+-- >>> xs `select` Index.fromList ['a', 'd', 'e']+-- index | values+-- ----- | ------+-- 'a' | 10+-- 'd' | 40+--+-- See `require` if you want to ensure that all keys are present.+select :: (Unbox a, Selection s, Ord k) => Series k a -> s k -> Series k a+select = G.select+++-- | Select a sub-series from a series matching a condition.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> xs `selectWhere` (Series.map (>1) xs)+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+selectWhere :: (Unbox a, Ord k) => Series k a -> Series k Bool -> Series k a+{-# INLINE selectWhere #-}+selectWhere = G.selectWhere+++-- | \(O(\log n)\). Extract a single value from a series, by key.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs `at` "Paris"+-- Just 1+-- >>> xs `at` "Sydney"+-- Nothing+at :: (Unbox a, Ord k) => Series k a -> k -> Maybe a+{-# INLINE at #-}+at = G.at+++-- | \(O(1)\). Extract a single value from a series, by index.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> xs `iat` 0+-- Just 4+-- >>> xs `iat` 3+-- Nothing+iat :: Unbox a => Series k a -> Int -> Maybe a+{-# INLINE iat #-}+iat = G.iat+++-- | Replace values in the right series from values in the left series at matching keys.+-- Keys not in the right series are unaffected.+-- +-- See `(|->)` and `(<-|)`, which might be more readable.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> let ys = Series.singleton "Paris" (99::Int)+-- >>> ys `replace` xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 99+replace :: (Unbox a, Ord k) => Series k a -> Series k a -> Series k a+{-# INLINE replace #-}+replace = G.replace+++-- | Replace values in the right series from values in the left series at matching keys.+-- Keys not in the right series are unaffected.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> let ys = Series.singleton "Paris" (99::Int)+-- >>> ys |-> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 99+(|->) :: (Unbox a, Ord k) => Series k a -> Series k a -> Series k a+{-# INLINE (|->) #-}+(|->) = (G.|->)+++-- | Replace values in the left series from values in the right series at matching keys.+-- Keys not in the left series are unaffected.+--+-- >>> let xs = Series.fromList [("Paris", 1 :: Int), ("London", 2), ("Lisbon", 4)]+-- >>> xs+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 1+-- >>> let ys = Series.singleton "Paris" (99::Int)+-- >>> xs <-| ys+-- index | values+-- ----- | ------+-- "Lisbon" | 4+-- "London" | 2+-- "Paris" | 99+(<-|) :: (Unbox a, Ord k) => Series k a -> Series k a -> Series k a+{-# INLINE (<-|) #-}+(<-|) = (G.<-|)+++-- | \(O(n)\) Execute a 'Fold' over a 'Series'.+--+-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4]) :: Series Int Double+-- >>> xs+-- index | values+-- ----- | ------+-- 0 | 1.0+-- 1 | 2.0+-- 2 | 3.0+-- 3 | 4.0+-- >>> import Control.Foldl (variance)+-- >>> fold variance xs+-- 1.25+--+-- See also 'foldM' for monadic folds, and 'foldWithKey' to take keys into+-- account while folding.+fold :: Unbox a + => Fold a b -> Series k a -> b+fold = G.fold+{-# INLINE fold #-}+++-- | \(O(n)\) Execute a monadic 'FoldM' over a 'Series'.+--+-- See also 'fold' for pure folds, and 'foldMWithKey' to take keys into+-- account while folding.+foldM :: (Monad m, Unbox a) + => FoldM m a b + -> Series k a + -> m b+foldM = G.foldM+{-# INLINE foldM #-}+++-- | \(O(n)\) Execute a 'Fold' over a 'Series', taking keys into account.+foldWithKey :: (Unbox k, Unbox a) + => Fold (k, a) b -> Series k a -> b+foldWithKey = G.foldWithKey+{-# INLINE foldWithKey #-}+++-- | \(O(n)\) Execute a monadic 'FoldM' over a 'Series', where the 'FoldM' takes keys into account.+foldMWithKey :: (Monad m, Unbox a, Unbox k) + => FoldM m (k, a) b + -> Series k a + -> m b+foldMWithKey = G.foldMWithKey+{-# INLINE foldMWithKey #-}+++-- | \(O(n)\) Map each element of the structure to a monoid and combine+-- the results.+foldMap :: (Monoid m, Unbox a) => (a -> m) -> Series k a -> m+{-# INLINE foldMap #-}+foldMap = G.foldMap+++-- | \(O(n)\) Like 'foldMap', but strict in the accumulator. It uses the same+-- implementation as the corresponding method of the 'Foldable' type class.+foldMap' :: (Monoid m, Unbox a) => (a -> m) -> Series k a -> m+{-# INLINE foldMap' #-}+foldMap' f = Vector.foldMap' f . values+++-- | \(O(n)\) Map each element and associated key of the structure to a monoid and combine+-- the results.+foldMapWithKey :: (Monoid m, Unbox a, Unbox k) => (k -> a -> m) -> Series k a -> m+{-# INLINE foldMapWithKey #-}+foldMapWithKey = G.foldMapWithKey+++-- | Group values in a 'Series' by some grouping function (@k -> g@).+-- The provided grouping function is guaranteed to operate on a non-empty 'Series'.+--+-- This function is expected to be used in conjunction with @aggregate@:+-- +-- >>> import Data.Maybe ( fromMaybe )+-- >>> type Date = (Int, String)+-- >>> month :: (Date -> String) = snd+-- >>> :{ +-- let xs = Series.fromList [ ((2020, "January") :: Date, 0 :: Int)+-- , ((2021, "January"), -5)+-- , ((2020, "June") , 20)+-- , ((2021, "June") , 25) +-- ]+-- in xs `groupBy` month `aggregateWith` (fromMaybe 0 . minimum)+-- :}+-- index | values+-- ----- | ------+-- "January" | -5+-- "June" | 20+groupBy :: Series k a -- ^ Grouping function+ -> (k -> g) -- ^ Input series+ -> Grouping k g a -- ^ Grouped series+{-# INLINE groupBy #-}+groupBy = G.groupBy+++-- | Representation of a 'Series' being grouped.+type Grouping k g a = G.Grouping k g Vector a+++-- | Aggregate groups resulting from a call to 'groupBy':+-- +-- >>> import Data.Maybe ( fromMaybe )+-- >>> type Date = (Int, String)+-- >>> month :: (Date -> String) = snd+-- >>> :{ +-- let xs = Series.fromList [ ((2020, "January") :: Date, 0 :: Int)+-- , ((2021, "January"), -5)+-- , ((2020, "June") , 20)+-- , ((2021, "June") , 25) +-- ]+-- in xs `groupBy` month `aggregateWith` (fromMaybe 0 . minimum)+-- :}+-- index | values+-- ----- | ------+-- "January" | -5+-- "June" | 20+--+-- If you want to aggregate groups using a binary function, see 'foldWith' which+-- may be much faster.+aggregateWith :: (Ord g, Unbox a, Unbox b) + => Grouping k g a + -> (Series k a -> b) + -> Series g b+{-# INLINE aggregateWith #-}+aggregateWith = G.aggregateWith+++-- | Aggregate each group in a 'Grouping' using a binary function.+-- While this is not as expressive as 'aggregateWith', users looking for maximum+-- performance should use 'foldWith' as much as possible.+foldWith :: (Ord g, Unbox a) + => Grouping k g a+ -> (a -> a -> a)+ -> Series g a+{-# INLINE foldWith #-}+foldWith = G.foldWith+++-- | Expanding window aggregation.+--+-- >>> :{ +-- let (xs :: Series Int Int) +-- = fromList [ (1, 0)+-- , (2, 1)+-- , (3, 2)+-- , (4, 3)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in (xs `expanding` sum) :: Series Int Int +-- :}+-- index | values+-- ----- | ------+-- 1 | 0+-- 2 | 1+-- 3 | 3+-- 4 | 6+-- 5 | 10+-- 6 | 15+expanding :: (Unbox a, Unbox b) + => Series k a -- ^ Series vector+ -> (Series k a -> b) -- ^ Aggregation function+ -> Series k b -- ^ Resulting vector+{-# INLINE expanding #-}+expanding = G.expanding+++-- | General-purpose window aggregation.+--+-- >>> :{ +-- let (xs :: Series.Series Int Int) +-- = Series.fromList [ (1, 0)+-- , (2, 1)+-- , (3, 2)+-- , (4, 3)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in windowing (\k -> k `to` (k+2)) sum xs+-- :}+-- index | values+-- ----- | ------+-- 1 | 3+-- 2 | 6+-- 3 | 9+-- 4 | 12+-- 5 | 9+-- 6 | 5+windowing :: (Ord k, Unbox a, Unbox b)+ => (k -> Range k)+ -> (Series k a -> b)+ -> Series k a+ -> Series k b+{-# INLINE windowing #-}+windowing = G.windowing +++-- | \(O(1)\) Test whether a 'Series' is empty.+null :: Unbox a => Series k a -> Bool+{-# INLINE null #-}+null = G.null+++-- |\(O(1)\) Extract the length of a 'Series'.+length :: Unbox a => Series k a -> Int+{-# INLINE length #-}+length = G.length+++-- | \(O(n)\) Check if all elements satisfy the predicate.+all :: Unbox a => (a -> Bool) -> Series k a -> Bool+{-# INLINE all #-}+all = G.all+++-- | \(O(n)\) Check if any element satisfies the predicate.+any :: Unbox a => (a -> Bool) -> Series k a -> Bool+{-# INLINE any #-}+any = G.any+++-- | \(O(n)\) Check if all elements are 'True'.+and :: Series k Bool -> Bool+{-# INLINE and #-}+and = G.and+++-- | \(O(n)\) Check if any element is 'True'.+or :: Series k Bool -> Bool+{-# INLINE or #-}+or = G.or+++-- | \(O(n)\) Compute the sum of the elements.+sum :: (Unbox a, Num a) => Series k a -> a+{-# INLINE sum #-}+sum = G.sum+++-- | \(O(n)\) Compute the product of the elements.+product :: (Unbox a, Num a) => Series k a -> a+{-# INLINE product #-}+product = G.product+++-- | \(O(n)\) Yield the maximum element of the series. In case of a tie, the first occurrence wins.+-- If the 'Series' is empty, @Nothing@ is returned.+--+-- See also 'argmax'.+maximum :: (Ord a, Unbox a) => Series k a -> Maybe a+{-# INLINE maximum #-}+maximum = G.maximum+++-- | \(O(n)\) @'maximumOn' f xs@ teturns the maximum element of the series @xs@, as determined by the function @f@.+-- In case of a tie, the first occurrence wins. If the 'Series' is empty, @Nothing@ is returned.+maximumOn :: (Ord b, Unbox a) => (a -> b) -> Series k a -> Maybe a+{-# INLINE maximumOn #-}+maximumOn = G.maximumOn+++-- | \(O(n)\) Yield the minimum element of the series. In case of a tie, the first occurrence wins.+-- If the 'Series' is empty, @Nothing@ is returned.+--+-- See also 'argmin'.+minimum :: (Ord a, Unbox a) => Series k a -> Maybe a+{-# INLINE minimum #-}+minimum = G.minimum+++-- | \(O(n)\) @'minimumOn' f xs@ teturns the minimum element of the series @xs@, as determined by the function @f@.+-- In case of a tie, the first occurrence wins. If the 'Series' is empty, @Nothing@ is returned.+minimumOn :: (Ord b, Unbox a) => (a -> b) -> Series k a -> Maybe a+{-# INLINE minimumOn #-}+minimumOn = G.minimumOn+++-- | \(O(n)\) Find the index of the maximum element in the input series.+-- If the input series is empty, 'Nothing' is returned.+--+-- The index of the first occurrence of the maximum element is returned.+--+-- >>> import qualified Data.Series.Unboxed as Series +-- >>> :{ +-- let (xs :: Series.Series Int Int) +-- = Series.fromList [ (1, 0)+-- , (2, 1)+-- , (3, 2)+-- , (4, 7)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in argmax xs +-- :}+-- Just 4+argmax :: (Ord a, Unbox a)+ => Series k a+ -> Maybe k+argmax = G.argmax+{-# INLINE argmax #-}+++-- | \(O(n)\) Find the index of the minimum element in the input series.+-- If the input series is empty, 'Nothing' is returned.+--+-- The index of the first occurrence of the minimum element is returned.+-- >>> import qualified Data.Series.Unboxed as Series +-- >>> :{ +-- let (xs :: Series.Series Int Int) +-- = Series.fromList [ (1, 1)+-- , (2, 1)+-- , (3, 2)+-- , (4, 0)+-- , (5, 4)+-- , (6, 5)+-- ]+-- in argmin xs +-- :}+-- Just 4+argmin :: (Ord a, Unbox a)+ => Series k a+ -> Maybe k+argmin = G.argmin+{-# INLINE argmin #-}+++-- | \(O(n)\) Left-to-right postscan.+--+-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4]) :: Series Int Int+-- >>> xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 2+-- 2 | 3+-- 3 | 4+-- >>> postscanl (+) 0 xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 3+-- 2 | 6+-- 3 | 10+postscanl :: (Unbox a, Unbox b) + => (a -> b -> a) -> a -> Series k b -> Series k a+{-# INLINE postscanl #-}+postscanl = G.postscanl+++-- | \(O(n)\) Left-to-right prescan.+--+-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4]) :: Series Int Int+-- >>> xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 2+-- 2 | 3+-- 3 | 4+-- >>> prescanl (+) 0 xs+-- index | values+-- ----- | ------+-- 0 | 0+-- 1 | 1+-- 2 | 3+-- 3 | 6+prescanl :: (Unbox a, Unbox b) + => (a -> b -> a) -> a -> Series k b -> Series k a+{-# INLINE prescanl #-}+prescanl = G.prescanl+++-- | Display a 'Series' using default 'DisplayOptions'.+--+-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4,5,6,7]) :: Series Int Int+-- >>> putStrLn $ display xs+-- index | values+-- ----- | ------+-- 0 | 1+-- 1 | 2+-- 2 | 3+-- ... | ...+-- 4 | 5+-- 5 | 6+-- 6 | 7+display :: (Unbox a, Show k, Show a) + => Series k a + -> String+display = G.display+++-- | Display a 'Series' using customizable 'DisplayOptions'.+--+-- >>> let xs = Series.fromList (zip [0..] [1,2,3,4,5,6,7]) :: Series Int Int+-- >>> import Data.List (replicate)+-- >>> :{+-- let opts = DisplayOptions { maximumNumberOfRows = 4+-- , indexHeader = "keys"+-- , valuesHeader = "vals"+-- , keyDisplayFunction = (\i -> replicate i 'x') `noLongerThan` 5+-- , valueDisplayFunction = (\i -> replicate i 'o') +-- }+-- in putStrLn $ displayWith opts xs+-- :}+-- keys | vals+-- ----- | ------+-- | o+-- x | oo+-- ... | ...+-- xxxxx | oooooo+-- xxx... | ooooooo+displayWith :: (Unbox a) + => DisplayOptions k a+ -> Series k a + -> String+displayWith = G.displayWith
+ test/Main.hs view
@@ -0,0 +1,21 @@+module Main (main) where++import qualified Test.Data.Series+import qualified Test.Data.Series.Generic.Aggregation+import qualified Test.Data.Series.Generic.Definition+import qualified Test.Data.Series.Index+import qualified Test.Data.Series.Generic.Numeric+import qualified Test.Data.Series.Generic.View+import qualified Test.Data.Series.Generic.Zip++import Test.Tasty ( defaultMain, testGroup )++main :: IO ()+main = defaultMain $ testGroup "Test suite" [ Test.Data.Series.tests+ , Test.Data.Series.Index.tests+ , Test.Data.Series.Generic.Aggregation.tests+ , Test.Data.Series.Generic.Definition.tests+ , Test.Data.Series.Generic.Numeric.tests+ , Test.Data.Series.Generic.View.tests+ , Test.Data.Series.Generic.Zip.tests+ ]
+ test/Test/Data/Series.hs view
@@ -0,0 +1,7 @@++module Test.Data.Series (tests) where++import Test.Tasty ( testGroup, TestTree ) ++tests :: TestTree+tests = testGroup "Data.Series" []
+ test/Test/Data/Series/Generic/Aggregation.hs view
@@ -0,0 +1,134 @@++module Test.Data.Series.Generic.Aggregation (tests) where++import qualified Data.Map.Strict as MS+import qualified Data.Series.Generic as Series+import Data.Series.Generic ( Series, fromStrictMap, groupBy, aggregateWith, foldWith, windowing, to, expanding)+import Data.Vector ( Vector )++import Hedgehog ( property, forAll, (===) )+import qualified Hedgehog.Gen as Gen+import qualified Hedgehog.Range as Range++import Prelude hiding ( zipWith )++import Test.Tasty ( testGroup, TestTree )+import Test.Tasty.Hedgehog ( testProperty )+import Test.Tasty.HUnit ( testCase, assertEqual )++tests :: TestTree+tests = testGroup "Data.Series.Generic.Aggregation" [ testGroupBy+ , testWindowing+ , testWindowingRollingForwards+ , testWindowingRollingBackwards+ , testPropAggregateVsfoldWith+ , testExpanding+ ]+++testGroupBy :: TestTree+testGroupBy = testGroup "Data.Series.Generic.groupBy" [ testGroupBy1, testGroupBy2 ]+ where+ testGroupBy1 = testCase "groupBy" $ do+ let (series :: Series Vector String Int) = fromStrictMap $ MS.fromList [("aa", 1), ("ab", 2), ("c", 3), ("dc", 4), ("ae", 5)]+ expectation = fromStrictMap $ MS.fromList [(1, 3), (2, 1+2+4+5)]+ + assertEqual mempty expectation $ series `groupBy` length `aggregateWith` (Series.sum :: Series Vector String Int -> Int)++ testGroupBy2 = testCase "groupBy" $ do+ let (series :: Series Vector Int Int) = fromStrictMap $ MS.fromList $ zip [0,1,2,3] [0,1,2,3]+ expectation = fromStrictMap $ MS.fromList [(True, 0+2), (False, 1+3)]+ + assertEqual mempty expectation $ series `groupBy` even `aggregateWith` (Series.sum :: Series Vector Int Int -> Int)++++testWindowing :: TestTree+testWindowing = testCase "Data.Series.Generic.windowing" $ do++ let (xs :: Series Vector Int Int) + = Series.fromList [ (1, 0)+ , (2, 1)+ , (3, 2)+ , (4, 3)+ , (5, 4)+ , (6, 5)+ ]+ expectation = Series.fromList [ (1, 3)+ , (2, 6)+ , (3, 9)+ , (4, 12)+ , (5, 9)+ , (6, 5)+ ]+ assertEqual mempty expectation $ windowing (\k -> k `to` (k+2)) sum xs+++testWindowingRollingForwards :: TestTree+testWindowingRollingForwards = testGroup "Data.Series.Generic.windowing" [ test1, test2 ]+ where+ test1 = testCase "rollingForwards" $ do+ let (series :: Series Vector Int Int) = fromStrictMap $ MS.fromList [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]+ expectation = fromStrictMap $ MS.fromList [ (1, 1+2)+ , (2, 2+3)+ , (3, 3+4)+ , (4, 4+5)+ , (5, 5)+ ]+ + assertEqual mempty expectation $ windowing (\k -> k `to` (k + 1)) (Series.sum :: Series Vector Int Int -> Int) series++ test2 = testCase "rollingForwards" $ do+ let (series :: Series Vector Int Int) = fromStrictMap $ MS.fromList [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]+ expectation = fromStrictMap $ MS.fromList [ (1, 1+2+3)+ , (2, 2+3+4)+ , (3, 3+4+5)+ , (4, 4+5)+ , (5, 5)+ ]+ + assertEqual mempty expectation $ windowing (\k -> k `to` (k + 2)) (Series.sum :: Series Vector Int Int -> Int) series+++testWindowingRollingBackwards :: TestTree+testWindowingRollingBackwards = testGroup "Data.Series.Generic.windowing" [ test1, test2 ]+ where+ test1 = testCase "rollingForwards" $ do+ let (series :: Series Vector Int Int) = fromStrictMap $ MS.fromList [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]+ expectation = fromStrictMap $ MS.fromList [ (1, 1)+ , (2, 1+2)+ , (3, 2+3)+ , (4, 3+4)+ , (5, 4+5)+ ]+ + assertEqual mempty expectation $ windowing (\k -> (k-1) `to` k) (Series.sum :: Series Vector Int Int -> Int) series++ test2 = testCase "rollingForwards" $ do+ let (series :: Series Vector Int Int) = fromStrictMap $ MS.fromList [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]+ expectation = fromStrictMap $ MS.fromList [ (1, 1)+ , (2, 1+2)+ , (3, 1+2+3)+ , (4, 2+3+4)+ , (5, 3+4+5)+ ]+ + assertEqual mempty expectation $ windowing (\k -> (k-2) `to` k) (Series.sum :: Series Vector Int Int -> Int) series+++testPropAggregateVsfoldWith :: TestTree+testPropAggregateVsfoldWith + = testProperty "check that groupBy and testWindowingRollingForwards are equivalent" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 100) (Gen.int $ Range.linear (-500) 500) + let (xs :: Series Vector Int Int) = Series.fromList (zip [0::Int ..] ms)++ xs `groupBy` (`mod` 5) `aggregateWith` (Series.sum :: Series Vector Int Int -> Int) === xs `groupBy` (`mod` 5) `foldWith` (+)+++testExpanding :: TestTree+testExpanding = testCase "expanding" $ do+ let (xs :: Series Vector Char Int) = Series.fromList $ zip ['a', 'b', 'c', 'd'] [1::Int,2,3,4]+ rs = xs `expanding` Series.sum+ expectation = Series.fromList $ zip ['a', 'b', 'c', 'd'] [1,1+2,1+2+3,1+2+3+4]+ + assertEqual mempty expectation rs
+ test/Test/Data/Series/Generic/Definition.hs view
@@ -0,0 +1,206 @@++module Test.Data.Series.Generic.Definition (tests) where++import qualified Control.Foldl as Fold+import Data.Function ( on )+import Data.Functor.Identity ( Identity(..))+import Data.List ( nubBy, sortOn )+import qualified Data.Map.Strict as MS+import qualified Data.Map.Lazy as ML+import Data.Series.Generic ( Series, Occurrence, fromStrictMap, toStrictMap, fromLazyMap, toLazyMap, fromList, toList, fromVector, toVector )+import qualified Data.Series.Generic as Series+import Data.Vector ( Vector )+import qualified Data.Vector as Vector++import Hedgehog ( property, forAll, (===), tripping )+import qualified Hedgehog.Gen as Gen+import qualified Hedgehog.Range as Range++import Test.Tasty ( testGroup, TestTree ) +import Test.Tasty.Hedgehog ( testProperty )+import Test.Tasty.HUnit ( testCase, assertEqual )++tests :: TestTree+tests = testGroup "Data.Series.Generic.Definition" + [ testMappend+ , testPropMappendLikeMap+ , testPropShow+ , testFromStrictMap+ , testToStrictMap+ , testPropRoundtripConversionWithStrictMap+ , testPropRoundtripConversionWithLazyMap+ , testPropRoundtripConversionWithList+ , testPropFromListDuplicatesNeverDrops+ , testPropFromVectorDuplicatesNeverDrops+ , testPropFromVectorDuplicatesAndFromListDuplicatesHaveSameOrder+ , testPropRoundtripConversionWithVector+ , testPropVectorVsList+ , testFromLazyMap+ , testToLazyMap+ , testTakeWhile+ , testDropWhile+ , testFold+ ]+++testMappend :: TestTree+testMappend = testCase "(<>)" $ do+ let (s1 :: Series Vector Char Int) = fromList [('a', 1), ('b', 5)]+ (s2 :: Series Vector Char Int) = fromList [('b', 10), ('x', 25)]+ expectation = fromList [('a', 1), ('b', 5), ('x', 25)]+ + assertEqual mempty expectation (s1 <> s2)+++testPropMappendLikeMap :: TestTree+testPropMappendLikeMap + = testProperty "Mappend property similar to Data.Map.Strict" $ property $ do+ m1 <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.int (Range.linear 0 1000) <*> Gen.alpha)+ m2 <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.int (Range.linear 500 1500) <*> Gen.alpha)++ (fromStrictMap :: MS.Map Int Char -> Series Vector Int Char) (m1 <> m2) === fromStrictMap m1 <> fromStrictMap m2+++testPropShow :: TestTree+testPropShow+ = testProperty "Show is never too long" $ property $ do+ m1 <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.int (Range.linear 0 1000) <*> Gen.alpha)++ let (xs :: Series Vector Int Char) = fromStrictMap m1+ ls = lines $ show xs+ if Series.length xs > 6+ then length ls === 2 + 6 + 1+ else length ls === 2 + Series.length xs+++testFromStrictMap :: TestTree+testFromStrictMap = testCase "fromStrictMap" $ do+ -- Note the duplicate input at key 'a', which should disappear+ let input = MS.fromList [('b', 2), ('a', 1), ('a', 1)]+ (series :: Series Vector Char Int) = fromStrictMap input+ expectation = fromList [('a', 1), ('b', 2)]+ + assertEqual mempty series expectation+++testToStrictMap :: TestTree+testToStrictMap = testCase "toStrictMap" $ do+ let input = MS.fromList [('b', 2), ('a', 1)]+ (series :: Series Vector Char Int) = fromStrictMap input+ + assertEqual mempty (toStrictMap series) input+++testPropRoundtripConversionWithStrictMap :: TestTree+testPropRoundtripConversionWithStrictMap + = testProperty "Roundtrip property with Data.Map.Strict" $ property $ do+ ms <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.alpha)+ tripping ms (fromStrictMap :: MS.Map Char Char -> Series Vector Char Char) (Just . toStrictMap)+++testPropRoundtripConversionWithLazyMap :: TestTree+testPropRoundtripConversionWithLazyMap + = testProperty "Roundtrip property with Data.Map.Lazy" $ property $ do+ ms <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.alpha)+ tripping (ML.fromDistinctAscList $ MS.toAscList ms) (fromLazyMap :: MS.Map Char Char -> Series Vector Char Char) (Just . toLazyMap)+++testPropRoundtripConversionWithList :: TestTree+testPropRoundtripConversionWithList + = testProperty "Roundtrip property with List" $ property $ do+ xs <- forAll $ Gen.list (Range.linear 0 100) ((,) <$> Gen.int (Range.linear (-50) 50) <*> Gen.alpha)++ -- The property below needs some explanation.+ -- In case of conflicting keys, a Series will be biased like a Map. Therefore,+ -- the expected List won't have duplicated (hence the use of nubBy), but the elements which+ -- are kept are in the order of `reverse xs`.+ (toList :: Series Vector Int Char -> [(Int, Char)] ) (fromList xs) === sortOn fst (nubBy (\left right -> fst left == fst right) (reverse xs))+++testPropFromListDuplicatesNeverDrops :: TestTree+testPropFromListDuplicatesNeverDrops+ = testProperty "fromListDuplicates never drops elements" $ property $ do+ xs <- forAll $ Gen.list (Range.linear 0 100) ((,) <$> Gen.int (Range.linear (-10) 10) <*> Gen.alpha)+ Series.length (Series.fromListDuplicates xs :: Series Vector (Int, Occurrence) Char) === length xs+++testPropFromVectorDuplicatesNeverDrops :: TestTree+testPropFromVectorDuplicatesNeverDrops+ = testProperty "fromVectorDuplicates never drops elements" $ property $ do+ xs <- fmap Vector.fromList $ forAll $ Gen.list (Range.linear 0 100) ((,) <$> Gen.int (Range.linear (-10) 10) <*> Gen.alpha)+ Series.length (Series.fromVectorDuplicates xs :: Series Vector (Int, Occurrence) Char) === length xs+++testPropFromVectorDuplicatesAndFromListDuplicatesHaveSameOrder :: TestTree+testPropFromVectorDuplicatesAndFromListDuplicatesHaveSameOrder+ = testProperty "fromVectorDuplicates and fromListDuplicates are equivalent" $ property $ do+ xs <- fmap Vector.fromList $ forAll $ Gen.list (Range.linear 0 100) ((,) <$> Gen.int (Range.linear (-10) 10) <*> Gen.alpha)+ Series.fromVectorDuplicates xs === Series.fromListDuplicates (Vector.toList xs)+++testPropRoundtripConversionWithVector :: TestTree+testPropRoundtripConversionWithVector + = testProperty "Roundtrip property with Vector" $ property $ do+ xs <- forAll $ Gen.list (Range.linear 0 100) ((,) <$> Gen.int (Range.linear (-50) 50) <*> Gen.alpha)++ let (srs :: Series Vector Int Char) = fromList xs+ tripping srs toVector (Just . fromVector)+++testPropVectorVsList :: TestTree+testPropVectorVsList + = testProperty "building from a list or vector yields the same results" $ property $ do+ xs <- forAll $ Gen.list (Range.linear 0 100) ((,) <$> Gen.int (Range.linear (-50) 50) <*> Gen.alpha)+ -- Note that due to differences in sorting,+ -- Series.fromList and Series.fromVector . Vector.fromList + -- are not equivalent if the input list contains duplicate keys.+ let unique = nubBy ((==) `on` fst) xs + (fromList unique :: Series Vector Int Char) === fromVector (Vector.fromList unique)+++testFromLazyMap :: TestTree+testFromLazyMap = testCase "fromLazyMap" $ do+ let input = ML.fromList [('b', 2), ('a', 1)]+ (series :: Series Vector Char Int) = fromLazyMap input+ expectation = fromList [('a', 1), ('b', 2)]+ + assertEqual mempty series expectation+++testToLazyMap :: TestTree+testToLazyMap = testCase "toLazyMap" $ do+ let input = ML.fromList [('b', 2), ('a', 1)]+ (series :: Series Vector Char Int) = fromLazyMap input+ + assertEqual mempty (toLazyMap series) input+++testTakeWhile :: TestTree+testTakeWhile = testProperty "takeWhile behaves like lists" $ property $ do+ xs <- forAll $ Gen.list (Range.linear 0 100) (Gen.int (Range.linear (-50) 50))+ let (ys :: Series Vector Int Int) = Series.fromList $ zip [0..] xs++ n <- forAll $ Gen.int (Range.linear 1 10)+ Series.takeWhile (\v -> v `mod` n == 0) ys === Series.fromList (takeWhile (\(_, v) -> v `mod` n == 0) $ Series.toList ys)+++testDropWhile :: TestTree+testDropWhile = testProperty "dropWhile behaves like lists" $ property $ do+ xs <- forAll $ Gen.list (Range.linear 0 100) (Gen.int (Range.linear (-50) 50))+ let (ys :: Series Vector Int Int) = Series.fromList $ zip [0..] xs++ n <- forAll $ Gen.int (Range.linear 1 10)+ Series.dropWhile (\v -> v `mod` n /= 0) ys === Series.fromList (dropWhile (\(_, v) -> v `mod` n /= 0) $ Series.toList ys)+++testFold :: TestTree+testFold = testGroup "fold"+ [ testProperty "Series.sum and Control.Foldl.sum should be equivalent" $ property $ do+ xs <- forAll $ Gen.list (Range.linear 0 50) (Gen.int (Range.linear (-50) 50))+ let (ys :: Series Vector Int Int) = Series.fromList $ zip [0..] xs+ Series.fold Fold.sum ys === Series.sum ys+ , testProperty "FoldM Identity should be equivalent to a pure fold" $ property $ do+ xs <- forAll $ Gen.list (Range.linear 0 50) (Gen.int (Range.linear (-50) 50))+ let (ys :: Series Vector Int Int) = Series.fromList $ zip [0..] xs+ runIdentity (Series.foldM (Fold.generalize Fold.sum) ys) === Series.sum ys+ ]
+ test/Test/Data/Series/Generic/Numeric.hs view
@@ -0,0 +1,62 @@+module Test.Data.Series.Generic.Numeric (tests) where++import Data.Series.Generic ( Series, fromList, mean, variance, std)+import qualified Data.Series.Generic as Series+import Data.Vector ( Vector )+import qualified Data.Vector as Vector ++import Hedgehog ( property, forAll, (===), assert )+import qualified Hedgehog.Gen as Gen+import qualified Hedgehog.Range as Range++import qualified Statistics.Sample as Stats++import Test.Tasty ( testGroup, TestTree ) +import Test.Tasty.Hedgehog ( testProperty )+import Test.Utils ( approx )+++tests :: TestTree+tests = testGroup "Data.Series.Generic.Numeric" [ testPropMean+ , testPropVariance+ , testPropStdDev+ ]+++testPropMean :: TestTree+testPropMean + = testProperty "mean" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 100) (Gen.double $ Range.linearFrac (-500) 500) + let (xs :: Series Vector Int Double) = fromList (zip [0::Int ..] ms)+ Series.length xs === length ms + let m :: Double = Series.fold mean xs+ -- Stats.mean of an empty vector is NaN, but is 0 for Control.Foldl.mean+ case Series.length xs of+ 0 -> m === 0 + _ -> m `approx` Stats.mean (Vector.fromList ms)+++testPropVariance :: TestTree+testPropVariance+ = testProperty "population variance" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 100) (Gen.double $ Range.linearFrac (-500) 500) + let (xs :: Series Vector Int Double) = fromList (zip [0::Int ..] ms)+ Series.length xs === length ms + let v :: Double = Series.fold variance xs+ -- IEEE 754 specifies that NaN != NaN...+ case Series.length xs of+ 0 -> assert $ isNaN v+ _ -> v `approx` Stats.fastVariance (Vector.fromList ms)+++testPropStdDev :: TestTree+testPropStdDev+ = testProperty "population standard deviation" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 100) (Gen.double $ Range.linearFrac (-500) 500) + let (xs :: Series Vector Int Double) = fromList (zip [0::Int ..] ms)+ Series.length xs === length ms + let d :: Double = Series.fold std xs+ -- IEEE 754 specifies that NaN != NaN...+ case Series.length xs of+ 0 -> assert $ isNaN d+ _ -> d `approx` Stats.fastStdDev (Vector.fromList ms)
+ test/Test/Data/Series/Generic/View.hs view
@@ -0,0 +1,143 @@+module Test.Data.Series.Generic.View (tests) where++import qualified Data.Map.Strict as MS+import Data.Series.Generic ( Series, index, fromStrictMap, fromList, to, from, upto, select+ , selectWhere, require, mapIndex, argmax, argmin, )+import qualified Data.Series.Index as Index+import Data.Vector ( Vector )++import Hedgehog ( property, forAll, (===), assert )+import qualified Hedgehog.Gen as Gen+import qualified Hedgehog.Range as Range++import Test.Tasty ( testGroup, TestTree )+import Test.Tasty.Hedgehog ( testProperty )+import Test.Tasty.HUnit ( testCase, assertEqual )++tests :: TestTree+tests = testGroup "Data.Series.Generic.View" [ testSelectRange+ , testSelectUnboundedRange+ , testSelectUnboundedRangeEquivalence+ , testSelectRangeEmptyRange+ , testPropSelectRangeSubseries+ , testSelectSet + , testPropSelectSetSubseries+ , testSelectWhere+ , testPropRequire+ , testMapIndex+ , testArgmax+ , testArgmin+ ]+++testSelectRange :: TestTree+testSelectRange = testCase "from ... to ..." $ do+ let (series :: Series Vector Char Int) = fromStrictMap $ MS.fromList [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5)]+ subSeries = series `select` ('b' `to` 'd')+ expectation = fromStrictMap $ MS.fromList [('b', 2), ('c', 3), ('d', 4)]+ assertEqual mempty expectation subSeries+++testSelectUnboundedRange :: TestTree+testSelectUnboundedRange = testCase "from and upto" $ do+ let (series :: Series Vector Char Int) = fromStrictMap $ MS.fromList [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5)]+ openLeftsubSeries = series `select` from 'b'+ openLeftExpectation = fromStrictMap $ MS.fromList [('b', 2), ('c', 3), ('d', 4), ('e', 5)]+ assertEqual mempty openLeftExpectation openLeftsubSeries++ let openRightsubSeries = series `select` upto 'b'+ openRightExpectation = fromStrictMap $ MS.fromList [('a', 1), ('b', 2)]+ assertEqual mempty openRightExpectation openRightsubSeries+++testSelectUnboundedRangeEquivalence :: TestTree+testSelectUnboundedRangeEquivalence + = testProperty "Combining unbounded ranges is equivalent to a bounded range" + $ property $ do+ m1 <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.int (Range.linear 0 1000))+ (b1, b2) <- (,) <$> forAll Gen.alpha <*> forAll Gen.alpha+ let start = min b1 b2+ end = max b1 b2+ (xs :: Series Vector Char Int) = fromStrictMap m1++ (xs `select` start `to` end) === ( (xs `select` from start) `select` upto end)+++testPropSelectRangeSubseries :: TestTree+testPropSelectRangeSubseries = testProperty "xs `select` <x> `to` <y> always returns a proper subseries" $ property $ do+ m1 <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.int (Range.linear 0 1000))+ start <- forAll Gen.alpha+ end <- forAll Gen.alpha+ let (xs :: Series Vector Char Int) = fromStrictMap m1+ ys = xs `select` start `to` end+ + assert $ index xs `Index.contains` index ys+++testSelectRangeEmptyRange :: TestTree+testSelectRangeEmptyRange = testCase "from ... to ... on an empty `Range``" $ do+ let (series :: Series Vector Char Int) = fromStrictMap $ MS.fromList [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5)]+ subSeries = series `select` ('f' `to` 'z')+ assertEqual mempty mempty subSeries+++testSelectSet :: TestTree+testSelectSet = testCase "select" $ do+ let (series :: Series Vector Char Int) = fromStrictMap $ MS.fromList [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5)]+ subSeries = series `select` Index.fromList ['a', 'd', 'x']+ expectation = fromStrictMap $ MS.fromList [('a', 1), ('d', 4)]+ + assertEqual mempty expectation subSeries+++testPropSelectSetSubseries :: TestTree+testPropSelectSetSubseries = testProperty "xs `select` <some set> always returns a proper subseries" $ property $ do+ m1 <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.int (Range.linear 0 1000))+ selection <- forAll $ Gen.set (Range.linear 0 10) Gen.alpha+ let (xs :: Series Vector Char Int) = fromStrictMap m1+ ys = xs `select` selection+ + assert $ index xs `Index.contains` index ys+++testSelectWhere :: TestTree+testSelectWhere = testCase "selectWhere" $ do+ let (series :: Series Vector Char Int) = fromStrictMap $ MS.fromList [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5)]+ subSeries = series `selectWhere` fmap (>3) series + expectation = fromStrictMap $ MS.fromList [('d', 4), ('e', 5)]+ + assertEqual mempty expectation subSeries+++testPropRequire :: TestTree+testPropRequire = testProperty "require always returns a series with the expected index" $ property $ do+ m1 <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.int (Range.linear 0 1000) <*> Gen.int (Range.linear 0 1000))+ ss <- forAll $ Gen.set (Range.linear 0 100) (Gen.int (Range.linear (-100) 100))+ + let (xs :: Series Vector Int Int) = fromStrictMap m1+ ix = Index.fromSet ss+ index (xs `require` ix) === ix +++testMapIndex :: TestTree+testMapIndex = testCase "mapIndex" $ do+ let (series :: Series Vector String Int) = fromList [("aa", 1), ("ab", 2), ("bb", 3), ("bc", 4), ("c", 5)]+ subSeries = series `mapIndex` take 1+ expectation = fromList [("a", 1), ("b", 3), ("c", 5)]+ + assertEqual mempty expectation subSeries+++testArgmax :: TestTree+testArgmax = testCase "argmax" $ do+ let (series :: Series Vector String Int) = fromList [("aa", 1), ("ab", 2), ("bb", 10), ("bc", 4), ("c", 5)]+ expectation = Just "bb"+ + assertEqual mempty expectation (argmax series)++testArgmin :: TestTree+testArgmin = testCase "argmin" $ do+ let (series :: Series Vector String Int) = fromList [("aa", 1), ("ab", 2), ("bb", -10), ("bc", 4), ("c", 5)]+ expectation = Just "bb"+ + assertEqual mempty expectation (argmin series)
+ test/Test/Data/Series/Generic/Zip.hs view
@@ -0,0 +1,147 @@++module Test.Data.Series.Generic.Zip ( tests ) where+++import Control.Monad ( forM_ )++import Data.Maybe ( fromJust, isNothing )+import Data.Monoid ( Sum(..) )+import Data.Series.Generic ( Series(index), mapStrategy+ , fromStrictMap, fromList, zipWith, select, at, replace, (|->), (<-|)+ )+import qualified Data.Series.Generic as Series+import qualified Data.Series.Index as Index +import Data.Vector ( Vector )++import Hedgehog ( property, forAll, (===), assert )+import qualified Hedgehog.Gen as Gen+import qualified Hedgehog.Range as Range++import Prelude hiding ( zipWith )++import Test.Tasty ( testGroup, TestTree ) +import Test.Tasty.Hedgehog ( testProperty )+import Test.Tasty.HUnit ( testCase, assertEqual )++tests :: TestTree+tests = testGroup "Data.Series.Generic.Zip" [ testZipWith+ , testPropZipWithMatched+ , testPropZipWithMatchedAndZipWithMonoid+ , testPropZipWith+ , testPropReplace+ , testPropReplaceInfix+ , testPropZipWithStrategySkipStrategy+ , testMapStrategy+ ]+++testZipWith :: TestTree+testZipWith = testCase "zipWith" $ do+ let (s1 :: Series Vector Char Int) = fromList [('a', 1), ('b', 5)]+ (s2 :: Series Vector Char Int) = fromList [('x', 25), ('b', 10)]+ expectation = fromList [('a', Nothing), ('b', Just 15), ('x', Nothing)]+ + assertEqual mempty expectation (zipWith (+) s1 s2)+++testPropZipWithMatched :: TestTree+testPropZipWithMatched + = testProperty "zipWith when keys all match" $ property $ do+ m1 <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.int (Range.linear 0 1000))+ let (xs :: Series Vector Char Int) = fromStrictMap m1+ zipWith (+) xs xs === fmap (Just . (*2)) xs+++testPropZipWithMatchedAndZipWithMonoid :: TestTree+testPropZipWithMatchedAndZipWithMonoid + = testProperty "zipWithMonoid and zipWithStrategy give compatible results" $ property $ do+ m1 <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.int (Range.linear 0 1000))+ m2 <- forAll $ Gen.map (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.int (Range.linear 0 1000))+ let (xs :: Series Vector Char (Sum Int)) = Series.map Sum $ fromStrictMap m1+ (ys :: Series Vector Char (Sum Int)) = Series.map Sum $ fromStrictMap m2++ expectation = Series.zipWithStrategy (<>) (mapStrategy id) (mapStrategy id) xs ys+ + expectation === Series.zipWithMonoid (<>) xs ys++++testPropZipWith :: TestTree+testPropZipWith + = testProperty "zipWith when keys all match" $ property $ do+ m1 <- forAll $ Gen.map (Range.linear 0 100) ((,) <$> Gen.string (Range.singleton 2) Gen.alpha <*> Gen.int (Range.linear 0 1000))+ m2 <- forAll $ Gen.map (Range.linear 0 100) ((,) <$> Gen.string (Range.singleton 2) Gen.alpha <*> Gen.int (Range.linear 0 1000))+ let (x1 :: Series Vector String Int) = fromStrictMap m1+ x2 = fromStrictMap m2+ common = index x1 `Index.intersection` index x2+ symdiff = (index x1 `Index.union` index x2) `Index.difference` common+ comb = zipWith (+) x1 x2++ forM_ common $ \k -> do+ let left = fromJust $ x1 `at` k+ right = fromJust $ x2 `at` k+ fromJust (comb `at` k) === Just (left + right)+ + assert $ all isNothing $ Series.values (comb `select` symdiff)+++testPropReplace :: TestTree+testPropReplace + = testProperty "replace" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 10 100) (Gen.int $ Range.linear (-500) 500) + ns <- forAll $ Gen.list (Range.linear 0 10) (Gen.int $ Range.linear (-500) 500) + ixs <- forAll $ Gen.list (Range.singleton $ length ns) (Gen.int $ Range.linear 0 150)+ let (xs :: Series Vector Int Int) = fromList (zip ixs ms)+ ys = fromList (zip [0..] ns)+ rs = ys `replace` xs++ index rs === index xs++ let commonKeys = index xs `Index.intersection` index ys++ (rs `select` commonKeys) === (ys `select` commonKeys)+++testPropReplaceInfix :: TestTree+testPropReplaceInfix + = testProperty "(|->) and (<-|)" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 10 100) (Gen.int $ Range.linear (-500) 500) + ns <- forAll $ Gen.list (Range.linear 0 10) (Gen.int $ Range.linear (-500) 500) + ixs <- forAll $ Gen.list (Range.singleton $ length ns) (Gen.int $ Range.linear 0 150)+ let (xs :: Series Vector Int Int) = fromList (zip ixs ms)+ ys = fromList (zip [0..] ns)+ rs = ys `replace` xs+ + ys |-> xs === rs + ys |-> xs === xs <-| ys +++testPropZipWithStrategySkipStrategy :: TestTree+testPropZipWithStrategySkipStrategy + = testProperty "zipWithStrategy f skipStrategy skipStrategy is equivalent to zipWithMatched" $ property $ do+ m1 <- forAll $ Gen.map (Range.linear 0 100) ((,) <$> Gen.string (Range.singleton 2) Gen.alpha <*> Gen.int (Range.linear 0 1000))+ m2 <- forAll $ Gen.map (Range.linear 0 100) ((,) <$> Gen.string (Range.singleton 2) Gen.alpha <*> Gen.int (Range.linear 0 1000))++ let (xs :: Series Vector String Int) = fromStrictMap m1+ ys = fromStrictMap m2++ expectation = Series.zipWithMatched (+) xs ys+ + expectation === Series.zipWithStrategy (+) Series.skipStrategy Series.skipStrategy xs ys+++testMapStrategy :: TestTree+testMapStrategy + = testCase "mapStrategy works as expected" $ do+ let (xs :: Series Vector Int Int) = Series.fromList $ zip [0..] [1,2,3,4,5]+ ys = Series.fromList $ zip [3..] [3,4,5]+ + expected = Series.fromList [ (0, 1+1)+ , (1, 2+1)+ , (2, 3+1)+ , (3, 4+3)+ , (4, 5+4)+ , (5, 5*2)+ ]++ assertEqual mempty expected $ Series.zipWithStrategy (+) (mapStrategy (+1)) (mapStrategy (*2)) xs ys
+ test/Test/Data/Series/Index.hs view
@@ -0,0 +1,113 @@++module Test.Data.Series.Index (tests) where++import qualified Data.Series.Index as Index+import qualified Data.Series.Index.Internal as Index.Internal+import qualified Data.Set as Set+import qualified Data.Vector as Vector++import Hedgehog ( property, forAll, tripping, assert, (===) )+import qualified Hedgehog.Gen as Gen+import qualified Hedgehog.Range as Range+++import Test.Tasty ( testGroup, TestTree ) +import Test.Tasty.Hedgehog ( testProperty )+++tests :: TestTree+tests = testGroup "Data.Series.Index" [ testPropRange+ , testPropFromToSet+ , testPropFromToList+ , testPropFromToAscList+ , testPropFromToVector+ , testPropFromToAscVector+ , testPropMemberNotMember+ , testPropFilter+ ]+++testPropRange :: TestTree+testPropRange = testProperty "range always includes the start, and all elements less than/equal to end" $ property $ do+ start <- forAll $ Gen.int (Range.linear 0 50)+ end <- forAll $ Gen.int (Range.linear 51 100)+ step <- forAll $ Gen.int (Range.linear 1 5)++ let ix = Index.range (+step) start end ++ assert $ start `Index.member` ix+ assert $ maximum ix <= end++ if (end - start) `mod` step == 0+ then assert (end `Index.member` ix)+ else assert (end `Index.notMember` ix)+++testPropFromToSet :: TestTree+testPropFromToSet = testGroup "conversion to/from Set" + [ testProperty "fromSet / toSet" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.alpha)+ tripping (Set.fromList ms) Index.fromSet (Just . Index.toSet)+ , testProperty "toIndex / fromIndex" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.alpha)+ tripping (Set.fromList ms) (Index.toIndex :: Set.Set (Char, Char) -> Index.Index (Char, Char)) (Just . Index.fromIndex)+ ]+++testPropFromToList :: TestTree+testPropFromToList = testGroup "conversion to/from list" + [ testProperty "fromList / toAscList" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.alpha)+ let index = Index.fromList ms+ tripping index (reverse . Index.toAscList) (Just . Index.fromList)+ , testProperty "toIndex / fromIndex" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.alpha)+ let index = Index.toIndex ms :: Index.Index (Char, Char)+ tripping index (reverse . Index.fromIndex) (Just . (Index.toIndex :: [(Char, Char)] -> Index.Index (Char, Char)))+ ]+++testPropFromToAscList :: TestTree+testPropFromToAscList = testProperty "fromAscList / toAscList" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.alpha)+ let index = Index.fromList ms+ tripping index Index.toAscList (Just . Index.Internal.fromAscList)+++testPropFromToVector :: TestTree+testPropFromToVector = testGroup "conversion to/from Vector"+ [ testProperty "fromVector / toAscVector" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.alpha)+ let index = Index.fromList ms+ tripping index (Vector.reverse . Index.toAscVector) (Just . Index.fromVector)+ , testProperty "toIndex / fromIndex" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.alpha)+ let index = Index.toIndex ms :: Index.Index (Char, Char)+ tripping index (Vector.reverse . Index.fromIndex) (Just . (Index.toIndex :: Vector.Vector (Char, Char) -> Index.Index (Char, Char)))+ ]+++testPropFromToAscVector :: TestTree+testPropFromToAscVector = testProperty "fromAscVector / toAscVector" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 50) ((,) <$> Gen.alpha <*> Gen.alpha)+ let index = Index.fromList ms+ tripping index (Index.toAscVector :: Index.Index (Char, Char) -> Vector.Vector (Char, Char)) (Just . Index.Internal.fromAscVector)+++testPropMemberNotMember :: TestTree+testPropMemberNotMember = testProperty "elements are either a member or not a member of the index" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 50) (Gen.int (Range.linear (-100) 100))+ k <- forAll $ Gen.int (Range.linear (-100) 100)++ let ix = Index.fromList ms+ assert $ (k `Index.member` ix) /= (k `Index.notMember` ix)+++testPropFilter :: TestTree+testPropFilter = testProperty "filter works just like for Sets" $ property $ do+ ms <- forAll $ Gen.list (Range.linear 0 50) (Gen.int (Range.linear (-100) 100))++ let ss = Set.fromList ms+ ix = Index.fromSet ss+ + Index.fromSet (Set.filter even ss) === Index.filter even ix
+ test/Test/Utils.hs view
@@ -0,0 +1,13 @@++module Test.Utils ( approx ) where++import Data.AEq ( AEq((~==)))+import Hedgehog ( MonadTest, diff )+import Hedgehog.Internal.Source ( HasCallStack, withFrozenCallStack ) +++-- | Fails the test if the two arguments provided are not equal to within `epsilon`.+approx :: (MonadTest m, AEq a, Show a, HasCallStack) => a -> a -> m ()+approx x y =+ withFrozenCallStack $+ diff x (~==) y