import numpy as np
In [5]:
In [6]:
Out[6]:
In [7]:
Out[7]:
In [8]:
Out[8]:
In [10]:
Out[10]:
In [14]:
Out[14]:
In [15]:
Out[15]:
In [16]:
Out[16]:
In [17]:
Out[17]:
In [18]:
Out[18]:
In [19]:
Out[19]:
import numpy as np
import pandas as pd
sdata1 = pd.Series([4,7,-5,1])
sdata1 = pd.Series([4,7,-5,1], index = ['a','b','a','d'])
sdata1
a 4 b 7 a -5 d 1 dtype: int64
sdata1.index
Index(['a', 'b', 'a', 'd'], dtype='object')
sdata1.values
array([ 4, 7, -5, 1])
sdata1['b']
7
sdata1['d'] = 100
sdata1
a 4 b 7 a -5 d 100 dtype: int64
sdata1 * 3
a 12 b 21 a -15 d 300 dtype: int64
sdata1 > 0
a True b True a False d True dtype: bool
sdata1[sdata1 > 0]
a 4 b 7 d 100 dtype: int64
np.cos(sdata1)
a -0.653644 b 0.753902 a 0.283662 d 0.862319 dtype: float64
ddata = {'name':'lee', 'age':30, 'height':180}
ddata
{'name': 'lee', 'age': 30, 'height': 180}
sdata2 = pd.Series(ddata)
sdata2
0 댓글