| 1234567891011121314151617181920 |
- from dao import Mysql
- def load_order_data_from_mysql(city_uuid):
- """从数据库中读取数据"""
- client = Mysql()
- tablename = "tads_brandcul_cust_order"
- query_text = "*"
-
- df = client.load_data(tablename, query_text, city_uuid)
- if len(df) == 0:
- return None
-
- df.drop('stat_month', axis=1, inplace=True)
- df.drop('city_uuid', axis=1, inplace=True)
- print(df.columns)
-
- # 去除重复值和填补缺失值
- df.drop_duplicates(inplace=True)
- df.fillna(0, inplace=True)
- return df
|