Jupyter notebook Jupyter笔记本选项卡或空格缩进错误
我试图使用jupyter笔记本在python中创建上述函数。但我得到的错误如下:Jupyter notebook Jupyter笔记本选项卡或空格缩进错误,jupyter-notebook,python-3.7,indentation,Jupyter Notebook,Python 3.7,Indentation,我试图使用jupyter笔记本在python中创建上述函数。但我得到的错误如下: # Convert string column to float def str_column_to_float(dataset, column): for row in dataset: row[column] = float(row[column].strip()) print(row[column]) 文件“”,第5行 打印(行[列]) ^ TabError:缩进中制
# Convert string column to float
def str_column_to_float(dataset, column):
for row in dataset:
row[column] = float(row[column].strip())
print(row[column])
文件“”,第5行
打印(行[列])
^
TabError:缩进中制表符和空格的使用不一致
有人能帮我解决这个问题吗?确保空格和缩进正确。您输入的代码应该如下所示:欢迎使用SO!打印(…制表符用于缩进其他行时,请将所有空白字符替换为制表符。这是否回答了您的问题?
File "<ipython-input-5-b591f37367db>", line 5
print(row[column])
^
TabError: inconsistent use of tabs and spaces in indentation