Convert to Python 3
I try to run the code, but there was an error. How do I fix this? Thanks for your help
Hi @anita06172, this should be fixed in commit 41a214df36de98a67a116fbb34016c5183f0a302. You'll need to re-download and re-install. FYI the package has been upgraded to Python 3, and support for Python 2 has been dropped.
Can you let me know if it runs? Otherwise, let me know your OS, version of Python, and IDE.
Thank you @aeturrell. It works for the script that I tried to run earlier. However, I tried to run the code with my owned data, there was another error, as followed.
Thanks again for your help!
Try running the script like this:
import pandas as pd
from occupationcoder.coder import coder
if __name__ == '__main__':
myCoder = coder.Coder()
df = pd.read_excel('excel_test.xlsx')
df = df.fillna('')
df = myCoder.codedataframe(df)
print(df)
...
where you can add what you need at the end. NB: I tested this as a stand alone script but not in a Jupyter notebook.