operator >= method
Greater than or equal to (>=) operator:
Compares the corresponding elements of this Series and another Series to check if each element of this Series is greater than or equal to the corresponding element of the other Series.
Throws an exception if the Series have different lengths.
Implementation
Series operator >=(dynamic other) {
List<bool> resultData = [];
if (other is num) {
for (int i = 0; i < length; i++) {
resultData.add(data[i] >= other);
}
return Series(resultData, name: "$name >= $other");
} else if (other is Series) {
if (length != other.length) {
throw Exception("Series must have the same length for comparison.");
}
for (int i = 0; i < length; i++) {
resultData.add(data[i] >= other.data[i]);
}
return Series(resultData, name: "$name >= ${other.name}");
}
throw Exception("Can only compare Series to Series or num.");
}