<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Input and Output
Step1:  NumPy binary files (NPY, NPZ)
Q1. Save x into temp.npy and load it.
Step2:  Q2. Save x and y into a single file 'temp.npz' and load it.
Step3:  Text files
Q3. Save x to 'temp.txt' in string format and load it.
Step4:  Q4. Save x, y, and z to 'temp.txt' in string format line by line, then load it.
Step5:  Q5. Convert x into bytes, and load it as array.
Step6:  Q6. Convert a into an ndarray and then convert it into a list again.
Step7:  String formatting¶
Q7. Convert x to a string, and revert it.
Step8:  Text formatting options
Q8. Print x such that all elements are displayed with precision=1, no suppress.
<ASSISTANT_TASK:>
Python Code:
from __future__ import print_function
import numpy as np
author = "kyubyong. https://github.com/Kyubyong/numpy_exercises"
np.__version__
from datetime import date
print(date.today())
Explanation: Input and Output
End of explanation
x = np.arange(10)
...
# Check if there exists the 'temp.npy' file.
import os
if os.path.exists('temp.npy'):
    x2 = ...
    print(np.array_equal(x, x2))
Explanation: NumPy binary files (NPY, NPZ)
Q1. Save x into temp.npy and load it.
End of explanation
x = np.arange(10)
y = np.arange(11, 20)
...
with ... as data:
    x2 = data['x']
    y2 = data['y']
    print(np.array_equal(x, x2))
    print(np.array_equal(y, y2))
Explanation: Q2. Save x and y into a single file 'temp.npz' and load it.
End of explanation
x = np.arange(10).reshape(2, 5)
header = 'num1 num2 num3 num4 num5'
...
...
Explanation: Text files
Q3. Save x to 'temp.txt' in string format and load it.
End of explanation
x = np.arange(10)
y = np.arange(11, 21)
z = np.arange(22, 32)
...
...
Explanation: Q4. Save x, y, and z to 'temp.txt' in string format line by line, then load it.
End of explanation
x = np.array([1, 2, 3, 4])
x_bytes = ...
x2 = ...
print(np.array_equal(x, x2))
Explanation: Q5. Convert x into bytes, and load it as array.
End of explanation
a = [[1, 2], [3, 4]]
x = ...
a2 = ...
print(a == a2)
Explanation: Q6. Convert a into an ndarray and then convert it into a list again.
End of explanation
x = np.arange(10).reshape(2,5)
x_str = ...
print(x_str, "\n", type(x_str))
x_str = x_str.replace("[", "") # [] must be stripped
x_str = x_str.replace("]", "")
x2 = ...
assert np.array_equal(x, x2)
Explanation: String formatting¶
Q7. Convert x to a string, and revert it.
End of explanation
x = np.random.uniform(size=[10,100])
np.set_printoptions(...)
print(x)
Explanation: Text formatting options
Q8. Print x such that all elements are displayed with precision=1, no suppress.
End of explanation
<END_TASK>