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

Update multimodal.md to add axis keyword [Issue #1884] #1885

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mepearson
Copy link

@mepearson mepearson commented Mar 22, 2024

Update Multimodal documentation to add an axis keyword for the drop function. This addresses issue #1884

Existing Code:

# Extract dataframe
df = topic_model.get_topic_info().drop("Representative_Docs", 1).drop("Name", 1)

Suggested Code:

# Extract dataframe  
df = topic_model.get_topic_info().drop(["Representative_Docs","Name"], axis=1)

This corrects the following error caused by the need for keyword arguments in newer versions of pandas. Columns to drop were gathered into a single list just for simplicity.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[12], line 1
----> 1 df.drop("Representative_Docs", 1).drop("Name", 1)

TypeError: DataFrame.drop() takes from 1 to 2 positional arguments but 3 were given

@MaartenGr
Copy link
Owner

Thanks for the PR! Do you know why this change is necessary? The reason why I ask is that this might relate to specific versions of pandas as this piece of code did work before. Did you test this?

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

Successfully merging this pull request may close these issues.

2 participants