Update page 'Day 1 homework'
@@ -2,6 +2,7 @@
|
|||||||
2. How many bits are the floating point numbers defined by that standard allowed to be?
|
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?
|
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?
|
4. Why doesn't this code give the same answers to the two multiplications?
|
||||||
|
|
||||||
```
|
```
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@@ -22,6 +23,7 @@ df['Product'] = df['Number1'] * df['Number2']
|
|||||||
|
|
||||||
print(df)
|
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?
|
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?
|
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?
|
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?
|
||||||
|
|||||||
Reference in New Issue
Block a user