-
Notifications
You must be signed in to change notification settings - Fork 42
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
[BUG] Tutorial 35: ValueError: Cannot subset columns with a tuple with more than one element. #301
Comments
Hello and welcome! Thanks for posting your first issue in the GemGIS project! Someone from our developers will get back to you. If your question is support related, we may transfer it to the Discussions. |
@huisky2000 thanks for reporting this. I will have a look at it! |
Dear @huisky2000, I was able to fix the Issue. It was a ValueError caused by pandas>2.0.0, see https://stackoverflow.com/questions/76158147/pandas-groupby-valueerror-cannot-subset-columns-with-a-tuple-with-more-than-o The bug is fixed in 902a9ea and will be published with GemGIS 1.1.1 very soon. Thanks for finding this! I will keep it upon until the PR is merged. |
Ok, thanks. The next question is how can i make the installation for GEMGIS 1.1.1? |
@huisky2000 I have not released GemGIS 1.1.1 yet. Once it is released, you can install it by using |
Ok, any workaround for now? |
@huisky2000 I have released GemGIS 1.1.1 and 1.1.2 just today. However, as we are currently changing the deployment process, you would have to pull the repo from Github to get the latest features |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
labels = gg.visualization.create_borehole_labels(df=data)
labels
ValueError Traceback (most recent call last)
Cell In[12], line 1
----> 1 labels = gg.visualization.create_borehole_labels(df=data)
2 labels
File ~\Anaconda3\envs\gemgis\lib\site-packages\gemgis\visualization.py:2375, in create_borehole_labels(df)
2370 raise ValueError('X, Y and Altitude columns must be provided for label creation')
2372 # Creating array with coordinates from each group (equals to one borehole)
2373 coordinates = np.rot90(
2374 np.array(
-> 2375 df.groupby(['Index', 'Name'])['X', 'Y', 'Altitude'].apply(lambda x: list(np.unique(x))).values.tolist()),
2376 2)
2378 # Creating borehole location PyVista PolyData Object
2379 borehole_locations = pv.PolyData(coordinates)
File ~\Anaconda3\envs\gemgis\lib\site-packages\pandas\core\groupby\generic.py:1767, in DataFrameGroupBy.getitem(self, key)
1763 # per GH 23566
1764 if isinstance(key, tuple) and len(key) > 1:
1765 # if len == 1, then it becomes a SeriesGroupBy and this is actually
1766 # valid syntax, so don't raise
-> 1767 raise ValueError(
1768 "Cannot subset columns with a tuple with more than one element. "
1769 "Use a list instead."
1770 )
1771 return super().getitem(key)
ValueError: Cannot subset columns with a tuple with more than one element. Use a list instead.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: