Skip to content

Commit

Permalink
Add Quartiles method to Float64Data type (issue #60)
Browse files Browse the repository at this point in the history
* chore: git ignore vscode config workspace
* feat: method to get  quartiles without input/argument from the initiated data64float
* test: fix test for method Quartiles
  • Loading branch information
pararang committed Feb 21, 2021
1 parent 8d66cd3 commit ade03ae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
coverage.out
release-notes.txt
.directory
.chglog
.chglog
.vscode
5 changes: 5 additions & 0 deletions data.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,8 @@ func (f Float64Data) SoftMax() ([]float64, error) {
func (f Float64Data) Entropy() (float64, error) {
return Entropy(f)
}

// Quartiles returns the three quartile points from instance of Float64Data
func (f Float64Data) Quartiles() (Quartiles, error) {
return Quartile(f)
}
7 changes: 7 additions & 0 deletions data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,10 @@ func BenchmarkMethodsAPI(b *testing.B) {
_, _ = data.Mode()
}
}

func TestQuartilesMethods(t *testing.T) {
_, err := data1.Quartiles()
if err != nil {
t.Errorf("%s returned an error", getFunctionName(data1.Quartiles))
}
}

0 comments on commit ade03ae

Please sign in to comment.