How to solve this memory error when using to_dataframe? #702
Unanswered
markusmat97
asked this question in
Q&A
Replies: 1 comment 4 replies
-
You need to use the |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i am having the following error when using the to_dataframe:
code : mdf_data = Data.to_dataframe(use_interpolation=False)
errror:
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2021.3.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1483, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2021.3.2\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/xxxxx/PycharmProjects/pythonProject1/Seq_3 final.py", line 175, in
df_init = initialization(Data)
File "C:/Users/xxxxx/PycharmProjects/pythonProject1/Seq_3 final.py", line 17, in initialization
mdf_data = Data.to_dataframe(use_interpolation=False)
File "C:\Users\xxxxx\PycharmProjects\pythonProject1\venv\lib\site-packages\asammdf\mdf.py", line 4265, in to_dataframe
df = pd.DataFrame(nonstrings, index=master)
File "C:\Users\xxxxxx\PycharmProjects\pythonProject1\venv\lib\site-packages\pandas\core\frame.py", line 636, in init
mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
File "C:\Users\xxxx\PycharmProjects\pythonProject1\venv\lib\site-packages\pandas\core\internals\construction.py", line 502, in dict_to_mgr
return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy)
File "C:\Users\xxxxx\PycharmProjects\pythonProject1\venv\lib\site-packages\pandas\core\internals\construction.py", line 156, in arrays_to_mgr
return create_block_manager_from_column_arrays(
File "C:\Users\xxxxx\PycharmProjects\pythonProject1\venv\lib\site-packages\pandas\core\internals\managers.py", line 1959, in create_block_manager_from_column_arrays
mgr._consolidate_inplace()
File "C:\Users\xxxxx\PycharmProjects\pythonProject1\venv\lib\site-packages\pandas\core\internals\managers.py", line 1685, in _consolidate_inplace
self.blocks = tuple(_consolidate(self.blocks))
File "C:\Users\xxxxx\PycharmProjects\pythonProject1\venv\lib\site-packages\pandas\core\internals\managers.py", line 2084, in _consolidate
merged_blocks = _merge_blocks(
File "C:\Users\xxxxx\PycharmProjects\pythonProject1\venv\lib\site-packages\pandas\core\internals\managers.py", line 2111, in _merge_blocks
new_values = np.vstack([b.values for b in blocks]) # type: ignore[misc]
File "<array_function internals>", line 180, in vstack
File "C:\Users\xxxxx\PycharmProjects\pythonProject1\venv\lib\site-packages\numpy\core\shape_base.py", line 282, in vstack
return _nx.concatenate(arrs, 0)
File "<array_function internals>", line 180, in concatenate
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 11.6 GiB for an array with shape (567, 2747749) and data type float64
Breakpoint reached: Any exception
python-BaseException
Beta Was this translation helpful? Give feedback.
All reactions