AttributeError: 'str' object has no attribute 'pop'
File "C:\PythonWork\Project\fuzzywuzzy-ag.py", line 38, in
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\lib\site-packages\textpack\tp.py", line 12, in init self._column = self._get_column(columns_to_group)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\lib\site-packages\textpack\tp.py", line 21, in _get_column self.df['textpackGrouper'] = self.df[columns_to_group.pop(0)].astype(str).str.cat(self.df[columns_to_group].astype(str))
AttributeError: 'str' object has no attribute 'pop'
Hello, this issue has been unanswered for a year almost. I a facing a similar issue. By any chance, please were you able to solve the issue?
Traceback` (most recent call last): File "G:/Shared drives/Dev/django-Project/scrap_api/textpack_test.py", line 85, in <module> rst = tp.TextPack(df, vals, match_threshold=0.75, ngram_remove=r'[,-./]', ngram_length=3) File "C:\Users\92\anaconda3\envs\djangoscrap\lib\site-packages\textpack\tp.py", line 12, in __init__ self._column = self._get_column(columns_to_group) File "C:\Users\92\anaconda3\envs\djangoscrap\lib\site-packages\textpack\tp.py", line 21, in _get_column self.df['textpackGrouper'] = self.df[columns_to_group.pop(0)].astype(str).str.cat(self.df[columns_to_group].astype(str)) AttributeError: 'numpy.ndarray' object has no attribute 'pop'
Thank you.
Hi, I ran into the same problem. I notice that you have tp.TextPack(df, vals, match_threshold=0.75, ngram_remove=r'[,-./]', ngram_length=3). The vals need to be a list for the .pop() method to work. You might wish to try tp.TextPack(df, ['vals'], match_threshold=0.75, ngram_remove=r'[,-./]', ngram_length=3) instead, if vals is the name of the column you wish to analyze.
Hi, I ran into the same problem. I notice that you have
tp.TextPack(df, vals, match_threshold=0.75, ngram_remove=r'[,-./]', ngram_length=3). Thevalsneed to be a list for the .pop() method to work. You might wish to trytp.TextPack(df, ['vals'], match_threshold=0.75, ngram_remove=r'[,-./]', ngram_length=3)instead, ifvalsis the name of the column you wish to analyze.
Thank you for your suggestion. I will try it.