np.array() function is used to create an array in numpy.
How would you create a 3x4 matrix filled with 7.0 as float32?
You have a Python list [1,2,3] and a tuple (4,5,6). What's the simplest way to make a 2x3 array from them?
What happens if you do np.array([[1,2], [3,4,5]])? What dtype do you get and why?
You're reading a CSV with mixed numeric columns and some missing values marked as 'NA'. How do you create a clean float64 array without the 'NA' strings polluting the dtype?
A teammate's code creates a large array via np.array(list_of_lists) and it's slow. You notice the input is already a list of numpy arrays. How would you fix this?
Debugging: your array shows dtype=object but you expected float64. The input data came from a JSON load. Walk me through finding the root cause.
You need to create a 50GB array on a machine with 64GB RAM for a one-time computation. The data comes from a memory-mapped file. Which creation method do you use and what parameters matter?
Design a helper that efficiently builds a large array from a stream of variable-length batches (e.g., from a DataLoader). You can't know the final size upfront. What's your strategy?
Your team sees frequent OOM errors when creating arrays from pandas DataFrames via .values. What's happening under the hood and how do you create the array zero-copy when possible?
You're defining array creation standards for a data platform used by 50 engineers across ML, analytics, and backend teams. What conventions do you enforce around dtype, memory order, and copy semantics?
The org is migrating a critical pipeline from pandas to NumPy for latency reasons. The pipeline does heavy columnar transformations. How do you architect the array creation layer to be both performant and maintainable?
A legacy system passes you raw C-contiguous buffers via FFI. You need to wrap them as NumPy arrays without copies, but the buffers may be freed externally. How do you design a safe ownership model?