Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
a8fad9a222
commit
c8f33e1e71
1 changed files with 24 additions and 3 deletions
|
@ -45,7 +45,7 @@ class pandas.Series(data=None, index=None, dtype=None, name=None, copy=None, fas
|
||||||
>
|
>
|
||||||
> Operations between Series (+, -, /, *, **) align values based on their associated index values– they need not be the same length. The result index will be the sorted union of the two indexes.
|
> Operations between Series (+, -, /, *, **) align values based on their associated index values– they need not be the same length. The result index will be the sorted union of the two indexes.
|
||||||
|
|
||||||
Examples:
|
Example 1:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
@ -62,7 +62,7 @@ Output:
|
||||||
2 Sleep
|
2 Sleep
|
||||||
dtype: object
|
dtype: object
|
||||||
```
|
```
|
||||||
|
Example 2:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -80,7 +80,7 @@ Output:
|
||||||
2 32
|
2 32
|
||||||
dtype: int64
|
dtype: int64
|
||||||
```
|
```
|
||||||
|
Example 3:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -104,6 +104,8 @@ Output:
|
||||||
dtype: float64
|
dtype: float64
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Example 4:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
|
@ -120,3 +122,22 @@ Output:
|
||||||
dtype: object
|
dtype: object
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### index and values
|
||||||
|
|
||||||
|
```python
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
example = pd.Series(["Bambu", "Tree", "Sleep"])
|
||||||
|
print(example.index)
|
||||||
|
print()
|
||||||
|
print(example.values)
|
||||||
|
```
|
||||||
|
|
||||||
|
Output:
|
||||||
|
|
||||||
|
```python
|
||||||
|
RangeIndex(start=0, stop=3, step=1)
|
||||||
|
|
||||||
|
['Bambu' 'Tree' 'Sleep']
|
||||||
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue