就像在python2中一样,我做了以下事情:
import numpy as np
print (np.linspace(2, 3, 4))
收到错误:
AttributeError:module' numpy'没有属性' linspace'`
那么我在哪里可以找到linspace()
答案 0 :(得分:0)
@Abdou var summary = (
from p in db.CP_SDV_Acc
where p.Scandate >= start && p.EndDate <= end && p.Device==divice
let k = new
{
//try this if you need a date field
// p.SaleDate.Date.AddDays(-1 *p.SaleDate.Day - 1)
Device = p.Device,
}
group p by k into t
select new OeeRecovery
{
Device = t.Key.Device,
GoodPcs = t.Sum(p => p.GoodPcs),
BadPcs=t.Sum(p=>p.BadPcs),
Oee =(decimal)(t.Sum(p => p.GoodPcs)- t.Sum(p => p.BadPcs)) / t.Sum(p => p.GoodPcs),
WorkTime = t.Sum(x=>new TimeSpan(x.EndDate-x.Scandate).TotalMilliseconds??TimeSpan.Zero)
//t.Sum(new TimeSpan( p => p.EndDate - p.Scandate))
//t.Aggregate(TimeSpan.Zero, (total, it) =>total += (it.EndDate-it.Scandate)),
}).ToList();