Skip to content
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

Electrofacies source code depreciated numpy "as_matrix" command #7

Open
cdmeyer23 opened this issue Jul 9, 2020 · 7 comments
Open

Comments

@cdmeyer23
Copy link

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
Copy link

Philliec459 commented Jul 9, 2020 via email

@cdmeyer23
Copy link
Author

@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
Copy link

Philliec459 commented Jul 9, 2020 via email

@Philliec459
Copy link

Philliec459 commented Jul 9, 2020 via email

@cdmeyer23
Copy link
Author

@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!

@Philliec459
Copy link

Philliec459 commented Jul 10, 2020 via email

@dianaceroallard
Copy link

dianaceroallard commented Jul 13, 2020

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants