The error is pretty clear. you are trying to replace characters in a float. x probably is a float. you might want to do str(x) which gets you

Copyf["text"] = [str(x).replace(':',' ') for x in df["text"]]

but i can't see a situation where a float contains a :

Answer from jonathan on Stack Overflow
Discussions

python - AttributeError 'float' object has no attribute 'replace' - Stack Overflow
I am getting the Attribute error: 'float' object has no attribute 'replace' In my program i am reading 3 different files. When i run the code it works perfectly, but only for one of the files. I h... More on stackoverflow.com
🌐 stackoverflow.com
AttributeError: 'numpy.float64' object has no attribute 'replace'
Hello, text raises an error when something else than a string is given Traceback (most recent call last): File "google_earth.py", line 143, in main() File "google_eart... More on github.com
🌐 github.com
3
May 2, 2015
AttributeError: 'float' object has no attribute 'replace'
Lately I've started seeing this error every 15 minutes: 2023-01-15 18:46:36.922 ERROR (MainThread) [custom_components.watchman.coordinator] Unexpected error fetching Watchman data: 'float&#... More on github.com
🌐 github.com
7
January 15, 2023
python - What does float' object has no attribute 'replace' when I try locale.atof in Pandas? - Stack Overflow
I do locale.setlocale(locale.LC_NUMERIC, '') and then df.idh.apply(locale.atof), but it gives me the above mentioned error: AttributeError: 'float' object has no attribute 'replace'. I assume at some point it's getting something like a NaN, maybe or some other string and it does not recognize it. More on stackoverflow.com
🌐 stackoverflow.com
🌐
Python Forum
python-forum.io › thread-37431.html
[Solved]Replace attribute for Floats
June 9, 2022 - Hello, I'm trying to change my MarkupValue based on a price range but I can't seem to get it working properly because there is no 'replace' attribute for float: Error: sell_price = f'{float(sell_price.replace(',', '.')) * Markup:.2f}' AttributeEr...
🌐
MacPorts
trac.macports.org › ticket › 57589
#57589 (py-ggy: AttributeError: 'float' object has no attribute 'replace') – MacPorts
Traceback (most recent call last): ...ib/python2.7/distutils/command/install_egg_info.py", line 69, in safe_version version = version.replace(' ','.') AttributeError: 'float' object has no attribute 'replace'...
🌐
YouTube
youtube.com › watch
Troubleshooting: Fixing AttributeError: 'float' object has no attribute 'replace' in Python - YouTube
Summary: Encountering `AttributeError: 'float' object has no attribute 'replace'` or `AttributeError: 'float' object has no attribute 'pct_change'` in Python...
Published   September 4, 2024
Views   86
🌐
Stack Overflow
stackoverflow.com › questions › 74228750 › attributeerror-float-object-has-no-attribute-replace
python - AttributeError 'float' object has no attribute 'replace' - Stack Overflow
import pandas as pd def getAMSdata(fileName): startTid = [] sluttTid = [] forbruk = [] dataframe= pd.read_csv(fileName, sep=";") startTid = dataframe["Fra"].tolist() sluttTid = dataframe["Til"].tolist() forbruk = dataframe["KWH 60 Forbruk"].tolist() return startTid,sluttTid,forbruk #returnerer lister dataLists = getAMSdata("data/meteringvalues-mp-xxxxx-consumption-202101.csv") for i in range(len(dataLists[2])): dataLists[2][i] = float(dataLists[2][i].replace(',','.')) def getDayCount(timeStampList): dayCount= len(timeStampList) // 24 return dayCount def getMonth(dateAndTimeStr): months = ["Jan
🌐
GitHub
github.com › leforestier › yattag › issues › 15
AttributeError: 'numpy.float64' object has no attribute 'replace' · Issue #15 · leforestier/yattag
May 2, 2015 - Traceback (most recent call last): File "google_earth.py", line 143, in <module> main() File "google_earth.py", line 47, in main task_to_kml_with_yattag(df_task, outdir, filename_base+"_yattag", disp) File "google_earth.py", line 69, in task_to_kml_with_yattag text(lon) File "//anaconda/lib/python2.7/site-packages/yattag/simpledoc.py", line 102, in text self._append(html_escape(strg)) File "//anaconda/lib/python2.7/site-packages/yattag/simpledoc.py", line 210, in html_escape return s.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;") AttributeError: 'numpy.float64' object has no attribute 'replace'
Author   s-celles
Find elsewhere
🌐
Google Groups
groups.google.com › g › fuma-gwas-users › c › JlE4XjSwd3w
AttributeError: 'float' object has no attribute 'replace')
February 2, 2021 - 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.
🌐
GitHub
github.com › dummylabs › thewatchman › issues › 75
AttributeError: 'float' object has no attribute 'replace' · Issue #75 · dummylabs/thewatchman
January 15, 2023 - Lately I've started seeing this error every 15 minutes: 2023-01-15 18:46:36.922 ERROR (MainThread) [custom_components.watchman.coordinator] Unexpected error fetching Watchman data: 'float' object has no attribute 'replace' Traceback (mos...
Author   aherbjornsen
🌐
Bobby Hadz
bobbyhadz.com › blog › python-attributeerror-float-object-has-no-attribute
AttributeError: 'float' object has no attribute 'X' (Python) | bobbyhadz
The Python "AttributeError: 'float' object has no attribute" occurs when we try to access an attribute that doesn't exist on a floating-point number, e.g.
🌐
Reddit
reddit.com › r/learnpython › 'numpy.float64' object has no attribute 'replace'
r/learnpython on Reddit: 'numpy.float64' object has no attribute 'replace'
March 8, 2021 -

Hallo Everyone,

I hope you are all fine, I have this code which I am getting error from , I run the same code on my Spyder and I do not get any error but when I run it on Jupyter Notebook I get this error :

'numpy.float64' object has no attribute 'replace'

this is the code that I have :

oli_row2 = df_oli.iloc[2].tolist()

idx = oli_row2.index("DB")

check_words = oli_row2[idx:]

exact_order = ['NN','ch','ab','An','tr','bcc',]

for i in range(len(check_words)):

if not(check_words[i].replace(" ","")==exact_order[i].replace(" ","")):

new_row = table.add_row()

new_row.cells[0].text = 'Oli'

new_row.cells[1].text = 'Words are out of order in Column'

new_row.cells[2].text = str(check_words[idx])

oli_flag = True

print('Out of order')

I googled lit bit but I could not find any solution.

Thank you in advance,
Best Regards,

🌐
GitHub
github.com › BaselAbujamous › clust › issues › 29
Data pre-processing, AttributeError: 'float' object has no attribute 'replace' · Issue #29 · BaselAbujamous/clust
January 25, 2019 - Data pre-processing, AttributeError: 'float' object has no attribute 'replace'#29 · Copy link · Labels · Answeredbug · johnsolk · opened · on Jan 25, 2019 · Issue body actions · Hello @BaselAbujamous, thank you for providing this capacity for looking at gene expression data from multiple species!
Author   johnsolk
🌐
GitHub
github.com › ranaroussi › yfinance › issues › 1096
AttributeError: 'float' object has no attribute 'upper' · Issue #1096 · ranaroussi/yfinance
October 19, 2022 - Any ideas on the error below? My code works fine on windows locally on my laptop, it basically pulls data for a group of 5000 stocks 1 by 1. When i try to run it onlinus most of the symbols work fine, but i seem to get this error a handf...
Author   gib-uk
🌐
GitHub
github.com › kusterlab › prosit › issues › 58
'float' object has no attribute 'replace' · Issue #58 · kusterlab/prosit
January 8, 2021 - Prosit csv input example works: curl -F "peptides=@examples/peptidelist.csv" http://127.0.0.1:5000/predict/generic Identical csv input format but server returns this: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist...
Author   im281
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-fix-attributeerror-module-numpy-has-no-attribute-float-in-python
How to fix AttributeError: module numpy has no attribute float' in Python - GeeksforGeeks
July 23, 2025 - Below are some of the ways by which we can fix AttributeError: module 'numpy' has no attribute 'float' in Python: Using the built-in Python types directly means replacing the outdated numpy attribute (np.float) with the standard Python type (float).
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-fix-attributeerror-object-has-no-attribute
How to fix AttributeError: object has no attribute - GeeksforGeeks
July 23, 2025 - To understand this error, we first have to know how to read the error message effectively. It typically consists of two parts: "AttributeError" and "Object has no attribute." The former indicates the type of error, and the latter suggests that the attribute we are trying to access does not exist for the object.