AttributeError: 'float' object has no attribute 'replace')

1,504 views
Skip to first unread message

Kath R

unread,
Feb 2, 2021, 10:57:54 AM2/2/21
to FUMA GWAS users
Hi there,
I am getting this error: 
ERROR: 1 (Input file format was not correct / AttributeError: 'float' object has no attribute 'replace')
Please make sure your input file has sufficient column names. 

(Job id  115794)

I have checked the columns (titles) and the format (columns to rows) and all looks fine. 

Any help or suggestion appreciated. 



d.p.wi...@vu.nl

unread,
Feb 2, 2021, 11:05:13 AM2/2/21
to FUMA GWAS users
Hi, 

It looks like your chromosome column has a value that is not an integer. Can you share the unique values that exist in your chromosome column? What characters are you using as a delimiter?

Cheers,
Doug

Kath R

unread,
Feb 2, 2021, 11:50:56 AM2/2/21
to FUMA GWAS users
Hi Doug

thanks for the reply.

The column types are: 
CHR int64  POS int64  Allele1 object  BETA float64  SE float64  p.value float64 
and sep= " "

d.p.wi...@vu.nl

unread,
Feb 2, 2021, 2:54:17 PM2/2/21
to FUMA GWAS users
Hi

Would you be able to send me the first two columns of your input data (Just CHR and POS)? I can look in more detail what is causing this error. My email is d.p.wi...@vu.nl.

Cheers,
Doug

Kath R

unread,
Feb 3, 2021, 1:46:21 AM2/3/21
to FUMA GWAS users
Hi Doug

thanks for the suggestive comments!

You asking about the unique values I did awk '{ a[$1]++ } END { for (b in a) { print b } }' to see the values I have in the CHR column and turned out one "unique value" was emptiness. awk -F' ' '!length($1)' suggested a few whole lines are empty, so I deleted these from the file and did not get the error anymore.
Thanks for the help, the error message was not really directing me that way.

K

d.p.wi...@vu.nl

unread,
Feb 3, 2021, 3:54:09 AM2/3/21
to FUMA GWAS users
Great, I am glad that you managed to get it working now!

Doug

Career Chrome

unread,
Jun 3, 2022, 3:31:50 AM6/3/22
to FUMA GWAS users
Hey am also facing this issue AttributeError: 'float' object has no attribute 'replace'

Can you help me?

Marijn Schipper

unread,
Jun 3, 2022, 4:26:44 AM6/3/22
to FUMA GWAS users
Hi,

The issue you seem to be facing is that one of the columns that should have a number instead contains a different data format.
Please check whether all collumns that should contain a number do not contain a text.
Meanwhile would you mind sharing your jobID?

Cheers,
Marijn

Op vrijdag 3 juni 2022 om 09:31:50 UTC+2 schreef Career Chrome:
Reply all
Reply to author
Forward
0 new messages