From 2978fe32e5f42236148563799006d244b78944ec Mon Sep 17 00:00:00 2001 From: j Date: Wed, 29 Mar 2023 22:59:10 +0200 Subject: [PATCH] Update page 'Day 1 homework' --- Day 1 homework.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Day 1 homework.md b/Day 1 homework.md index 5ce8422..800ac62 100644 --- a/Day 1 homework.md +++ b/Day 1 homework.md @@ -2,6 +2,7 @@ 2. How many bits are the floating point numbers defined by that standard allowed to be? 3. Does your computer support all those formats? Can you think of an easy way to check with only one line of Python? 4. Why doesn't this code give the same answers to the two multiplications? + ``` import pandas as pd import numpy as np @@ -22,6 +23,7 @@ df['Product'] = df['Number1'] * df['Number2'] print(df) ``` + 5. You can use `sys.getsizeof` to see how large a Python object is. Does the size of a Python floating-point number change as it gets larger? Why or why not? 6. We already know that the precision of floating-point numbers decreases as their magnitude increases. Using Pandas, create a dataframe representing a large amount of US Dollars. What is the smallest number of dollars where adding one cent begins to yield wrong results? 7. Name three practical differences between Python strings and bytes. Using `sys.getsizeof`, see how the sizes may be different. Do emoji change this answer?