79760755

Date: 2025-09-10 10:50:41
Score: 1
Natty:
Report link

For anyone looking at this now, as noted when you have strings ("?") mixed in with ints you can do the following in pandas.

# convert the data to int64/float64 turning anything (i.e '?') that can't be converted into nan 
df["Bare Nuclei"] = pd.to_numeric(df["Bare Nuclei"], errors="coerce")
# if you really need it as int you can then do the following, Int64 can handle NaN values so is useful in these situations
df["Bare Nuclei"] = df["Bare Nuclei"].astype("Int64")
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: gj_overflow