答:删列可用 df.drop(columns=["temp"]),删行用 df.drop(index=[...])。传的是标签。若只知道整数位置,先从 df.index 找实际标签,再决定按位置还是按标签处理。
题干与完整题解免费阅读第 1 / 1 页
本页 1 道,共 1 道浏览其他领域
答:删列可用 df.drop(columns=["temp"]),删行用 df.drop(index=[...])。传的是标签。若只知道整数位置,先从 df.index 找实际标签,再决定按位置还是按标签处理。