From 07499f70de386698aa48e95af5ef32f776815387 Mon Sep 17 00:00:00 2001 From: wangfeng Date: Tue, 28 Feb 2023 07:15:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index e82b99d..ea409fa 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( gitee.com/quant1x/data v0.7.16 github.com/chewxy/math32 v1.10.1 github.com/huandu/go-clone v1.4.1 - github.com/mymmsc/gox v1.3.8 + github.com/mymmsc/gox v1.3.9 github.com/olekukonko/tablewriter v0.0.5 github.com/shirou/gopsutil/v3 v3.23.1 github.com/tealeg/xlsx v1.0.5 @@ -18,7 +18,7 @@ require ( ) require ( - gitee.com/quant1x/gotdx v1.2.3 // indirect + gitee.com/quant1x/gotdx v1.2.5 // indirect github.com/dlclark/regexp2 v1.7.0 // indirect github.com/dop251/goja v0.0.0-20230216180835-5937a312edda // indirect github.com/frankban/quicktest v1.11.2 // indirect diff --git a/go.sum b/go.sum index b955b64..748e256 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ gitee.com/quant1x/data v0.7.16 h1:QYJcg/sAowoumurMDLDl7MsDFVNGc0w+57UCNwZMhrI= gitee.com/quant1x/data v0.7.16/go.mod h1:9xgfw26RyhtjKml+C1tcU2sBWT+PxIXYZ1EJajbAuCA= -gitee.com/quant1x/gotdx v1.2.3 h1:JHKfZL52tfrEnFJ+tzATUaAEIsHQNjywM6zWCpbdtsg= -gitee.com/quant1x/gotdx v1.2.3/go.mod h1:+1sjU0yMgkW1JGcbYjPIaNwR7CmE0oS+1ZaIePp0LQA= +gitee.com/quant1x/gotdx v1.2.5 h1:zPbAPyLRg0uRv9bLziEV5EPoO5PBwffbkKQzI1yuDgA= +gitee.com/quant1x/gotdx v1.2.5/go.mod h1:lOJYzC4mcKmeHpm1L5jl94S0pPifue1sf9JMTP2kmho= github.com/chewxy/math32 v1.10.1 h1:LFpeY0SLJXeaiej/eIp2L40VYfscTvKh/FSEZ68uMkU= github.com/chewxy/math32 v1.10.1/go.mod h1:dOB2rcuFrCn6UHrze36WSLVPKtzPMRAQvBvUwkSsLqs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -45,8 +45,8 @@ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2 github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mymmsc/gox v1.3.8 h1:OEom0fY5SlPGf4GAX9T83L2cBx1bQCx1pD6R6NtQTKs= -github.com/mymmsc/gox v1.3.8/go.mod h1:KAD7bkNM7N24gNCuR7YsmKe1cJLZ5o5x885uctG5mw0= +github.com/mymmsc/gox v1.3.9 h1:8o06xvA8lEGj0PGdLri1qE94gODiCSnoNoezgKx1qFM= +github.com/mymmsc/gox v1.3.9/go.mod h1:KAD7bkNM7N24gNCuR7YsmKe1cJLZ5o5x885uctG5mw0= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -- Gitee From e97434b190f22d11b9fcc9204de8eaf5d60e7e9e Mon Sep 17 00:00:00 2001 From: wangfeng Date: Tue, 28 Feb 2023 08:12:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?#I6I6T7=20=E4=BF=AE=E5=A4=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=B6=85=E8=BF=87=E6=9C=80=E5=B0=8F=E8=A1=8C=E6=95=B0?= =?UTF-8?q?=E6=97=B6=E7=9C=81=E7=95=A5=E5=8F=B7=E4=B9=9F=E5=8D=A01?= =?UTF-8?q?=E4=B8=AA=E8=A1=8C=E5=8F=B7=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dataframe_test.go | 2 +- dataframe_xstring.go | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dataframe_test.go b/dataframe_test.go index 51a051c..a739b6c 100644 --- a/dataframe_test.go +++ b/dataframe_test.go @@ -36,7 +36,7 @@ func TestLoadStructs(t *testing.T) { } func TestDataFrame_Concat(t *testing.T) { - d1 := []float64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} + d1 := []float64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} s1 := NewNDFrame[float64]("x", d1...) df1 := NewDataFrame(s1) d2 := []float64{101, 102} diff --git a/dataframe_xstring.go b/dataframe_xstring.go index c5084e8..78fbd08 100644 --- a/dataframe_xstring.go +++ b/dataframe_xstring.go @@ -72,14 +72,18 @@ func (self DataFrame) print( } // Add the row numbers + rowNumbersOffset := 0 for i := 0; i < nTotal+1; /*self.nrows+1*/ i++ { add := "" - if i == 0 || (i == nMinRows+1 && shortening) { + if i == 0 { // 跳过 + } else if i == nMinRows+1 && shortening { + // 跳过 + rowNumbersOffset -= 1 } else if i < nMinRows+1 { - add = strconv.Itoa(i-1) + ":" + add = strconv.Itoa(i-1+rowNumbersOffset) + ":" } else { - add = strconv.Itoa(nrows-maxRows+i-1) + ":" + add = strconv.Itoa(nrows-maxRows+i-1+rowNumbersOffset) + ":" } //fmt.Println(i) records[i] = append([]string{add}, records[i]...) -- Gitee