1234567891011121314151617181920212223242526 |
- """
- @author: luojunhui
- """
- import pandas as pd
- from tqdm import tqdm
- from applications import PQMySQL
- db = PQMySQL()
- file = pd.read_excel("mean_cache.xlsx")
- data_list = file.values.tolist()
- for line in tqdm(data_list):
- account_name = line[0]
- index = line[1]
- avg_read = line[2]
- sql = f"""
- UPDATE long_articles_accounts
- SET account_position_read_avg = %s
- where account_name = %s and account_position = %s;
- """
- db.update(sql, params=(avg_read, account_name, index))
- print("successful")
|