我正在读取带有熊猫的json响应:
const get = (query: Query) => {
return new Promise((onSuccess, onFailure) => {
console.log(query.url())
fetch(query.url(), {
method: 'GET',
headers: new Headers(),
mode: 'no-cors'
})
.then(response => {
if (!response.ok) { throw Error(response.statusText) }
onSuccess(response.json())
}, error => onFailure({error})
).catch(e => onFailure(e))
})
}
返回的数据帧为六列,但第一列没有标题。如何向该列添加标题?这是第一列。我不想重命名其他列...