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
after allowing characters in the data section, df() function was retu… #249
Conversation
…rning DataFrame with columns of dtype object for all columns if there are characters in the data section - this is a fix by attempting to convert the columns to float64 if they only contain numerical data
Thanks! I am away on some fieldwork at the moment but will try to merge this asap when I get a chance.
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: Krzysztof Słowiński <notifications@github.com>
Sent: Friday, July 13, 2018 9:22:50 PM
To: kinverarity1/lasio
Cc: Subscribed
Subject: [kinverarity1/lasio] after allowing characters in the data section, df() function was retu… (#249)
…rning DataFrame with columns of dtype object for all columns if there are characters in the data section - this is a fix by attempting to convert the columns to float64 if they only contain numerical data
________________________________
You can view, comment on, or merge this pull request online at:
#249<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkinverarity1%2Flasio%2Fpull%2F249&data=02%7C01%7C%7Cfe519880efcb4a93838508d5e8b7296d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636670795726323568&sdata=havA%2BNtFeVkefjSxajf5jXlnTlePFNUueJhqhGl6fKY%3D&reserved=0>
Commit Summary
* after allowing characters in the data section, df() function was returning DataFrame with columns of dtype object for all columns if there are characters in the data section - this is a fix by attempting to convert the columns to float64 if they only contain numerical data
File Changes
* M lasio/las.py<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkinverarity1%2Flasio%2Fpull%2F249%2Ffiles%23diff-0&data=02%7C01%7C%7Cfe519880efcb4a93838508d5e8b7296d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636670795726323568&sdata=saOuAuPe7E597PwJBt0m%2FPPJjvUeHvN7fXQxKsJkwE8%3D&reserved=0> (7)
* M tests/test_read.py<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkinverarity1%2Flasio%2Fpull%2F249%2Ffiles%23diff-1&data=02%7C01%7C%7Cfe519880efcb4a93838508d5e8b7296d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636670795726479813&sdata=fKy0tKHF6c%2FxbHWCB%2BeQH5UVT5fP8pcdcqXqxfOkWbo%3D&reserved=0> (9)
Patch Links:
* #249.patch<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkinverarity1%2Flasio%2Fpull%2F249.patch&data=02%7C01%7C%7Cfe519880efcb4a93838508d5e8b7296d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636670795726479813&sdata=ItCyCkqrwHDAhI9SqYG2Fo8RIWti0jZCoBapjVQD5ow%3D&reserved=0>
* #249.diff<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkinverarity1%2Flasio%2Fpull%2F249.diff&data=02%7C01%7C%7Cfe519880efcb4a93838508d5e8b7296d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636670795726479813&sdata=%2B3yvWGKIf6tkMctPr5tkeCherIuJ%2FDuCSn8TEn3O3g4%3D&reserved=0>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkinverarity1%2Flasio%2Fpull%2F249&data=02%7C01%7C%7Cfe519880efcb4a93838508d5e8b7296d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636670795726479813&sdata=o0zI9wQKS0qZs8Xawm7ysWCNQMiuqxlSfMMDxsqCuXY%3D&reserved=0>, or mute the thread<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAEUPa43XMbVGvWX13-P10RxK5P4_gt7Iks5uGIoSgaJpZM4VOxHz&data=02%7C01%7C%7Cfe519880efcb4a93838508d5e8b7296d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636670795726479813&sdata=RMm2j0P6Smb8OijR4jGQ%2FlFSlsxGztZOWljU%2F3z0hVk%3D&reserved=0>.
|
It is worth to mention that I tried to do the fix in las.py#set_data where the curve.data is assigned (currently at line 623), but fixing it at that location did not result in the change of type in the DataFrame returned through df() due to the way this DataFrame is constructed. If possible, it would be worth to fix it at the origin, which las.py#set_data seems to be, but it would require some additional changes. |
OK I see what you mean. It'll be a bit messy but I'll add some code in LASFile.set_data_from_df to try and convert each DataFrame column to floats if possible. In addition to your commit. Thanks! |
I'll merge this now and work on what I mentioned when possible. Cheers. |
…rning DataFrame with columns of dtype object for all columns if there are characters in the data section - this is a fix by attempting to convert the columns to float64 if they only contain numerical data