<jupyter_start><jupyter_text>Table of Contents1&nbsp;&nbsp;Numbers1.1&nbsp;&nbsp;Integers1.2&nbsp;&nbsp;Floating point numbers1.3&nbsp;&nbsp;Complex numbers2&nbsp;&nbsp;typecast in python2.1&nbsp;&nbsp;Basic operations using math module2.2&nbsp;&nbsp;List of methods in math module  Data Structures in pythonIn simple terms, It is the collection or group of data in a particular structure.  NumbersPython has three number category: 1. Integers 2. Floating point numbers 3. Complex numbers  IntegersThey are defined as int, float and complex class in Python.We can use the `type()` function to know which class a variable or a value belongs to and the `isinstance()` function to check if an object belongs to a particular class.<jupyter_code>x = 10
print(x, "is of type", type(x))
type(x)<jupyter_output><empty_output><jupyter_text>Integers can be of any length, it is only limited by the memory available.<jupyter_code>x = 1234567890123456789
print(x)
z = 1
print(z, "is complex number?", isinstance(z,complex))<jupyter_output>1 is complex number? False<jupyter_text>Floating point numbers Integer and floating points are separated by decimal points. 1 is integer, 1.0 is floating point number.<jupyter_code>y = 5.0
print(y, "is of type", type(y))<jupyter_output>5.0 is of type <class 'float'><jupyter_text>Floats with very big or very small absolute value can be written using scientific notation. Example: - The distance from the Earth to the Sun is 1.496e11 in python. - The mass of the one molecule of the water is 2.99e-23 in python<jupyter_code>d = 1.496e11
d<jupyter_output><empty_output><jupyter_text>Complex numbers Complex numbers are written in the form, `x + yj`, where x is the real part and y is the imaginary part. Here are some examples.<jupyter_code>z = 1+2j
print(z, "is complex number?", isinstance(1+2j,complex))
print(z.real,z.imag)
z = complex(1,2)
print(z)<jupyter_output>(1+2j)<jupyter_text>typecast in python<jupyter_code>a = 1.496e11
b = int(a)
type(b)
c = float(a)
type(c)
c
round(c)     # round to int towards zero
round(2.675009922, 3)   # round upto three decimal place
float(2+3j)   # Complex variable cannot be cast to int or float<jupyter_output><empty_output><jupyter_text>Basic operations using math module<jupyter_code>import math     # import the math module

x = math.ceil(4.2)
print(x)
abs(-3)
abs(3+4j)<jupyter_output><empty_output><jupyter_text>List of methods in math module|Function:     ||               Description||----||---||**Rounding**||||----||---||`floor(x)`        |:|	Return the floor of x, the largest integer less than or equal to x.||`ceil(x)`	        |:|   Return the ceiling of x, the smallest integer greater than or equal to x.||**Roots and logarithms**||||`sqrt(x)`         |:| 	Return the square root of x||`log(x)`	        |:|   With one argument, return the natural logarithm of x (to base e). With two arguments, return the logarithm of x to the given base||`e`               |:|	The mathematical constant e = 2.71828...||**Trigonometry**||||`sin(x)`	        |:|   Return the sine of x radians||`asin(x)`	        |:|   Return the arcsine of x, in radians||`pi`	            |:|   The mathematical constant $\pi$ = 3.1415...|<jupyter_code>math.sqrt(16)
math.sin(math.pi/2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11914241960183768, 'fraction_numerical': 0.0330781010719755, 'mean_word_length': 4.6407599309153715, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '538412', 'license': 'MIT', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1068, 'n_words': 369, 'path': '01_PythonWorkshop/Day02/01_Numbers.ipynb', 'repo_name': 'erkundanec/Data-Science-Full', 'size': '3265'}