import numpy as np
import pandas as pd
import scipy
import matplotlib.pyplot as plt
'''数据导入'''
df = pd.read_csv(r'C:UsersAdministratorDesktopapp01_bgm.csv',encoding='gbk')
print(df.head())#前五行
print(df.tail())#最后五行
print(df.columns[[1,2]])#头信息
print(df.index)
print(df.T)#数据转置使用T方法,
print(df.ix[:,0].head())
print(df.ix[10:20,1])#行索引,列索引
print(df.drop(df.columns[[3]],axis=1))#axis 参数告诉函数到底舍弃列还是行。如果axis等于0,那么就舍弃行。
print(df.describe())#通过describe
属性,对数据的统计特性进行描述
'''
id fen num
count 2216.00000 2216.000000 2216.000000
mean 2519.50000 6.755415 618.274819
std 639.84842 0.842402 959.487784
min 1412.00000 1.200000 51.000000
25% 1965.75000 6.200000 112.000000
50% 2519.50000 6.800000 253.000000
75% 3073.25000 7.300000 693.250000
max 3627.00000 9.100000 10112.000000
'''