October 2018
Beginner to intermediate
676 pages
18h 30m
English
Here are some steps to follow:
txt = np.loadtxt('test.txt', delimiter = ',')txt
Here is the explanation for the preceding code block:
You should get the following output:
array([ 1., 1., 2., 4., 3., 9., 4., 16., 5., 25.])
txt = txt.reshape(5,2)txt
After executing preceding code, you should see the following output:
array([[ 1., 1.], [ 2., 4.], [ 3., 9.], [ 4., 16.], [ 5., 25.]]) ...
Read now
Unlock full access