Electrofacies source code depreciated numpy "as_matrix" command
cdmeyer23 opened this issue · 7 comments
Stoked to keep working with this program!
I am attempting to run the wolfcamp_single example and I am running into an error:
AttributeError: 'DataFrame' object has no attribute 'as_matrix'
Looking at the Electofacies definition when defining minibatch_input:
components = pd.DataFrame(data = pc.transform(X),
index = df[not_null_rows].index)
minibatch_input = components.as_matrix()
it appears that "df.as_matrix()" has depreciated in a the newer version of pandas. I cannot seem to get the correct command to get the example to run. Could someone help?
@Philliec459
Yes, I am working with the wolfcamp_single.py
If you look at the electrofacies source code here:
https://github.com/toddheitmann/PetroPy/blob/master/petropy/electrofacies.py
it requires the import of numpy and pandas.
The example wolfcamp_single.py calls ptr.electrofacies on line 147:
logs = ptr.electrofacies(logs, f, electro_logs, 6,
log_scale = ['RESDEEP_N'])
@Philliec459
Thank you so much helping me out, I think the only way to get around it for now is to use the setup that is provided. I didn't see that before. While it is frusterating to have to run it with older versions of numpy and pandas, which makes other code that is run with it not function properly, at least it works that way.
Thanks again!
@cdmeyer23 thank you for posting, I was stuck too in that electrofacies function, I am using Jupyter Notebook. Thanks to my friend Julio (st4tic0) who advised me to change "minibatch_input = components.as_matrix()" to "minibatch_input = components.to_numpy()" , it worked... at least the function electrofacies.py