You have a few options...

1) convert everything to integers.

df.astype(int)
          <=35  >35
Cut-off            
Calcium      0    1
Copper       1    0
Helium       0    8
Hydrogen     0    1

2) Use round:

>>> df.round()
          <=35  >35
Cut-off            
Calcium      0    1
Copper       1    0
Helium       0    8
Hydrogen     0    1

but not always great...

>>> (df - .2).round()
          <=35  >35
Cut-off            
Calcium     -0    1
Copper       1   -0
Helium      -0    8
Hydrogen    -0    1

3) Change your display precision option in Pandas.

pd.set_option('precision', 0)

>>> df
          <=35  >35
Cut-off            
Calcium      0    1
Copper       1    0
Helium       0    8
Hydrogen     0    1 
Answer from Alexander on Stack Overflow
🌐
Saturn Cloud
saturncloud.io › blog › how-to-remove-decimal-points-in-pandas-a-guide-for-data-scientists
How to Remove Decimal Points in Pandas A Guide for Data Scientists | Saturn Cloud Blog
December 23, 2023 - In this article, we’ll explore ... them in your code. ... The simplest way to remove decimal points in pandas is by using the round() function. This function rounds a given number to a specified number of decimal plac...
Discussions

python - Deleting decimals from a pandas dataframe - Stack Overflow
I have numbers such as 24.00 2.00 3.00 I want to have 24 2 3 I have used .astype(int), round() but I keep getting the former. How do I get this to work? More on stackoverflow.com
🌐 stackoverflow.com
how to remove decimal points from values ?
https://www.google.com/search?q=python+remove+decimal More on reddit.com
🌐 r/learnpython
4
0
December 5, 2023
pandas - Python - Remove decimal and zero from string - Stack Overflow
I'm reading several spreadsheets into a data frame and there is an ID field that is a string in some spreadsheets and a number in others. I've converted it into a string, which is the data type I n... More on stackoverflow.com
🌐 stackoverflow.com
python - Remove Decimal in pandas - Stack Overflow
In my dataset at column 'Time Period', I have series which contains 2018 and 2019. When I plot it with 'countries and areas' column, I am getting results like this. enter image description here enter More on stackoverflow.com
🌐 stackoverflow.com
🌐
CodeProject
codeproject.com › Questions › 5291723 › How-do-I-remove-decimals-from-a-pandas-data-frame
How do I remove decimals from a pandas data frame index
September 1, 2021 - Do not try and find the page. That’s impossible. Instead only try to realise the truth - For those who code; Updated: 1 Jul 2007
🌐
GitHub
github.com › beepscore › pandas_decimal
GitHub - beepscore/pandas_decimal: Using Pandas with Python Decimal for accurate currency arithmetic · GitHub
def int_by_removing_decimal(self, a_float): """ removes decimal separator. removing decimal from a_float with n decimal places multiplies by 10 ** n :a_float: a Python float e.g. 1.23 :return: an integer e.g.
Author   beepscore
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-remove-all-decimals-from-a-number-using-python
How to remove all decimals from a number using Python? - GeeksforGeeks
March 27, 2025 - Removing elements from a list can ... :Make the fraction an incorrect fraction if it's a mixed number.Subtract the denominator from the numerator.Round the decimal off if the division does not come out evenly.A number System ...
🌐
Homedutech
homedutech.com › faq › python › how-to-remove-decimal-points-in-pandas.html
How to remove decimal points in pandas
In pandas, you can remove decimal points from a column containing float values by using the .astype() function to convert the column to an integer type. This effectively removes the decimal points and truncates the decimal values.
🌐
Javatpoint
javatpoint.com › how-to-remove-decimal-in-python
How to Remove Decimal in Python - Javatpoint
How to Remove Decimal in Python with python, tutorial, tkinter, button, overview, entry, checkbutton, canvas, frame, environment set-up, first python program, operators, etc.
Find elsewhere
🌐
CopyProgramming
copyprogramming.com › howto › python-remove-demical-on-a-certain-column-pandas
How to Remove Decimals from a Pandas Column - Remove decimals from a pandas column
December 20, 2025 - It strictly truncates (cuts off) the decimal part toward zero. For example, 5.9 becomes 5. If you need it to become 6, you must call .round().astype(int). 3. What is the difference between Int64 and int64 in Pandas? Int64 (capital I) is a nullable Pandas object that supports missing values, whereas int64 (lowercase i) is a raw NumPy data type that cannot store NaN and will crash if missing data is present. 4. How do I remove decimals but keep the column as a string/object?
🌐
CopyProgramming
copyprogramming.com › howto › python-how-to-remove-decimal-number-using-python
How to Remove Decimal Numbers in Python: Complete Guide 2026 - Remove decimal numbers in python complete guide
December 30, 2025 - For bulk operations, use NumPy/Pandas instead of loops · Always round late, not early, to minimize accumulated error · Always initialize Decimal from strings, never floats · Test rounding behavior explicitly in financial systems before deploying · Removing decimals correctly is more subtle than it appears.
🌐
YouTube
youtube.com › hey delphi
PYTHON : How to remove decimal points in pandas - YouTube
PYTHON : How to remove decimal points in pandasTo Access My Live Chat Page, On Google, Search for "hows tech developer connect"As promised, I'm going to shar...
Published   April 13, 2023
Views   88
🌐
Stack Overflow
stackoverflow.com › questions › 67722165 › remove-decimal-in-pandas
python - Remove Decimal in pandas - Stack Overflow
You probably have a nan value in this column. You must remove them first, then convert to int: df["Time Period"].astype(int).
🌐
Beepscore
beepscore.com › website › 2018 › 10 › 12 › using-pandas-with-python-decimal.html
Using Pandas with Python Decimal for accurate currency arithmetic
def int_by_removing_decimal(self, a_float): """ removes decimal separator. removing decimal from a_float with n decimal places multiplies by 10 ** n :a_float: a Python float e.g. 1.23 :return: an integer e.g.
🌐
Reddit
reddit.com › r/learnpython › how to terminate or remove the .0 point from an int.
r/learnpython on Reddit: How to terminate or remove the .0 point from an int.
December 9, 2022 -

Hello everyone,

I am still new to python and learning.

So I practiced some exercises and made an app that calculates the percentage from the number the user enters.

My question use, how can I terminate the .0 part if the user enters an Int and keep the decimal part if they enter a float?

so for example, 5% of 100 is 5 ( Int)

and 5.1% of 100 is 5.1 (float)