In [3]:
import pandas as pd
import numpy as np
print(pd.DataFrame([[2, 3],] * 3, columns=['A', 'B']).apply(lambda x: x + 1))
   A  B
0  3  4
1  3  4
2  3  4
In [4]:
import pandas as pd
df_obj = pd.DataFrame([[4, -1, -3, 0],
                                         [2, 6, -1, -7],
                                         [8, 6, -5, 1]])
print(df_obj.sort_values(by=1))
   0  1  2  3
0  4 -1 -3  0
1  2  6 -1 -7
2  8  6 -5  1
In [5]:
import pandas as pd
ser_obj = pd.Series(range(1, 6), index=[5, 3, 1, 3, 2])
print(ser_obj)
5    1
3    2
1    3
3    4
2    5
dtype: int64
In [6]:
arr2d = np.array([[11, 20, 5],[21, 15, 26],[17, 8, 19]])
arr2d[0:2, 0:2]
Out[6]:
array([[11, 20],
       [21, 15]])
In [ ]: