Tag: deedle

如何使用Excel的date作为键索引一个Deedle框架?

假设我给了一个“date”列,其值为03/10/86,06/10/86,07/10/86等。 这并不像Frame.indexRowsDate("Date")那么简单。 我目前的解决scheme是在Excel 3额外的列上创build: 年 月 天 值: =年份(A2) =月(A2) =日(A2) (对于第2行,其中A是具有date的列) 然后使用这个function: let toDateTime (os:ObjectSeries<_>) = let year = (os.Get "Year") :?> int) let month = (os.Get "Month" :?> int) let day = (os.Get "Day" :?> int) DateTime(year,month,day) Frame.indexRowsUsing toDateTime frame 解决scheme鉴于提供的答案,新的toDateTime看起来像这样: let toDateTime (os:ObjectSeries<_>) = DateTime.Parse((os.Get "Date") :?> string)

将deedle框架复制到excel

我的目标是有效地复制一个骗子框架 ,在F#中擅长。 我从来没有从F#的excel工作。 我受到这个教程的启发。 这是我的代码: #r "Microsoft.Office.Interop.Excel" open Microsoft.Office.Interop.Excel /// Export data frame to excel let exportFrameToExcel (frame: Frame<DateTime, string>) (x,y) = // Run Excel as a visible application let app = new ApplicationClass(Visible = true) // Create new file and get the first worksheet let workbook = app.Workbooks.Add(XlWBATemplate.xlWBATWorksheet) // Note that worksheets are indexed […]