Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/325.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.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 值错误:[ValueError:轴中不包含标签[';链接';]_Python - Fatal编程技术网

Python 值错误:[ValueError:轴中不包含标签[';链接';]

Python 值错误:[ValueError:轴中不包含标签[';链接';],python,Python,当我试图从数据帧中删除几列时,我得到了一个值错误 --> df.columns -- Index(['Name of School', 'Elementary, Middle, or High School', 'Street Address', 'ZIP Code', 'Link ', 'Healthy Schools Certified?'] --> df.drop('Link', axis=1) 错误: ValueError: labels ['Link']

当我试图从数据帧中删除几列时,我得到了一个值错误

--> df.columns --
Index(['Name of School', 'Elementary, Middle, or High School',
       'Street Address', 'ZIP Code', 'Link ', 'Healthy Schools Certified?']

--> df.drop('Link', axis=1)
错误:

ValueError: labels ['Link'] not contained in axis
这样做:

df.drop('Link ', axis=1)
列名是
'link'
。它最后有一个空间