<jupyter_start><jupyter_text>Solution: Linear Combination Next we will use NumPy's [**linalg.solve** function](https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.linalg.solve.htmlnumpy.linalg.solve)to check if vector $\vec{t}$ is within the span of the other two vectors( $\vec{v}$ and $\vec{w}$ ). You will be inserting your code into the function **check_vector_span** below.Use the [**linalg.solve** function](https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.linalg.solve.htmlnumpy.linalg.solve) to solve for the scalars (**vector_of_scalars**) that will make *equation 1* above **true** if the vector that's being checked(**vector_to_check**) is within the span of the set of vectors(**set_of_vectors**). Otherwise, the vector(**vector_to_check**) is **not** within the span and an empty vector is returned.Below you will find the definitions of the parameters and returned variable to help you with this task.<jupyter_code>def check_vector_span(set_of_vectors, vector_to_check):
    # Creates an empty vector of correct size
    vector_of_scalars = np.asarray([None]*set_of_vectors.shape[0])
    
    # Solves for the scalars that make the equation true if vector is within the span
    try:
        # TODO: Use np.linalg.solve() function here to solve for vector_of_scalars
        vector_of_scalars = np.linalg.solve(set_of_vectors, vector_to_check)
        if not (vector_of_scalars is None):
            print("\nVector is within span.\nScalars in s:", vector_of_scalars)
        
    # Handles the cases when the vector is NOT within the span   
    except Exception as exception_type:
        if str(exception_type) == "Singular matrix":
            print("\nNo single solution\nVector is NOT within span")
        else:
            print("\nUnexpected Exception Error:", exception_type)
    return vector_of_scalars<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10164107993647432, 'fraction_numerical': 0.005293806246691371, 'mean_word_length': 4.135869565217392, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '445505', 'license': 'MIT', 'n_tokens_mistral': 586, 'n_tokens_neox': 566, 'n_words': 183, 'path': 'linearalgebra-linear_combination/linearCombinationSolution.ipynb', 'repo_name': 'desh-woes/AIPND', 'size': '1889'}