随笔分类 -  python基础

摘要:反选: pl.col('*').exclude('date') 聚合:df.groupby(['date','code']).agg() 透视: pivot() 宽格式转化为长格式:melt 分组计算:with_columns([(1/pl.col('code').count()).over('da 阅读全文
posted @ 2025-08-05 11:21 LazyTiming 阅读(42) 评论(0) 推荐(0)
摘要:转载 先将图片每个像素的hsv(色相,饱和度,明度)值转化为可读取对象 再将图像按v用取平均值的方法进行压缩,最后根据压缩后图像的每个像素点的v值转换成字符进行输出 scale表示图片的压缩倍率,压缩后图像的宽度和高度都为原图的除以scale fit_table表示转化后的图片由哪些字符构成,按明度 阅读全文
posted @ 2022-12-02 13:44 LazyTiming 阅读(537) 评论(0) 推荐(0)
摘要:转自武Sir的博客 https://www.cnblogs.com/wupeiqi/articles/4839959.html import queue import threading import contextlib import time StopEvent = object() class 阅读全文
posted @ 2021-06-18 17:04 LazyTiming 阅读(77) 评论(0) 推荐(0)