-
-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DEP] IndexError when using pandas==2.0.2 #806
Comments
The error remains in a freshly installed environment and with all packages installed manually. |
What is the work around for this? I ran into it after having a working install and now can't seem to get around this issue, by means of downgrading pandas. |
So, you still have this issue after downgrading pandas? |
Tracking down the issue further. The function that is broken is def _compute_len_series(self):
self.len_series_i = self.additional_data.structure_data.df.loc[
'values', 'len series surface_points'] - \
self.additional_data.structure_data.df.loc[
'values', 'number surfaces per series']
self.len_series_o = self.additional_data.structure_data.df.loc[
'values', 'len series orientations'].astype(
'int32')
# Remove series without data
non_zero_i = self.len_series_i.nonzero()[0]
non_zero_o = self.len_series_o.nonzero()[0]
non_zero = np.intersect1d(non_zero_i, non_zero_o)
self.non_zero = non_zero
self.len_series_u = self.additional_data.kriging_data.df.loc[
'values', 'drift equations'].astype('int32')
try:
len_series_f_ = self.faults.faults_relations_df.values[non_zero][:, non_zero].sum(
axis=0)
except np.AxisError:
print('np.axis error')
len_series_f_ = self.faults.faults_relations_df.values.sum(axis=0)
self.len_series_f = np.atleast_1d(len_series_f_.astype(
'int32')) # [:self.additional_data.get_additional_data()['values']['Structure', 'number series']]
self._old_len_series = self.len_series_i
self.len_series_i = self.len_series_i[non_zero]
self.len_series_o = self.len_series_o[non_zero]
# self.len_series_f = self.len_series_f[non_zero]
self.len_series_u = self.len_series_u[non_zero] Indexing |
# Index Error raised since pandas==2.0.2
try:
self.len_series_i = self.len_series_i[non_zero]
self.len_series_o = self.len_series_o[non_zero]
# self.len_series_f = self.len_series_f[non_zero]
self.len_series_u = self.len_series_u[non_zero]
if self.len_series_i.shape[0] == 0:
self.len_series_i = np.zeros(1, dtype=int)
self._old_len_series = self.len_series_i
if self.len_series_o.shape[0] == 0:
self.len_series_o = np.zeros(1, dtype=int)
if self.len_series_u.shape[0] == 0:
self.len_series_u = np.zeros(1, dtype=int)
if self.len_series_f.shape[0] == 0:
self.len_series_f = np.zeros(1, dtype=int)
except IndexError:
self.len_series_i = np.array([self.len_series_i])
self.len_series_o = np.array([self.len_series_o])
# self.len_series_f = np.array([self.len_series_f])
self.len_series_u = np.array([self.len_series_u]) |
|
Opened an issue in the pandas repo: pandas-dev/pandas#54519 |
as a fix / workaround, might already work to put the |
GemPy v3 does not depend on pandas anymore |
Describe the bug
After updating pandas from 2.0.1 to 2.0.2 using pip. The error already occurs when creating a new model using
gp.create_model('Model1')
.To Reproduce
Provide detailed steps to reproduce the behavior:
Updating pandas from 2.0.1 to 2.0.2 and using the latest version of the development branch
...
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: