a = np.array([1, 2, 3])
b = np.array([4, 2, 3, 1, 0])
c = np.setdiff1d(b, a)
print("c", c)
Run Code Online (Sandbox Code Playgroud)
结果是,c [0, 4]
但我想要的答案是c [4 0]
。
我怎样才能做到这一点?
我正在尝试将 python 字典数据插入到 bigbuery 中。
以下是我使用的数据
data = {
'columnID':'123156',
'deviceID':'156',
'describle':{
'name':'car',
'freq':'10',
'period':'3',
}
}
Run Code Online (Sandbox Code Playgroud)
我还在下面定义了 bigquery 表架构
table_schema = {
'fields':[
{'name':'columnID', 'type':'STRING', 'mode':'REQUIRED'},
{'name':'deviceID', 'type':'STRING', 'mode':'REQUIRED'},
{'name':'describle', 'type':'RECORD', 'mode':'NULLABLE', 'fields':[
{'name':'name', 'type':'STRING', 'mode':'NULLABLE'},
{'name':'freq', 'type':'STRING', 'mode':'NULLABLE'},
{'name':'period', 'type':'STRING', 'mode':'NULLABLE'}]
},
]
}
Run Code Online (Sandbox Code Playgroud)
似乎无法将数据插入bigquery 表,任何人对此有任何想法吗?