将缺少的标头添加到数据框的第一列

时间:2020-01-23 10:42:01

标签: python-3.x pandas

我正在读取带有熊猫的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))
    })
}

返回的数据帧为六列,但第一列没有标题。如何向该列添加标题?这是第一列。我不想重命名其他列...

0 个答案:

没有答案