Skip to content

Commit

Permalink
Update Deprecated Pandas Function Call
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jnirschl committed Aug 10, 2020
1 parent 477ea68 commit 8e0fad9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions riskslim/helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def load_data_from_csv(dataset_csv_file, sample_weights_csv_file = None, fold_cs
else:
raise IOError('could not find dataset_csv_file: %s' % dataset_csv_file)

raw_data = df.as_matrix()
raw_data = df.to_numpy()
data_headers = list(df.columns.values)
N = raw_data.shape[0]

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

Expand Down

0 comments on commit 8e0fad9

Please sign in to comment.