You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loop through each sheet in the Excel file and reconstruct the dictionary
for sheet_name in excel_file.sheet_names:
df = pd.read_excel(file_path, sheet_name=sheet_name, index_col=0) # index_col=0 if you want to preserve the index
new_ohlc_intraday[sheet_name] = df
Traceback
Traceback (most recent call last):
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\spyder\plugins\variableexplorer\widgets\collectionsdelegate.py", line 269, in createEditorifnot editor.setup_and_check(value, title=key):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\spyder\plugins\variableexplorer\widgets\dataframeeditor.py", line 1773, in setup_and_checkreturnself.set_data_and_check(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\spyder\plugins\variableexplorer\widgets\dataframeeditor.py", line 1882, in set_data_and_checkself.dataModel = DataFrameModel(data, parent=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\spyder\plugins\variableexplorer\widgets\dataframeeditor.py", line 227, in __init__self.max_min_col_update()
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\spyder\plugins\variableexplorer\widgets\dataframeeditor.py", line 349, in max_min_col_update
vmax = col.max(skipna=True)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\series.py", line 6517, in maxreturn NDFrame.max(self, axis, skipna, numeric_only, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\generic.py", line 12404, in maxreturnself._stat_function(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\generic.py", line 12377, in _stat_functionreturnself._reduce(
^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\series.py", line 6457, in _reducereturn op(delegate, skipna=skipna, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\nanops.py", line 147, in f
result = alt(values, axis=axis, skipna=skipna, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\nanops.py", line 404, in new_func
result = func(values, axis=axis, skipna=skipna, mask=mask, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\nanops.py", line 1095, in reduction
values, mask = _get_values(
^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\nanops.py", line 294, in _get_values
mask = _maybe_get_mask(values, skipna, mask)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\nanops.py", line 248, in _maybe_get_mask
mask = isna(values)
^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\dtypes\missing.py", line 178, in isnareturn _isna(obj)
^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\dtypes\missing.py", line 207, in _isnareturn _isna_array(obj, inf_as_na=inf_as_na)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\pandas\core\dtypes\missing.py", line 288, in _isna_arrayelifisinstance(values, np.rec.recarray):
^^^^^^
File "C:\Users\neyni\miniconda3\envs\jupyter_env\Lib\site-packages\numpy\__init__.py", line 364, in __getattr__ifnotabs(x.dot(x) - float32(2.0)) <1e-5:
^^^^^^^^^^^^^^^^^^^^^^^ModuleNotFoundError: No module named 'numpy.rec'
Hey @vineetk1984, thanks for reporting. It seems there's a mismatch between your Pandas and Numpy versions, or perhaps you installed one of them with pip, which broke it.
So, I'd recommend you to update Pandas and Numpy with conda, or recreate your environment, and try again.
Description
What steps will reproduce the problem?
import pandas as pd
file_path = 'C:\Users\neyni\Alphavantage_ohlc_intraday.xlsx'
Read the Excel file
excel_file = pd.ExcelFile(file_path)
Initialize an empty dictionary
new_ohlc_intraday = {}
Loop through each sheet in the Excel file and reconstruct the dictionary
for sheet_name in excel_file.sheet_names:
df = pd.read_excel(file_path, sheet_name=sheet_name, index_col=0) # index_col=0 if you want to preserve the index
new_ohlc_intraday[sheet_name] = df
Traceback
Versions
Dependencies
The text was updated successfully, but these errors were encountered: