162k views
4 votes
In the assessment project, if you removed stock_code as the partitioning column from the window recipe, could you still find the rolling average for each stock_code?

a) Yes, the rolling average would remain unchanged
b) No, the rolling average would be affected
c) It depends on other variables in the project
d) Rolling average cannot be calculated without stock_code

1 Answer

4 votes

Final answer:

Removing stock_code from the partitioning column in a window recipe would affect the rolling average calculation, as it is needed for grouping the data for each individual stock's analysis.

Step-by-step explanation:

If you removed stock_code as the partitioning column from the window recipe, you could still find the rolling average for each stock_code, but the results would be affected. This is because partitioning is a technique used to group the dataset into subsets before performing calculations like a rolling average. Without partitioning by stock_code, the rolling average would be calculated over the entire dataset rather than individually for each stock, thus not providing a stock-specific rolling average.

The correct answer to whether you could still find the rolling average for each stock_code if it were removed from the partitioning column is b) No, the rolling average would be affected. Removing the stock_code from partitioning would result in calculations that are not segregated by each stock, which is essential for individual stock analysis.

User New Moon
by
7.6k points