You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use Deedle package in C# and it seems it is written mostly in F# and last update was in 2016.
I came around to this function
//
// Summary:
// Performs sampling by time and aggregates chunks obtained by time-sampling into
// a single value using a specified function. The operation generates keys starting
// at the first key in the source series, using the specified `interval` and then
// obtains chunks based on these keys in a fashion similar to the `Series.resample`
// function. ## Parameters - `series` - An input series to be resampled - `interval`
// - The interval between the individual samples - `dir` - If this parameter is
// `Direction.Forward`, then each key is used as the smallest key in a chunk; for
// `Direction.Backward`, the keys are used as the greatest keys in a chunk. - `aggregate`
// - A function that is called to aggregate each chunk into a single value. ## Remarks
// This operation is only supported on ordered series. The method throws `InvalidOperationException`
// when the series is not ordered. [category:Lookup, resampling and scaling]
public static Series<DateTime, object> SampleInto<V>(this Series<DateTime, V> series, TimeSpan interval, Direction dir, Func<DateTime, FSharpFunc<Series<DateTime, V>, object>> aggregate);
and I could not in any way make aggregate work! This is the only logical one I can think of :
var rows_en = Enumerable.Range(1,10).Select(i =>
{
var sb = new SeriesBuilder<string>();
sb.Add("Date", DateTime.Now.AddHours(i));
return KeyValue.Create(i, sb.Series);
}
);
var df = Frame.FromRows(rows_en);
var df2 = df.IndexRows<DateTime>("Date").SortRowsByKey();
df2.Rows.SampleInto(TimeSpan.FromHours(0.5),Direction.Backward, (a) => {
return FuncConvert.ToFSharpFunc<Series<DateTime, ObjectSeries<string>>>( (V) => { ; });
}).Print();
But researching problem in internet I also came to #1254 which mentioned following syntaxes as working :
Converter<int, int> func = x => x + 1;
FSharpFunc<int, int> fsfunc = func;
error is
Error CS0029 Cannot implicitly convert type 'System.Converter<int, int>' to Microsoft.FSharp.Core.FSharpFunc<int, int>'
and also mentioned this one should work
FSharpFunc<int, int> func = (Converter<int,int>)(x => x + 1);
and error is same as before.
I am using a .Net Core 2.0 and C# 7.2
The text was updated successfully, but these errors were encountered:
@dsyme it is not updated. but you can reference any full .net from .net core and it should work.
I solved my problem by referencing v3 fsharp core files. But obviously there is a problem.
I am trying to use Deedle package in C# and it seems it is written mostly in F# and last update was in 2016.
I came around to this function
and I could not in any way make aggregate work! This is the only logical one I can think of :
But researching problem in internet I also came to #1254 which mentioned following syntaxes as working :
error is
and also mentioned this one should work
and error is same as before.
I am using a .Net Core 2.0 and C# 7.2
The text was updated successfully, but these errors were encountered: