cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I fix tabs vs spaces in notebooks?

StephanieRivera
Valued Contributor II
Valued Contributor II

I am getting

IndentationError: unindent does not match any outer indentation level

because the code I pasted has tabs that are 4 spaces, but the tabs in Databricks are 2 spaces. How do I fix this? Do I have to copy and paste it back out?

1 ACCEPTED SOLUTION

Accepted Solutions

VIPULJAINS
New Contributor III

try changing the python indentation

image

View solution in original post

3 REPLIES 3

VIPULJAINS
New Contributor III

try changing the python indentation

image

I have changed the setting to no avail 😞 However, I highlighted everything and shift+tab until it hit the left margin and then tabbed it back out. This likely worked because the issue was on the outermost indentation level. In the future, this should be better.

Zainaboladokun
New Contributor III

Nopu

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.