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

Data type 'category' not understood #209

Closed
kwinkunks opened this issue Feb 24, 2022 · 1 comment
Closed

Data type 'category' not understood #209

kwinkunks opened this issue Feb 24, 2022 · 1 comment
Labels

Comments

@kwinkunks
Copy link
Member

From a user:

When I try to use the Project.df() method on a project (from .Las), I get the error data type 'category' not understood referring to line 848 in curve.py.

  • Python 3.9.7
  • Welly 0.5.2rc0
  • pandas 1.4.1
  • numpy 1.20.3
@kwinkunks kwinkunks added the bug label Feb 24, 2022
kwinkunks added a commit that referenced this issue Feb 24, 2022
@kwinkunks
Copy link
Member Author

Complete report...

from welly import Project

p = Project.from_las('Log_Data/*.las')

p[3].df()

Results in:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
C:\Users\ROB~1.SEL\AppData\Local\Temp/ipykernel_35000/1532267160.py in <module>
----> 1 p[3].df()

~\Anaconda3\envs\welly2\lib\site-packages\welly\well.py in df(self, keys, basis, uwi, alias, rename_aliased)
    592             raise WellError(m)
    593 
--> 594         data = [self.get_curve(k, alias=alias).to_basis(basis).df for k in keys]
    595 
    596         if rename_aliased:

~\Anaconda3\envs\welly2\lib\site-packages\welly\well.py in <listcomp>(.0)
    592             raise WellError(m)
    593 
--> 594         data = [self.get_curve(k, alias=alias).to_basis(basis).df for k in keys]
    595 
    596         if rename_aliased:

~\Anaconda3\envs\welly2\lib\site-packages\welly\curve.py in to_basis(self, basis, start, stop, step, undefined, interp_kind)
    846         """
    847         # category data type or a string in data defaults to 'nearest'
--> 848         if self.df.dtypes[0] == 'category' or self.df.applymap(type).eq(str).any()[0]:
    849             interp_kind = 'nearest'
    850 

TypeError: data type 'category' not understood

But I think 60560f6 has fixed it.

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

No branches or pull requests

1 participant