year =[i.year for i in order['lock_time']]# 提取年
month =[i.month for i in order['lock_time']]# 提取月
day =[i.day for i in order['lock_time']]# 提取日
week =[i.week for i in order['lock_time']]# 提取周
weekday =[i.weekday()for i in order['lock_time']]# 提取星期信息
weekname =[i.day_name for i in order['lock_time']]# 提取星期名# 取前 5print('年:',year[:5])print('月:',month[:5])print('日:',day[:5])print('周:',week[:5])print('星期:',weekday[:5])print('星期名:',weekname[:5])
查看餐饮数据的大小和维度
from sqlalchemy import create_engine
import pandas as pd
engine create_engine(mysqlpymysql://root:981221localhost/testdb?charsetutf8mb4)
detail pd.read_sql_table(meal_order_detail1,conengine)
order pd.read_table(D:/pandas/meal…