Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 同时删除列和行索引_Python_Pandas - Fatal编程技术网

Python 同时删除列和行索引

Python 同时删除列和行索引,python,pandas,Python,Pandas,我希望从下面的df中删除第一行和第一列 id bin_015 0 1 2 3 4 5 bin_01 0 5339604.0 NaN NaN

我希望从下面的df中删除第一行和第一列

                id                                             
bin_015          0         1         2        3       4       5
bin_01                                                         
0        5339604.0       NaN       NaN      NaN     NaN     NaN
1         377342.0  122580.0   85688.0   9501.0  1095.0   156.0
2              NaN  235426.0  313317.0  17025.0   456.0    33.0
3              NaN   16581.0   10759.0  40005.0  3422.0    84.0
4              NaN    1712.0     387.0   1851.0  8746.0   756.0
5              NaN     239.0      40.0     50.0   353.0  2197.0
我尝试的方式是

df.drop(df.index[0])
删除行索引=0,但是当我试图删除第一列时,我抛出了一个错误

我尝试删除第一列,但未成功

df.drop(df.index[0],axis==1)
这样行吗

df.drop(索引=0,列=0)


结合你的第一次尝试。

我想你想要的是

df.iloc[1:, 1:]

是的,对不起,我的英语不是最好的。这就是我需要的!谢谢您!你的英语没问题,我被其他答案弄糊涂了