Skip to content

'DataFrame' object has no attribute 'k' #114

@james-cranley

Description

@james-cranley

Thank you for the package. I recently updated to 1.7.0

For my particular data, this used to run without error in v.1.6.0

cnmf_obj_corrected.k_selection_plot(close_fig=False)

Now I get this error

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [12], in <cell line: 1>()
     33     cnmf_obj_corrected.factorize(worker_i=0, total_workers=NUM_WORKERS)
     34     cnmf_obj_corrected.combine(skip_missing_files=True)
---> 35     cnmf_obj_corrected.k_selection_plot(close_fig=False)
     36     cnmf_obj_corrected.consensus(
     37         k=MIN_COMPONENT,
     38         density_threshold=0.1,
     39         show_clustering=True,
     40         close_clustergram_fig=False
     41     )
     42 else:

File ~/.conda/envs/cNMF/lib/python3.10/site-packages/cnmf/cnmf.py:1142, in cNMF.k_selection_plot(self, close_fig)
   1138 ax1 = fig.add_subplot(111)
   1139 ax2 = ax1.twinx()
-> 1142 ax1.plot(stats.k, stats.silhouette, 'o-', color='b')
   1143 ax1.set_ylabel('Stability', color='b', fontsize=15)
   1144 for tl in ax1.get_yticklabels():

File ~/.conda/envs/cNMF/lib/python3.10/site-packages/pandas/core/generic.py:6299, in NDFrame.__getattr__(self, name)
   6292 if (
   6293     name not in self._internal_names_set
   6294     and name not in self._metadata
   6295     and name not in self._accessors
   6296     and self._info_axis._can_hold_identifiers_and_holds_name(name)
   6297 ):
   6298     return self[name]
-> 6299 return object.__getattribute__(self, name)

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

I'm not sure why this has changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions