
Answer-first summary for fast verification
Answer: Add numpy== to the cluster's library dependencies.
The most effective method to ensure a specific version of the numpy library is used across all notebooks in a Databricks workspace is to add `numpy==` to the cluster's library dependencies. This approach guarantees that the specified version of numpy is installed and consistently available in all notebooks attached to the cluster, without the need for manual installations or environment variable adjustments. - **Option A** is less effective because it only installs the library in the notebook where the command is executed, not across all notebooks. - **Option B** might not provide the exact version of numpy needed and could lead to compatibility issues. - **Option D** focuses on setting the Python version, not ensuring the numpy version, and could introduce compatibility problems. - **Option E** is incorrect as adding a library to the cluster's dependencies is a reliable way to enforce specific versions. Thus, adding the library to the cluster's dependencies is the recommended approach for consistency and reliability.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A machine learning team is working on a project that requires a specific version of the numpy library. They aim to ensure this version is used across all notebooks in their Databricks workspace. What is the best approach to achieve this?
A
Run %pip install numpy== once on any notebook attached to the cluster.
B
Edit the cluster to use the Databricks Runtime for Machine Learning.
C
Add numpy== to the cluster's library dependencies.
D
Set the PYTHON_VERSION variable in the cluster configuration to the required version.
E
There is no way to enforce a specific version of numpy on a cluster.