Hands-On Data Analysis with Scala by Rajesh Gupta

Hands-On Data Analysis with Scala by Rajesh Gupta

Author:Rajesh Gupta [Rajesh Gupta]
Language: eng
Format: epub
Tags: COM018000 - COMPUTERS / Data Processing, COM021030 - COMPUTERS / Databases / Data Mining, COM089000 - COMPUTERS / Data Visualization
Publisher: Packt
Published: 2019-05-02T13:49:25+00:00


Computing percentiles is relatively more expensive because it requires data to be sorted.

We can also use Scala collection APIs to get some of this info:

Count the numbers:

scala> val count = nums.size

count: Int = 100

Compute the mean value of the numbers:

scala> val mean = nums.sum.toDouble / count

mean: Double = 50.5

Compute the minimum value of the numbers:

scala> val min = nums.min

min: Int = 1

Compute the maximum value of the numbers:

scala> val max = nums.max

max: Int = 100

Sort the numbers in ascending order. This is needed to compute percentiles in the next steps:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.