Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Loading Data using python in Power BI throwing memory error

Hello,

 

I am trying to load data from multiple CSV files after appending them into one data frame into power bi using python, but I am getting a memory error. The same script, if I run through jupyter notebook, doesn't throw any memory error. If I try reducing the number of files then it works well in Power BI. I am not sure if this is due to any row limit in power bi or due to checkout time as the number of rows is up to 60 million and the time required to run the script is almost 1 hour in the notebook. 

 

The error is :

 

DataSource.Error: ADO.NET: Python script error.
Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 129, in <module>
x_df = x_df.append(df, ignore_index=True)
File "C:\PROGRAMS\PYTHON\PYTHON37-32\lib\site-packages\pandas\core\frame.py", line 6692, in append
sort=sort)
File "C:\PROGRAMS\PYTHON\PYTHON37-32\lib\site-packages\pandas\core\reshape\concat.py", line 229, in concat
return op.get_result()
File "C:\PROGRAMS\PYTHON\PYTHON37-32\lib\site-packages\pandas\core\reshape\concat.py", line 426, in get_result
copy=self.copy)
File "C:\PROGRAMS\PYTHON\PYTHON37-32\lib\site-packages\pandas\core\internals\managers.py", line 2058, in concatenate_block_managers
[ju.block for ju in join_units], placement=placement)
File "C:\PROGRAMS\PYTHON\PYTHON37-32\lib\site-packages\pandas\core\internals\blocks.py", line 328, in concat_same_type
axis=self.ndim - 1)
MemoryError

 

Can someone please help me with this?

 

Thanks.

6 REPLIES 6
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

Open Task Manager to check the memory usage and check if your memory is sufficient during operation.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

@v-eachen-msft Yes I tried checking that and there is sufficient memory available to perform the task.  

amitchandak
Super User
Super User

Check the amount of memory allocation to Python.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  do you mean to say checking the amount of memory allocated to python on my system or in power bi?

I can see the error in python. So check for python. And I am assuming you are using python because you are not able to do in transform data/edit queries

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  the error occurs only when running the python script in Power BI, I tried the same script in Jupyter notebook and its running fine without any error, just that it takes an hour to run the file. Is there any link between memory error and the time taken by the script to run? because the limitation of loading data using python/R scripts is that the execution time is limited up to 30 minutes. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.