pandas_Series和DataFrame基础

目录
Series
DataFrame

 
Series
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Series
s = pd.Series(data=np.random.randint(60,100,size=(10,)))
s

s.shape
# out: (10,)
s.size
# out: 10
s.index
# out: RangeIndex(start=0, stop=10, step=1)
s.values
# out: array([66, 73, 67, 67, 75, 97, 73, 62, 83, 77])
s.dtype
# out: dtype('int32')
s.values.tolist()
# out: [66, 73, 67, 67, 75, 97, 73, 62, 83, 77]
DataFrame
# DataFrame
df = pd.DataFrame(data=np.ra

pandas_Series和DataFrame基础最先出现在Python成神之路

版权声明:
作者:主机优惠
链接:https://www.techfm.club/p/17014.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>