dushubaogao

import pandas as pd
import numpy as np

# 通过一维数组初始化Series
s = pd.Series([1, 2.0, np.nan, 'test'])
print(s)

# 通过二维数组初始化DataFrame
arr = np.random.randn(6, 4)
arr_df = pd.DataFrame(arr, index=np.arange(1, 7), columns=list('ABCD'))
print(arr_df)
# 通过字典dict初始化DataFrame
dic = {'A': 1.,
'B': pd.Timestamp('20130102'),
'C': pd.Series(1, index=list(range(4)), dtype='float32'),
'D': np.array([3] * 4, dtype='int32'),
'E': pd.Categorical(["test", "train", "test", "train"])
}
dic_df = pd.DataFrame(dic)
print(dic_df)

from pylab import *
import rof

im = array(Image.open('empire.jpg').convert('L'))
U,T = rof.denoise(im,im)

figure()
gray()
imshow(U)
axis('equal')
axis('off')
show()

上一篇:C++ 入门学习(练习+代码)—— 05


下一篇:大数据测试4