Skip to content

Commit 9cc406b

Browse files
authored
Update README.md
1 parent 1daaba7 commit 9cc406b

File tree

1 file changed

+0
-65
lines changed

1 file changed

+0
-65
lines changed

README.md

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -19,71 +19,6 @@
1919
- [Recursive Feature Elimination](#recursive-feature-elimination)
2020

2121

22-
# Introduction to arrays using numpy
23-
24-
Arrays are used to store multiple values in one single variable.
25-
An array is a kind of list.
26-
All the elements in an array are the exact same type
27-
28-
Let's use the numpy python library to handle arrays
29-
30-
```
31-
>>> import numpy as np
32-
```
33-
34-
data type int64
35-
```
36-
>>> ti = np.array([1, 2, 3, 4])
37-
>>> ti
38-
array([1, 2, 3, 4])
39-
>>> ti.dtype
40-
dtype('int64')
41-
>>>
42-
```
43-
44-
data type float64
45-
```
46-
>>> tf = np.array([1.5, 2.5, 3.5, 4.5])
47-
>>> tf.dtype
48-
dtype('float64')
49-
```
50-
access to some elements
51-
```
52-
>>> t = np.array ([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
53-
>>> t
54-
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
55-
>>> t[:6]
56-
array([0, 1, 2, 3, 4, 5])
57-
>>> t
58-
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
59-
```
60-
multi dimensions array
61-
```
62-
>>> tf2d = np.array([[1.5, 2, 3], [4, 5, 6]])
63-
>>> tf2d
64-
array([[1.5, 2. , 3. ],
65-
[4. , 5. , 6. ]])
66-
>>> tf2d.dtype
67-
dtype('float64')
68-
>>> tf2d.shape
69-
(2, 3)
70-
>>> tf2d.ndim
71-
2
72-
>>> tf2d.size
73-
6
74-
```
75-
random number (float) generation
76-
```
77-
>>> np.random.rand(10)
78-
array([0.67966246, 0.26205002, 0.02549579, 0.11316062, 0.87369288,
79-
0.16210068, 0.51009515, 0.92700258, 0.6370769 , 0.06820358])
80-
```
81-
```
82-
>>> np.random.rand(3,2)
83-
array([[0.78813667, 0.92470323],
84-
[0.63210563, 0.97820931],
85-
[0.44739855, 0.03799558]])
86-
```
8722

8823
# visualize a dataset using seaborn
8924

0 commit comments

Comments
 (0)