Skip to content

Commit fc230d3

Browse files
authored
Merge pull request #24791 from jitseniesen/pandas-mismatch
PR: Handle Pandas version mismatch when getting dataframe with numeric index (Variable Explorer)
2 parents ec4ad78 + 1800af7 commit fc230d3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spyder/plugins/ipythonconsole/widgets/namespacebrowser.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ def get_value(self, name):
7676
"please upgrade <tt>numpy</tt> in the environment that you use to "
7777
"run Spyder to version 1.26.1 or higher."
7878
)
79+
reason_mismatched_pandas = _(
80+
"There is a mismatch between the Pandas versions used by Spyder "
81+
"and the kernel of your current console. To fix this problem, "
82+
"please upgrade <tt>pandas</tt> in the console environment "
83+
"to version 2.0 or higher."
84+
)
7985
reason_mismatched_python = _(
8086
"There is a mismatch between the Python versions used by Spyder "
8187
"({}) and the kernel of your current console ({}).<br><br>"
@@ -150,6 +156,8 @@ def get_value(self, name):
150156
reason = reason_missing_package_installer.format(e.name)
151157
elif e.name.startswith('numpy._core'):
152158
reason = reason_mismatched_numpy
159+
elif e.name == 'pandas.core.indexes.numeric':
160+
reason = reason_mismatched_pandas
153161
else:
154162
reason = reason_missing_package.format(e.name)
155163
raise ValueError(msg % reason)

0 commit comments

Comments
 (0)