ImSoErgodic/py-upset

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

Opened this issue · 2 comments

Hi, I installed pyupset on COLAB.
I get AttributeError: 'DataFrame' object has no attribute 'ix' when trying to run simple plot(data_dict, unique_keys=None)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-26-a1c443ff803d> in <module>()
      7 import pyupset
      8 
----> 9 pplot= pyupset.plot(classesDict(dataset1), unique_keys = ['frame_id'])

3 frames
/usr/local/lib/python3.7/dist-packages/pyupset/visualisation.py in plot(data_dict, unique_keys, sort_by, inters_size_bounds, inters_degree_bounds, additional_plots, query)
     56     all_columns = list(all_columns)
     57 
---> 58     plot_data = DataExtractor(data_dict, all_columns)
     59     ordered_inters_sizes, ordered_in_sets, ordered_out_sets = \
     60         plot_data.get_filtered_intersections(sort_by,inters_size_bounds,inters_degree_bounds)

/usr/local/lib/python3.7/dist-packages/pyupset/visualisation.py in __init__(self, data_dict, unique_keys)
    510                                                                                             unique_keys)
    511         self.in_sets_list, self.inters_degrees, \
--> 512         self.out_sets_list, self.inters_df_dict = self.extract_intersection_data()
    513 
    514 

/usr/local/lib/python3.7/dist-packages/pyupset/visualisation.py in extract_intersection_data(self)
    569                 exclusive_intersection = exclusive_intersection.difference(pd.Index(self.df_dict[s][
    570                     self.unique_keys]))
--> 571             final_df = self.df_dict[seed].set_index(pd.Index(self.df_dict[seed][self.unique_keys])).ix[
    572                 exclusive_intersection].reset_index(drop=True)
    573             inters_dict[in_sets] = final_df

/usr/local/lib/python3.7/dist-packages/pandas/core/generic.py in __getattr__(self, name)
   5139             if self._info_axis._can_hold_identifiers_and_holds_name(name):
   5140                 return self[name]
-> 5141             return object.__getattribute__(self, name)
   5142 
   5143     def __setattr__(self, name: str, value) -> None:

``

I have the same problem!

I have the same issue, it looks like that ix is a depreciated method and we should substitute by .loc