Loading

随笔分类 -  python

摘要:由于直接使用reportlab绘制图表不是很方便,于是想到用matplotlib画图,将SVG嵌入PDF的方法。 需要用到svglib这个库,可以用pip install svglib安装 一个完整的例子: from io import BytesIO import matplotlib.pyplo 阅读全文
posted @ 2023-02-22 14:53 JinX-Digital 阅读(566) 评论(0) 推荐(0)
摘要:使用pandas将时间戳数字转为日期格式,发现和当前时间相差8小时,是时区不对导致的 下面提供两种解决方法: 使用tz_localize和tz_convert方法 import time import pandas as pd now_time = time.time() pd.Timestamp( 阅读全文
posted @ 2021-12-29 18:14 JinX-Digital 阅读(818) 评论(0) 推荐(0)
摘要:from typing import Any, Callable, TypeVar import requests T = TypeVar("T") class MaxRetryError(Exception): def __init__(self): message = "超出最大重试次数" su 阅读全文
posted @ 2021-06-23 10:53 JinX-Digital 阅读(191) 评论(0) 推荐(0)