alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 737 forks source link

Why am I getting “IndentationError: expected an indented block”? #606

Closed HebaSobhi2019 closed 4 years ago

HebaSobhi2019 commented 4 years ago

hello every one ,, i need your help i am using Python 3.6 and run then code on it :

from statsmodels.stats.stattools import durbin_watson out = durbin_watson(model_fitted.resid)

for col, val in zip(df.columns, out): print(adjust(col), ':', round(val, 2))

then i get this error : File "", line 6 for col, val in zip(df.columns, out): ^ IndentationError: expected an indented block

ShenChen93 commented 4 years ago

Hi @HebaSobhi2019 ,

Thanks for reaching out. However, the info you provided is not related to SDK, it might be python syntax problem. If you are using ASK python SDK and find problems while using our package, you could ask question here.

Thanks, Shen

nikhilym commented 4 years ago

Hey @HebaSobhi2019 , this is a python related issue and unrelated to the SDK.

Statements inside the for loop needs to be indented for Python to recognize the structure to execute. More information here.

from statsmodels.stats.stattools import durbin_watson
out = durbin_watson(model_fitted.resid)

for col, val in zip(df.columns, out):
    print(adjust(col), ':', round(val, 2))

Please feel to reopen in case you face issues with the ask-sdk* libraries we offer. Also, since this is the NodeJS repo, I would suggest you to create issues on the Python repo since you are using Python.

linehammer commented 3 years ago

Python language is a very sensitive language for indentation, it has caused confusion for many beginners. Putting in an extra space or leaving one out where it is needed will surely generate an error message . Some common causes of this error include:

The error message IndentationError: expected an indented block would seem to indicate that you have an indentation error. It is probably caused by a mix of tabs and spaces. The indentation can be any consistent white space . It is recommended to use 4 spaces for indentation in Python, tabulation or a different number of spaces may work, but it is also known to cause trouble at times. Tabs are a bad idea because they may create different amount if spacing in different editors .