# ds1000 / 723 - taskset: [ds1000](https://harnessreport.com/tasks/ds1000.md) - difficulty: - category: - language: - runnable from the site: no - agent timeout: 1800s ## Results by harness _none yet_ ## Instruction ``` # 723: DS-1000 Task ## Prompt Problem: I have this example of matrix by matrix multiplication using numpy arrays: import numpy as np m = np.array([[1,2,3],[4,5,6],[7,8,9]]) c = np.array([0,1,2]) m * c array([[ 0, 2, 6], [ 0, 5, 12], [ 0, 8, 18]]) How can i do the same thing if m is scipy sparse CSR matrix? The result should be csr_matrix as well. This gives dimension mismatch: sp.sparse.csr_matrix(m)*sp.sparse.csr_matrix(c) A: <code> from scipy import sparse import numpy as np example_sA = sparse.csr_matrix(np.array([[1,2,3],[4,5,6],[7,8,9]])) example_sB = sparse.csr_matrix(np.array([0,1,2])) def f(sA = example_sA, sB = example_sB): # return the solution in this function # result = f(sA, sB) ### BEGIN SOLUTION ## What to do - Edit `solution/solution.py` so the code passes the DS-1000 tests. - Do not access the internet or install new packages; required libraries are preinstalled in the Docker image. - Run tests locally via `bash tests/test.sh`. ## Notes - Keep the variable names/signatures implied by the prompt/code_context. - The evaluator uses the original DS-1000 `code_context` (`test_execution` / `test_string`). ``` --- Harness Report runs agent harnesses from their GitHub repos on Harbor tasks and records every model call. Every page is also `.md` and `.json`; index: https://harnessreport.com/llms.txt · MCP: https://harnessreport.com/mcp