top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Converting Fahrenheit to Celsius with Python

Writer's picture: Alberta JohnsonAlberta Johnson


Looking to change Fahrenheit to Celsius or Celsius to Fahrenheit?

I'm going to talk on how to Covert Temperature that is from Fahrenheit to Celsius.

The Fahrenheit scale is a temperature scale based on one proposed in 1724 by the physicist Daniel Gabriel Fahrenheit (1686–1736). It uses the degree Fahrenheit (symbol: °F) as the unit. In the Fahrenheit scale, water freezes at 32 degrees, and boils at 212 degrees.


The degree Celsius is a unit of temperature on the Celsius scale, a temperature scale originally known as the centigrade scale. The degree Celsius (symbol: °C) can refer to a specific temperature on the Celsius scale or a unit to indicate a difference or range between two temperatures. It is named after the Swedish astronomer Anders Celsius (1701–1744), who developed a similar temperature scale.


F° TO C°: FAHRENHEIT TO CELSIUS CONVERSION FORMULA

To convert temperatures in degrees Fahrenheit to Celsius, subtract 32 and multiply by .5556 (or 5/9).

  • Example: (50°F - 32) x .5556 = 10°C

Now let's consider a simple converter app, written in Python language.


# A function to convert Fahrenheit to degree Celsius

def temperature converter(Fahrenheit):

Input the temperature to convert to Celsius

Fahrenheit to Celsius

°C = (°F – 32) x 5/9

Celsius to Fahrenheit

Fahrenheit = 9.0/5.0 * Celsius + 32


Celsius = (Fahrenheit - 32) * 5.0/9.0

 Celsius = np.round(Celsius,2)

return '{} Fahrenheit is equivalent to {} Degree Celsius'.format(Fahrenheit,Celsius)

# Invoke the function


temperature_converter(2)

Output displayed


'2 Fahrenheit is equivalent to -16.67 Degree Celsius'

In conclusion, the above approach is used to convert temperature Fahrenheit to Celsius.

0 comments

Recent Posts

See All

תגובות


COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page