cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Pyhton script error -IndentationError: unexpected inden

Apply query changes
EuStockMarkets_NA
ADO.NET: Python script error.
 File "PythonScriptWrapper.PY", line 9
 completedData = dataset.fillna(method='backfill', inplace=False)
 ^
 IndentationError: unexpected inden
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.exec_prefix)
C:\Users\mudas\AppData\Local\Programs\Python\Python37-32
>>>



I was trying to complete this article on my windows 10 pro mahine and i got the above error .

 

https://docs.microsoft.com/en-us/power-bi/desktop-python-in-query-editor

1 ACCEPTED SOLUTION
TeigeGao
Solution Sage
Solution Sage

Hi @Anonymous ,

The error message "IndentationError: unexpected inden" indicates that this line of code has more spaces at  the start than the one before. 

This error occurs on the file PythonScriptWrapper.PY, this is a file generated by PowerBI which contains your Python code.

Please check if you have spaces before your Python code:

chrome_tCY3tQ3PLc.png

Best Regards,

Teige

View solution in original post

1 REPLY 1
TeigeGao
Solution Sage
Solution Sage

Hi @Anonymous ,

The error message "IndentationError: unexpected inden" indicates that this line of code has more spaces at  the start than the one before. 

This error occurs on the file PythonScriptWrapper.PY, this is a file generated by PowerBI which contains your Python code.

Please check if you have spaces before your Python code:

chrome_tCY3tQ3PLc.png

Best Regards,

Teige

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors