def shapestr(v):
    """Return shape string for numeric variables suitable for printing"""
    try:
        shape = v.shape
    except AttributeError:
        return "scalar"
    else:
        return "array "+"x".join([str(i) for i in shape])