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

AttributeError: 'DataFrame' object has no attribute 'map' #370

Open
kevalshah90 opened this issue Dec 9, 2021 · 0 comments
Open

AttributeError: 'DataFrame' object has no attribute 'map' #370

kevalshah90 opened this issue Dec 9, 2021 · 0 comments

Comments

@kevalshah90
Copy link

Environment

  • Operating System: MacOS Monterey
  • Python Version: 3.9
  • How did you install Qgrid: pip and conda, v1.3.1
  • Python packages: $ pip freeze or $ conda list (please include qgrid, notebook, and jupyterlab versions)
  • Jupyter lab packages (if applicable): $ jupyter labextension list

Description of Issue

Issue rendering the dataframe. Exception: AttributeError: 'DataFrame' object has no attribute 'map'

  • What did you expect to happen?

Render dataframe

  • What happened instead?
/Applications/Anaconda/anaconda3/lib/python3.9/site-packages/qgrid/grid.py in show_grid(data_frame, show_toolbar, precision, grid_options, column_options, column_definitions, row_edit_callback)
    504 
    505     # create a visualization for the dataframe
--> 506     return QgridWidget(df=data_frame, precision=precision,
    507                        grid_options=grid_options,
    508                        column_options=column_options,

/Applications/Anaconda/anaconda3/lib/python3.9/site-packages/qgrid/grid.py in __init__(self, *args, **kwargs)
    625 
    626         if self.df is not None:
--> 627             self._update_df()
    628 
    629     def _grid_options_default(self):

/Applications/Anaconda/anaconda3/lib/python3.9/site-packages/qgrid/grid.py in _update_df(self)
    818         self._unfiltered_df = self._df.copy()
    819 
--> 820         self._update_table(update_columns=True, fire_data_change_event=False)
    821         self._ignore_df_changed = False
    822 

/Applications/Anaconda/anaconda3/lib/python3.9/site-packages/qgrid/grid.py in _update_table(self, update_columns, triggered_by, scroll_to_row, fire_data_change_event)
    909                 series_to_set = df[sort_column_name]
    910             else:
--> 911                 series_to_set = self._get_col_series_from_df(
    912                     col_name, df, level_vals=True
    913                 ).map(stringify)

/Applications/Anaconda/anaconda3/lib/python3.9/site-packages/pandas/core/generic.py in __getattr__(self, name)
   5485         ):
   5486             return self[name]
-> 5487         return object.__getattribute__(self, name)
   5488 
   5489     def __setattr__(self, name: str, value) -> None:

AttributeError: 'DataFrame' object has no attribute 'map'

Reproduction Steps -

It happens in my environment with this particular DataFrame. Other DataFrames are rendered fine, no issue with them.

  1. Unable to share the entire DataFrame. However, I have confirmed that the object is of type: pandas.core.frame.DataFrame

...

What steps have you taken to resolve this already?

...

Anything else?

...

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

No branches or pull requests

1 participant