Create curve from Numpy Array using Python
Create POLY type curve from numpy array
Script below creates a POLY type curve from 4d SplinePoint.co numpy array.

Script result in edit mode
import bpy
import numpy as np

def flatten(*args):
    c = np.empty(sum(arg.size for arg in args))
    l = len(args)
    for i, arg in enumerate(args):
        c[i::l] = arg
    return c

context = bpy.context

# emulate numpy data
x = np.arange(0, 10, 0.1)
y = 2 * np.sin(x)
z = np.cos(4 * x)
w = np.ones(len(x))

cu = bpy.data.curves.new(name=&quot;poly&quot;, type='CURVE')
cu.dimensions = '3D'

spline = cu.splines.new('POLY') # poly type
# spline is created with one point add more to match data
spline.points.add(x.size - 1)
spline.points.foreach_set(&quot;co&quot;, flatten(x, y, z, w))

ob = bpy.data.objects.new(&quot;Poly&quot;, cu)     
context.collection.objects.link(ob)

For a simple two point NURBS curve from local coordinates  (0, 0, 0) to (1, 1, 1) the coordinates can be defined
NURBS
For NURBS required to define the end_path_u
How to specify Nurbs path vertices in python?
Have introduced for each point having radius of r and setting this as well.
# emulate numpy data
x, y, z, w, r = np.array(
    (
        (0, 0, 0, 1, 0.5),
        (1, 1, 1, 1, 3.0),
    )
).T
cu = bpy.data.curves.new(name=&quot;poly&quot;, type='CURVE')
cu.dimensions = '3D'

spline = cu.splines.new('NURBS') # poly type
# spline is created with one point add more to match data
spline.points.add(x.size - 1)
spline.points.foreach_set(&quot;co&quot;, flatten(x, y, z, w))

spline.points.foreach_set(&quot;radius&quot;, r.ravel())
spline.use_endpoint_u = True
ob = bpy.data.objects.new(&quot;Poly&quot;, cu)     
context.collection.objects.link(ob)
context.view_layer.objects.active = ob
ob.select_set(True)

Notice in the foreach_ methods require us to ravel (or flatten)  the array.  Flattening data as shown in  https://blender.stackexchange.com/a/172973/15543 the stackoverflow link suggests slicing is quickest.