Pandas
import numpy as np
import pandas as pd
arr1=np.arange(3,10)
s1=pd.Series(arr1)
print(s1)
import numpy as np
import pandas as pd
dic={'a':10,'b':20,'c':30,'d':40,'e':50}
s1=pd.Series(dic)
print(s1)
import numpy as np
import pandas as pd
arr1=np.arange(3,15).reshape(4,3)
df1=pd.DataFrame(arr1)
print(df1)
import numpy as np
import pandas as pd
dic={'a':[1,2,3,4],'b':[5,6,7,8],'c':[9,12,11,12],'d':[13,14,15,16]}#通過字典創建的,標簽是按照列存放的
df1=pd.DataFrame(dic)
print(df1)
#通過字典創建的,標簽是按照列存放的
列名和索引都是可以改變的
0號標簽取出,第0行
注意這裏標簽切片,是取到尾了的,,,和之前是不一樣的