In [1]:
import pandas as pd
import numpy as np
from pandas import Series, DataFrame
In [2]:
np.random.seed(12345)
In [3]:
dframe = DataFrame(np.random.randn(1000, 4))
In [4]:
dframe.head()
Out[4]:
In [5]:
dframe.tail()
Out[5]:
In [7]:
dframe.describe()
Out[7]:
In [8]:
col = dframe[0]
In [9]:
col.head()
Out[9]:
In [10]:
col[np.abs(col) > 3]
Out[10]:
In [11]:
dframe[(np.abs(dframe) > 3).any(1)]
Out[11]:
In [12]:
dframe[np.abs(dframe) > 3] = np.sign(dframe) * 3
In [13]:
dframe.describe()
Out[13]:
In [ ]: