MIDASverse / MIDASpy

Python package for missing-data imputation with deep learning
Apache License 2.0
125 stars 35 forks source link

module 'MIDASpy' has no attribute 'cat_conv' #14

Closed ihameed11 closed 3 years ago

ihameed11 commented 3 years ago

AttributeError: module 'MIDASpy' has no attribute 'cat_conv'

how i can solve this problem ? I'm using jupyter

ranjitlall commented 3 years ago

Hi @ihameed11, can you provide us with the following?

ihameed11 commented 3 years ago

@ranjitlall operating system: windows 10 64bit python 3.9.4 numpy 1.19.5 tensorflow 2.5.0rc2 example: I was trying the same example midas_demo

tsrobinson commented 3 years ago

Hi @ihameed11, given the error message, it seems you may not have the latest version of MIDASpy -- cat_conv() was introduced in v.1.2.1.

I've just run the MIDASpy example using your spec and don't encounter the same error (with and without using jupyter).

Please try upgrading MIDASpy by running pip install --upgrade midaspy at the command line and see if that fixes the issue.

ihameed11 commented 3 years ago

@tsrobinson yes now it's working thank you but what about this code : for i in imputations: file_out = midas_imp_" + str(n) +.csv" i.to_csv(file_out, index=False) n += 1

I'm getting : file_out = midas_imp_" + str(n) +.csv" ^ SyntaxError: invalid syntax

tsrobinson commented 3 years ago

Thanks for spotting this -- the opening quotation marks were incorrect in the example. I've updated the example code (5b32c361dd11a813c62adadf334c617cfe332403), but for reference it should read:

for i in imputations:
   file_out = "midas_imp_" + str(n) + ".csv"
   i.to_csv(file_out, index=False)
   n += 1
ihameed11 commented 3 years ago

@tsrobinson thank you

catubc commented 3 years ago

Yes, I also had this issue, had to uninstall everything via pip and reinstall as the update was not going through. Tx