loaderload() fails in latest pandas
Closed this issue · 4 comments
Hi, I've Pandas 1.0.4 installed and if I try to execute the following code, it shows be the error AttributeError: 'DataFrame' object has no attribute 'ix'
, which is because ix is deprecated.
from indicnlp import loader
loader.load()
Full stacktrace of the error.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-6-5f49d51c6132> in <module>
1 from indicnlp import loader
----> 2 loader.load()
~/anaconda3/envs/nlp_bert/lib/python3.6/site-packages/indicnlp/loader.py in load()
25
26 ## Initialization of Indic scripts module
---> 27 indic_scripts.init()
28
29 ## Initialization of English scripts module
~/anaconda3/envs/nlp_bert/lib/python3.6/site-packages/indicnlp/script/indic_scripts.py in init()
104 TAMIL_PHONETIC_DATA=pd.read_csv(os.path.join(common.get_resources_path(),'script','tamil_script_phonetic_data.csv'),encoding='utf-8')
105
--> 106 ALL_PHONETIC_VECTORS= ALL_PHONETIC_DATA.ix[:,PHONETIC_VECTOR_START_OFFSET:].as_matrix()
107 TAMIL_PHONETIC_VECTORS=TAMIL_PHONETIC_DATA.ix[:,PHONETIC_VECTOR_START_OFFSET:].as_matrix()
108
~/anaconda3/envs/nlp_bert/lib/python3.6/site-packages/pandas/core/generic.py in __getattr__(self, name)
5272 if self._info_axis._can_hold_identifiers_and_holds_name(name):
5273 return self[name]
-> 5274 return object.__getattribute__(self, name)
5275
5276 def __setattr__(self, name: str, value) -> None:
AttributeError: 'DataFrame' object has no attribute 'ix'
Any chance of making it compatible with pandas >= 1.0 in near future?
One more issue is, I saw this line in the sample notebook that you're using: sys.path.append(r'{}\src'.format(INDIC_NLP_LIB_HOME))
. But if I look into the repo there is no src folder in the top level dir. Probably it needs to get updated.
I have already fixed this: #20. Are you using the pip package? Probably not updated that - will do it. You can pull the latest code. Yeah, I will update the notebook too. The code has been refactored.
Hi, thank you for the quick response. Yes, I was using the pip package from Dec '19. For now I've downgraded pandas in a separate conda env and it's working. On the same note, would you be accepting pull requests in this repo? Because I'm currently working in NLP and would like to contribute to this project, if you're okay with it.
Yes, I would be happy to accept contributions. Particularly stuff that can scale to multiple languages.
pypi package updated. Version 0.71