cuelee / pleio

17 stars 6 forks source link

AttributeError: 'Series' object has no attribute 'to_numpy'. in ./ldsc_preprocess.py #17

Open EleniFri opened 2 years ago

EleniFri commented 2 years ago

After installing ldsc in my pleio directory, creating a conda environment, and activating it when I call ./ldsc_preprocess.py -h it runs. However when I attempt to prepare the file for pleio I get the following error:

AttributeError: 'Series' object has no attribute 'to_numpy'.

If I try to use any later version of pandas I get:

ImportError: Missing required dependencies ['numpy'] and in that case ./ldsc_preprocess.py -h yields the same result.

I get the same errors when I run the tutorial data.

What am I missing here? Thanks a lot!

EleniFri commented 2 years ago

I installed pandas 0.24.2 in ldsc env and this issue was solved However now I get TypeError: 'instancemethod' object has no attribute 'getitem' in line 270.

Steven-ZWQ commented 2 years ago

Hi, EleniFri, do you fix it? I got the same error.

EleniFri commented 2 years ago

I replaced line 270 with s = df.index[res].to_numpy() and it works. It only refers to the error output so it does not change anything in the outcome :)

Steven-ZWQ commented 2 years ago

Thanks so much. I still can't fix it by replacing line 270 with s = df.index[res].to_numpy(). The packages I installed in the ldsc environment were pandas-0.20.0, numpy-1.16.0, scipy-0.18.0, python-2.7.18. The LDSC software works well when calculating genetic correlation.

EleniFri commented 2 years ago

When you install ldsc it comes with an environment, this is where you run the ldsc_preprocess. For that you do not need to install any additional packages other than the ones already there. So I think I would reinstall the ldsc env and then try to run ldsc preprocess with the line 270 replaced as above. Let me know if that helped!