Skip to content

Commit 8e0fad9

Browse files
committed
Update Deprecated Pandas Function Call
Pandas.DataFrame.as_matrix is deprecated since version 0.23.0 (see docs and PR 18458). According to the documentation for Pandas 0.25.1, the recommended function is DataFrame.to_numpy() in place of DataFrame.values or DataFrame.as_matrix(). pandas-dev/pandas#18458 https://pandas.pydata.org/pandas-docs/version/0.23/generated/pandas.DataFrame.as_matrix.html https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.values.html
1 parent 477ea68 commit 8e0fad9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

riskslim/helper_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def load_data_from_csv(dataset_csv_file, sample_weights_csv_file = None, fold_cs
212212
else:
213213
raise IOError('could not find dataset_csv_file: %s' % dataset_csv_file)
214214

215-
raw_data = df.as_matrix()
215+
raw_data = df.to_numpy()
216216
data_headers = list(df.columns.values)
217217
N = raw_data.shape[0]
218218

@@ -236,7 +236,7 @@ def load_data_from_csv(dataset_csv_file, sample_weights_csv_file = None, fold_cs
236236
else:
237237
if os.path.isfile(sample_weights_csv_file):
238238
sample_weights = pd.read_csv(sample_weights_csv_file, sep=',', header=None)
239-
sample_weights = sample_weights.as_matrix()
239+
sample_weights = sample_weights.to_numpy()
240240
else:
241241
raise IOError('could not find sample_weights_csv_file: %s' % sample_weights_csv_file)
242242

0 commit comments

Comments
 (0)