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

Read data section as dataframe #424

Closed
wants to merge 7 commits into from
Closed

Conversation

kinverarity1
Copy link
Owner

This adds a new function to reader.py and makes necessary changes in LASFile so that a data section can be read as a pandas DataFrame. The benefit of this is that now data section columns (== curves) can have different data types, at least when reading unwrapped files. This is happening already such that if items cannot be coerced to floating point numbers, that curve will have a pandas object data type i.e. strings.

All tests are passing and apart from the new function in reader.py (read_data_section_into_dataframe) there are no changes to internal function arguments etc.

@kinverarity1
Copy link
Owner Author

Note to myself: Failing for pandas 0.25.3 - the other tests are using pandas >= 1.

@kinverarity1
Copy link
Owner Author

kinverarity1 commented Feb 20, 2021

Also, I guess for wrapped files now we can attempt to convert each curve to a float dtype after the reader is finished. This will be the way we do it anyway for LAS 3 where the data types are specified.

@kinverarity1 kinverarity1 added the data-section-parser A bug or enhancement relating to the data section parser label Apr 16, 2021
@kinverarity1
Copy link
Owner Author

Closing this - based on our work in #452 it's clear that the data array should become a record array, with no dependence on pandas.

@kinverarity1
Copy link
Owner Author

See #461 for the solution to this. No record array, just only ever passing around 1D ndarrays for curves instead.

@kinverarity1 kinverarity1 deleted the read-as-dataframe branch May 13, 2022 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-section-parser A bug or enhancement relating to the data section parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant