# Source URL: https://dev.epicgames.com/community/snippets/pgxg/fortnite-data-science-and-analytics-for-verse-v2
# Local doc: epic-docs/community/snippets/pgxg/fortnite-data-science-and-analytics-for-verse-v2.md
# DSAV (Data Science & Analytics for Verse) module
DSAV<public> := module:
# NOTE: Project DSAV uses the Matrices module made by @topo-ology. This required module can be found here:
# https://dev.epicgames.com/community/snippets/bO9r/fortnite-matrices
using { Matrices }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Random }
<# DATA CLEANING #>
# Returns true if the given array contains a missing value, meaning either NaN or unset optional entries.
(Column:[]?float).HasNA<public>()<transacts>:logic=
var Result : logic = false
for (Index := 0..Column.Length - 1):
if (FilledEntry := Column[Index]?):
if (FilledEntry = NaN):
set Result = true
else:
set Result = true
Result
# Returns true if the given matrix contains a NaN entry.
(InMatrix:Matrix).HasNA<public>()<transacts>:logic=
var Result : logic = false
for (Row := 0..InMatrix.Rows - 1):
for (Col := 0..InMatrix.Cols - 1):
if (Entry := InMatrix.Rep[Row][Col], Entry = NaN):
set Result = true
Result
# Returns the input matrix without duplicated rows (if any), maintaining the first row of any duplicates.
(InMatrix:Matrix).DropDuplicates<public>()<transacts>:Matrix =
Verse Library
verse
01 Snippet
Provides data cleaning utilities like NaN detection and duplicate row removal for matrices and arrays in UEFN.
extracted-snippets/community/snippets/pgxg/fortnite-data-science-and-analytics-for-verse-v2/01-snippet.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.