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
using Deedle;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Bug1
{
class Program
{
static IEnumerable<DateTime> dateRange(DateTime first, int count)
{
return from days in Enumerable.Range(0, count) select first.AddDays(days);
}
static IEnumerable<double> rand(int count)
{
var rnd = new Random();
return from i in Enumerable.Range(0, count) select rnd.NextDouble();
}
static void Main(string[] args)
{
var dates = new DateTime[] { new DateTime(2013, 1, 1), new DateTime(2013, 1, 4), new DateTime(2013, 1, 8)};
var values = new double[] { 10.0, 20.0, 30.0 };
var first = new Series<DateTime, double>(dates, values);
var second = new Series<DateTime, double>(dateRange(new DateTime(2013, 1, 1), 10), rand(10));
var third = new Series<DateTime, double>(dateRange(new DateTime(2013, 1, 1), 10),
new double[] { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 });
var df1 = Frame.FromColumns(
new KeyValuePair<string, Series<DateTime, double>>[] {
new KeyValuePair<string, Series<DateTime, double>>("first", first),
new KeyValuePair<string, Series<DateTime, double>>("second", second),
new KeyValuePair<string, Series<DateTime, double>>("third", third) });
df1.Print();
// df1.AggregateRowsBy<double, double>(new string[] { "first" }, new string[] { "second" }, Stats.mean).Print();
// df1.AggregateRowsBy<double, double>(new string[] { "third" }, new string[] { "second" }, Stats.mean).Print();
df1.AggregateRowsBy<double, double>(new string[] { "first", "third" }, new string[] { "second" }, Stats.mean).Print();
}
}
}
The following program
results in
Looks like the first and third series are mixed up. Is this expected behaviour?
The text was updated successfully, but these errors were encountered: