01 2024 档案

摘要:php中的map、filter、reduce函数使用 有时候真的很头疼php中参数的位置,经常记错 $arr = [1, 2, 3, 4, 5]; // array_map — 为数组的每个元素应用回调函数 $arr_new = array_map(function ($val) { return 阅读全文
posted @ 2024-01-31 15:02 carol2014 阅读(5) 评论(0) 推荐(0) 编辑
摘要:最近遇到了34进制转化为10进制的问题,记录下。 将34进制的字符串'H2V'转换成为10进制数,进而转换为日期。 百度了下34进制的资料,记录如下: 34进制指以0、1、2、3、4、5、6、7、8、9、A、B、C、D、E、F、G、H、J、K、L、M、N、P、Q、R、S、T、U、V、W、X、Y、Z为 阅读全文
posted @ 2024-01-31 13:27 carol2014 阅读(236) 评论(0) 推荐(0) 编辑
摘要:本文内容参考 多进程 - 廖雪峰的官方网站 (liaoxuefeng.com) python进程、线程、协程 - 张岩林 - 博客园 (cnblogs.com) Python异步协程(asyncio详解) - 红后 - 博客园 (cnblogs.com) 多进程 os模块的fork() 多进程(mu 阅读全文
posted @ 2024-01-17 13:47 carol2014 阅读(14) 评论(0) 推荐(0) 编辑
摘要:For update是MySQL中用于实现行锁的一种语法,其主要作用是在SELECT查询语句中加上FOR UPDATE子句,以保证查询结果集中的每一行都被锁定,避免其他事务对这些行进行修改。 SELECT ... FROM table_name WHERE ... FOR UPDATE; 在执行Fo 阅读全文
posted @ 2024-01-11 11:31 carol2014 阅读(81) 评论(0) 推荐(0) 编辑
摘要:import matplotlib.pyplot as plt import numpy as np N = 8 i = 0 # 指定一个画板 fig = plt.figure(figsize=(20, 5 * N)) x = np.arange(0, 3 * np.pi, 0.1) y_sin = 阅读全文
posted @ 2024-01-10 16:54 carol2014 阅读(16) 评论(0) 推荐(0) 编辑
摘要:安装 pip install pillow 引入 from PIL import Image, ImageFilter, ImageDraw, ImageFont, ImageOps, ImageEnhance import os img_dir = "../../files/" img_gen_d 阅读全文
posted @ 2024-01-10 16:51 carol2014 阅读(28) 评论(0) 推荐(0) 编辑
摘要:控制结构 条件判断 n = 10 i = 2 if n == i: print("equal") elif n < i: print("lower") else: print("higher") score = 89 match score: case 100: print("level A+") 阅读全文
posted @ 2024-01-10 16:46 carol2014 阅读(3) 评论(0) 推荐(0) 编辑
摘要:文件IO 读写txt文件 with open("../files/test.txt", encoding="utf-8-sig") as f: str = f.read() lst = [] if str: data = str.split("\n") for row in data: if len 阅读全文
posted @ 2024-01-10 16:43 carol2014 阅读(5) 评论(0) 推荐(0) 编辑
摘要:有时间看下seaborn库,写一些demo记录下 import numpy as np import seaborn as sns import matplotlib.pyplot as plt fig = plt.figure(figsize=(20, 10)) # 解决中文不显示和负号不显示问题 阅读全文
posted @ 2024-01-03 17:12 carol2014 阅读(30) 评论(0) 推荐(0) 编辑
摘要:pd.csv a,b,c,d,e 0,9,2,14,2 1,5,5,9,15 2,7,2,7,6 3,7,3,7,16 4,5,3,11,15 5,8,3,9,16 6,6,4,14,6 7,8,3,9,9 8,5,4,12,5 9,8,6,7,4 10,6,4,8,1 11,7,7,14,13 1 阅读全文
posted @ 2024-01-03 16:14 carol2014 阅读(32) 评论(0) 推荐(0) 编辑
摘要:pandas中有两类非常重要的数据结构,即序列Series和数据框DataFrame。 Series类似于numpy中的一维数组;DataFrame类似于numpy中的二维数组。 DataFrame创建 # 通过二维数组创建数据框 df1 = pd.DataFrame(np.arange(12).r 阅读全文
posted @ 2024-01-03 15:55 carol2014 阅读(46) 评论(0) 推荐(0) 编辑
摘要:多维数组定义 import numpy as np # 多维数组定义 np.array((2, 3, 4)) # 类型为int32 的一维数组 np.array([2.0, 3.0, 4.0]) # 类型为flloat64 的一维数组 np.array(((2, 3, 4, 5), (4, 5, 6 阅读全文
posted @ 2024-01-03 14:49 carol2014 阅读(86) 评论(0) 推荐(0) 编辑
摘要:1 字符串函数 SELECT title,LENGTH(title),SUBSTRING(title,1,1),LEFT(title,1),RIGHT(title,1),UPPER(title),LOWER(title),REPLACE(title, 'g' ,'l'),CONCAT('title: 阅读全文
posted @ 2024-01-02 15:48 carol2014 阅读(1) 评论(0) 推荐(0) 编辑