Skip to content

Commit 2a90b74

Browse files
GCI107 AvoidIterativeMatrixOperations fix: resolve typo
Co-authored-by: DataLabGroupe-CreditAgricole <[email protected]>
1 parent 73d5f32 commit 2a90b74

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/rules/GCI107/python/GCI107.asciidoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
Before going into more detail, it's important to understand how vectorization works in Python. When performing a calculation on an array/matrix, there are several possible methods:
1+
Before going into more detail, it's important to understand how vectorization works in Python. When performing a calculation on an array/matrix, there are several feasible methods:
22

33
The first is to go through the list and perform the calculation element by element, known as an iterative approach.
44
The second method consists of applying the calculation to the entire array/matrix at once, which is known as vectorization.
55

6-
Although it's not possible to do this in all cases without applying real parallelism using a GPU, for example, we speak of vectorization when we use the built-in functions of TensorFlow, NumPy or Pandas.
6+
Although it's not feasible to do this in all cases without applying real parallelism using a GPU, for example, we speak of vectorization when we use the built-in functions of TensorFlow, NumPy or Pandas.
77

8-
We'll also have a iterative loop, but it will be executed in lower-level code (C). As with the use of built-in functions in general, since low-level languages like C are optimized, execution will be much faster and therefore emit less CO2.
8+
We'll also have an iterative loop, but it will be executed in lower-level code (C). As with the use of built-in functions in general, since low-level languages like C are optimized, execution will be much faster and therefore emit less CO2.
99

1010
== Non compliant Code Example
1111

1212
[source,python]
1313
----
14+
results = [[0 for _ in range(cols_B)] for _ in range(rows_A)]
15+
16+
1417
for i in range(len(A)):
1518
for j in range(len(B[0])):
1619
for k in range(len(B)):

0 commit comments

Comments
 (0)