Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResampleUniform with missing values raises exception #480

Closed
zyzhu opened this issue Aug 28, 2019 · 0 comments
Closed

ResampleUniform with missing values raises exception #480

zyzhu opened this issue Aug 28, 2019 · 0 comments

Comments

@zyzhu
Copy link
Contributor

zyzhu commented Aug 28, 2019

The following test case with missing values failed:

  let input = [
    DateTime(2019,1,1), 1.0
    DateTime(2019,1,3), nan
    DateTime(2019,1,5), 3.0] |> series
  let expected = [
    DateTime(2019,1,1), 1.0
    DateTime(2019,1,2), 1.0
    DateTime(2019,1,3), nan
    DateTime(2019,1,4), nan
    DateTime(2019,1,5), 3.0] |> series
  let actual =
    SeriesExtensions.ResampleUniform(
      input, (fun (dt:DateTime) -> dt.Date), (fun dt -> dt.AddDays(1.0)))
  actual |> shouldEqual expected

Error message

Deedle.MissingValueException: Value at the key 1/3/2019 12:00:00 AM is missing
   at Deedle.Series`2.Get(K key)
   at Deedle.Series`2.get_Item(K a)
   at [email protected](K2 k)
   at [email protected](K k, FSharpOption`1 _arg1)
   at [email protected](KeyValuePair`2 kvp)
   at <StartupCode$Deedle>[email protected](IVectorLocation loc, OptionalValue`1 value)
   at <StartupCode$Deedle>[email protected](OptionalValue`1 arg10)
   at <StartupCode$Deedle>[email protected](Int32 i, OptionalValue`1 v)
   at Microsoft.FSharp.Collections.ArrayModule.MapIndexed[T,TResult](FSharpFunc`2 mapping, T[] array)
   at Deedle.Vectors.ArrayVector.ArrayVector`1.Deedle-IVector`1-Select[TNewValue](FSharpFunc`2 f)
   at Deedle.Series`2.SelectOptional[R](Func`2 f)
   at Deedle.SeriesModule.MapAll[K,T,R](FSharpFunc`2 f, Series`2 series)
   at Deedle.SeriesModule.FillMissingUsing[K,T](FSharpFunc`2 f, Series`2 series)
   at Deedle.SeriesModule.resampleUniformInto[K1,K2,V,a](Lookup fillMode, FSharpFunc`2 keyProj, FSharpFunc`2 nextKey, FSharpFunc`2 f, Series`2 series)
   at Deedle.SeriesExtensions.ResampleUniform[K,V,a](Series`2 series, Func`2 keyProj, Func`2 nextKey)
   at <StartupCode$FSI_0005>.$FSI_0005.main@() in C:\FSharp\zyzhu\Deedle\tests\Deedle.Tests\Series.fs:line 559
Stopped due to error
@zyzhu zyzhu closed this as completed Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant