我是新的火种,并试图理解下面的代码从一些刺激的代码。
test_map = {"A":1,"B":2, "C":3, "D":4}
test_mapping = create_map([lit(ele) for ele in chain(*test_map.items())])上面的代码给了我错误。
AttributeError:“NoneType”对象没有属性“_jvm”
不知道这是怎么回事。有人能解释一下吗?
发布于 2021-10-24 03:47:04
上面的代码没有什么问题。事实上,它不会“运行”任何东西,因为星火转换是懒惰的。
这是代码的实际结果:
print(test_mapping)
# Column<'map(A, 1, B, 2, C, 3, D, 4)'>https://stackoverflow.com/questions/69693682
复制相似问题