IN Python
from?pandas?import?DataFrame,Series
import?pandas?as?pd
import?numpy?as?np
data?=?pd.read_csv(r'C:\Users\lxy\Desktop\工作相關\工作報告KPI\pydata-book-master\ch06\ex5.csv')
data.index.name='x'
data.to_csv('D:\df.csv')
IN R
> library(ggplot2)
> df <- read.table("D:/df.csv",header=TRUE,sep=",",row.names="x")
> df
something a ?b ?c ?d message
0 ? ? ? one 1 ?2 ?3 ?4 ? ? ? ?
1 ? ? ? two 5 ?6 NA ?8 ? world
2 ? ? three 9 10 11 12 ? ? foo
> p <- ggplot(df,aes(x=something,y=a))
> p+geom_bar(stat="identity")
> p+geom_bar(stat="identity",fill="lightblue",color="black")