本文整理汇总了C#中Series.RemoveMissing方法的典型用法代码示例。如果您正苦于以下问题:C# Series.RemoveMissing方法的具体用法?C# Series.RemoveMissing怎么用?C# Series.RemoveMissing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Series
的用法示例。
在下文中一共展示了Series.RemoveMissing方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DailyMax
public static Series DailyMax(Series source)
{
Series rval = source.Clone();
source.RemoveMissing(true);
if (source.Count > 0)
{
Point max = source[0];
max.DateTime = max.DateTime.Date; // force to 00:00
for (int i = 0; i < source.Count; i++)
{
Point a = source[i];
a.DateTime = a.DateTime.Date;
if (max.DateTime.Date != a.DateTime.Date)
{
rval.Add(max);
max = a;
}
else if (a.Value > max.Value)
{
max.Value = a.Value;
}
if (i == source.Count - 1)
{
rval.Add(max);
}
}
}
rval.TimeInterval = TimeInterval.Daily;
return rval;
}
示例2: DailyMin
public static Series DailyMin(Series source)
{
// return DailySubsetCalculator(source, Math.Min);
Series rval = source.Clone();
source.RemoveMissing(true);
if (source.Count > 0)
{
Point min = source[0];
min.DateTime = min.DateTime.Date;
for (int i = 0; i < source.Count; i++)
{
Point a = source[i];
a.DateTime = a.DateTime.Date;
if (min.DateTime.Date != a.DateTime.Date)
{
rval.Add(min);
min = a;
}
else if (a.Value < min.Value)
{
min.Value = a.Value;
}
if (i == source.Count - 1)
{
rval.Add(min);
}
}
}
rval.TimeInterval = TimeInterval.Daily;
return rval;
}
示例3: DailyAverage
public static Series DailyAverage(Series s, DateTime t1, DateTime t2)
{
// remove missing values
s.RemoveMissing(true);
if (s.Count == 0)
{
return new Series(s.Units, TimeInterval.Daily);
}
DateTime time = t1;
Series rval = new Series(s.Units, TimeInterval.Daily);
rval.HasFlags = true;
rval.Name = "Daily Average " + s.Name;
while (time <= t2)
{// Console.WriteLine("Avg("+time.ToShortDateString()+")");
rval.Add(TimeWeightedAverageForDay(s, time));
time = time.AddDays(1);
}
return rval;
}