import numpy as np
import pandas as pd
from pandas import Series
titanic = pd.read_csv("E:/Anaconda/MachineLearningData/Titanic/test.csv")
titanic_age = titanic["Age"]
age_is_null = titanic_age.isnull()
avaliable_age = titanic_age[age_is_null==False]
avaliable_titanic = titanic[age_is_null==False]
avaliable_name = avaliable_titanic["Name"]
bar_height = avaliable_age[0:5].values #设置y轴值
bar_position = avaliable_name[0:5].values #设置x轴值
fig = plt.figure(figsize=(15,12))
plt.bar(bar_position,bar_height,0.7) #第三个参数为柱体的宽度
#plt.barh(bar_height,bar_position,0.7) #这个函数可以画出来横着的柱形图
plt.xlabel("Name")
plt.ylabel("Age")
plt.title("Age of person in Titanic")
plt.plot()