/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
A 8
B 9
C 10
D 11
Name: 7, dtype: int64
print(df.ix[2])
df.ix[2].values
A 8
B 9
C 10
D 11
Name: 7, dtype: int64
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:2: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
array([ 8, 9, 10, 11])
df.ix[1:3]# 多行,下同
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
A
B
C
D
6
4
5
6
7
7
8
9
10
11
df.ix[[1,3]]
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
A
B
C
D
6
4
5
6
7
8
12
13
14
15
df.ix['5':'7']
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
A
B
C
D
5
0
1
2
3
6
4
5
6
7
7
8
9
10
11
df.ix[['5','7']]
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:3: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
This is separate from the ipykernel package so we can avoid doing imports until
A 0
B 1
C 2
D 3
Name: 1, dtype: int64
df.index =range(11,15)
df.ix[2]# KeyError: 2
3.2,列
df.ix[:,'C']# 单列,下同
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
11 2
12 6
13 10
14 14
Name: C, dtype: int64
df.ix[:,2]
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
11 2
12 6
13 10
14 14
Name: C, dtype: int64
df.ix[:,1:3]# 多列,下同
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
B
C
11
1
2
12
5
6
13
9
10
14
13
14
df.ix[:,[1,3]]
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
B
D
11
1
3
12
5
7
13
9
11
14
13
15
df.ix[:,'A':'C']
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.
A
B
C
11
0
1
2
12
4
5
6
13
8
9
10
14
12
13
14
df.ix[:,['A','C']]
/home/xiaohaipeng/.local/lib/python3.5/site-packages/ipykernel_launcher.py:1: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing
See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
"""Entry point for launching an IPython kernel.