xlwings udf 函数擦除 excel 上的下一个单元格
xlwings udf function erase next cell on excel
我在 excel 使用 xlwings 时遇到一个小问题,我真的不知道如何解决它。
当我使用 return 的 UDF 函数时,例如熊猫数据框,假设我的数据框宽度为 3 列(行上没有必要条件),然后在 excel 中的第 4 列,如果我在上面写了一些数据,我的熊猫数据框会在我计算 sheet 后立即将其删除......虽然数据框根本没有使用这一列,但它有 3 列而不是 4 列......
我不知道我是否足够清楚。让我知道!
非常感谢您。
@xw.func
@xw.ret(expand='table')
def hello(nb):
nb = int(nb)
return [["hello","you"] for i in range(nb)]
before recalculate the sheet
after recalculate the sheet
好像在xlwings的文档中,需要在底部和右侧留空行和空列。如果不是,它将覆盖它
http://docs.xlwings.org/en/stable/api.html#xlwings.xlwings.ret
我在 excel 使用 xlwings 时遇到一个小问题,我真的不知道如何解决它。 当我使用 return 的 UDF 函数时,例如熊猫数据框,假设我的数据框宽度为 3 列(行上没有必要条件),然后在 excel 中的第 4 列,如果我在上面写了一些数据,我的熊猫数据框会在我计算 sheet 后立即将其删除......虽然数据框根本没有使用这一列,但它有 3 列而不是 4 列...... 我不知道我是否足够清楚。让我知道!
非常感谢您。
@xw.func
@xw.ret(expand='table')
def hello(nb):
nb = int(nb)
return [["hello","you"] for i in range(nb)]
before recalculate the sheet
after recalculate the sheet
好像在xlwings的文档中,需要在底部和右侧留空行和空列。如果不是,它将覆盖它
http://docs.xlwings.org/en/stable/api.html#xlwings.xlwings.ret