import pandas as pd
# 2.2.4
# (一)
detail = pd.read_excel('output.xlsx',sheet_name=0)
print(detail.shape)
print(detail.ndim)
print(detail.size)
# (二)
detail['dishes_name'] = detail['dishes_name'].astype('category')
print('菜品以类型划分后的描述信息:\n',detail['dishes_name'].describe())
detail['order_id']=detail['order_id'].astype('category')
print('订单以类型划分后的描述信息:\n',detail['order_id'].describe())
数据分析(pandas)---04.astype
最新推荐文章于 2024-06-21 15:17:01 发布