Skip to content

Commit

Permalink
CLN: adapt Pandas FutureWarning cf #804
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrivenaes committed Oct 4, 2022
1 parent dde470c commit 061038f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/xtgeo/well/well1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ def downsample(self, interval=4, keeplast=True):
dfr = self._df[::interval]

if keeplast:
dfr = dfr.append(self._df.iloc[-1])
dfr = pd.concat([dfr, self._df.iloc[-1:]], ignore_index=True)

self._df = dfr.reset_index(drop=True)

Expand Down
8 changes: 4 additions & 4 deletions src/xtgeo/well/wells.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,20 @@ def get_dataframe(self, filled=False, fill_value1=-999, fill_value2=-9999):
"""
logger.info("Ask for big dataframe for all wells")

bigdf = []
bigdflist = []
for well in self._wells:
dfr = well.dataframe.copy()
dfr["WELLNAME"] = well.name
logger.info(well.name)
if filled:
dfr = dfr.fillna(fill_value1)
bigdf.append(dfr)
bigdflist.append(dfr)

if StrictVersion(pd.__version__) > StrictVersion("0.23.0"):
# pylint: disable=unexpected-keyword-arg
dfr = pd.concat(bigdf, ignore_index=True, sort=True)
dfr = pd.concat(bigdflist, ignore_index=True, sort=True)
else:
dfr = pd.concat(bigdf, ignore_index=True)
dfr = pd.concat(bigdflist, ignore_index=True)

# the concat itself may lead to NaN's:
if filled:
Expand Down
2 changes: 1 addition & 1 deletion src/xtgeo/xyz/_xyz_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def _convert_idbased_xyz(self, df):

for _id, gr in idgroups:
dfx = gr.drop(self._pname, axis=1)
newdf = newdf.append([dfx, udef], ignore_index=True)
newdf = pd.concat([newdf, dfx, udef], ignore_index=True)

return newdf

Expand Down

0 comments on commit 061038f

Please sign in to comment.