当前位置:首页>python>【一起学Python】第81天:NumPy数组运算+广播机制,告别for循环!

【一起学Python】第81天:NumPy数组运算+广播机制,告别for循环!

  • 2026-06-29 18:51:02
【一起学Python】第81天:NumPy数组运算+广播机制,告别for循环!

📌 写在前面

大家好!👋

欢迎来到**【一起学Python】**的第81天!🎉

前80天,我们从安装环境开始,一步步掌握了数据类型、数组属性、创建方法、切片索引和高级索引。今天,我们要解锁NumPy最核心的威力——数组运算与广播机制

🤔 为什么要学数组运算?

  • ✅ 向量化计算:一行代码替代10行for循环,速度提升10-100倍!
  • ✅ 广播机制:不同形状的数组也能直接运算,代码简洁到飞起!
  • ✅ 聚合函数:求和、均值、最值...统计计算一键搞定!
  • ✅ 数据分析师必备:90%的数据处理都靠这些基础运算!

今天你将学到:

  • 🔸 数组的加减乘除与数学函数
  • 🔸 广播机制(Broadcasting)核心原理
  • 🔸 矩阵乘法 vs 元素级乘法
  • 🔸 sum/mean/min/max等聚合函数实战

准备好了吗?让我们开始吧!🚀

一、数组的基本运算:元素级操作 🔢

NumPy的运算都是**元素级(element-wise)**的,即每个操作都应用于数组中对应位置的元素。

1.1 加减乘除四则运算

import numpy as npa = np.array([123])b = np.array([456])# 加法:对应元素相加print("a + b:", a + b)  # [5 7 9]# 减法:对应元素相减print("b - a:", b - a)  # [3 3 3]# 乘法:对应元素相乘(⚠️不是矩阵乘法!)print("a * b:", a * b)  # [4 10 18]# 除法:对应元素相除print("b / a:", b / a)  # [4.  2.5 2. ]

1.2 标量运算:数组 × 单个数

arr = np.array([12345])# 数组 + 标量:每个元素都+10print("arr + 10:", arr + 10)  # [11 12 13 14 15]# 数组 × 标量:每个元素都×2print("arr * 2:", arr * 2)    # [ 2  4  6  8 10]# 数组 ** 标量:每个元素都平方print("arr ** 2:", arr ** 2)  # [ 1  4  9 16 25]

💡 核心优势:无需写for循环,NumPy底层用C实现,速度飞快!

1.3 常用数学函数

arr = np.array([1491625])# 开平方print("平方根:", np.sqrt(arr))  # [1. 2. 3. 4. 5.]# 指数运算print("e的x次方:", np.exp(arr[:3]))  # [ 2.718  54.598 8103.084]# 对数运算print("自然对数:", np.log(arr[:3]))  # [0.    1.386 2.197]# 三角函数angles = np.array([0, np.pi/2, np.pi])print("sin值:", np.sin(angles))  # [0. 1. 0.]

二、广播机制(Broadcasting):不同形状也能算!🎯

广播是NumPy的灵魂特性,它允许不同形状的数组直接进行运算!

2.1 广播的三大规则

📐 广播规则(从后往前对比维度):1️⃣ 如果维度数不同,小数组前面补12️⃣ 如果某维度大小为1,可沿该维度"复制"扩展3️⃣ 如果某维度大小不同且都不为1 → 报错!

2.2 实战示例1:1维数组 + 2维数组

# 2维数组 (2行3列)a = np.array([[1, 2, 3],               [4, 5, 6]])# 1维数组 (3个元素)b = np.array([10, 20, 30])# b会自动"广播"到与a相同的形状result = a + bprint("广播加法结果:\n", result)

📊 运算过程可视化

原始:          广播后:[[1,2,3],      [[1,2,3],      +   [[10,20,30], [4,5,6]]  +   [4,5,6]]           [10,20,30]]                ↓结果: [[11,22,33],       [14,25,36]]

2.3 实战示例2:列向量 + 行向量

# 列向量 (3行1列)col = np.array([[1], [2], [3]])  # shape: (3, 1)# 行向量 (1行3列)row = np.array([10, 20, 30])     # shape: (1, 3)# 广播后变成 3×3 的矩阵!result = col + rowprint("列+行广播结果:\n", result)
📊 输出
[[11 21 31] [12 22 32] [13 23 33]]

💡 应用场景:快速生成坐标网格、距离矩阵、评分表等!

2.4 广播失败的情况 ⚠️

a = np.array([[123]])    # shape: (1, 3)b = np.array([[1], [2]])     # shape: (2, 1)# 这个可以!(1,3) + (2,1) → (2,3)print(a + b)  # ✅ 成功# 但这个不行!c = np.array([1234])   # shape: (4,)d = np.array([[12]])       # shape: (1, 2)# print(c + d)  # ❌ ValueError: 维度不兼容!

三、矩阵乘法 vs 元素级乘法 🧮

新手最容易混淆的两个概念!

3.1 元素级乘法(*)

a = np.array([[12], [34]])b = np.array([[56], [78]])# * 是元素级乘法:对应位置相乘print("元素级乘法:\n", a * b)# 输出:# [[ 5 12]#  [21 32]]

3.2 矩阵乘法(@ 或 dot)

# @ 或 np.dot() 是矩阵乘法:行列相乘求和print("矩阵乘法:\n", a @ b)# 或print("矩阵乘法:\n", np.dot(a, b))# 输出:# [[19 22]#  [43 50]]
📝 计算过程(以结果[0,0]为例):
1×5 + 2×7 = 5 + 14 = 19 ✅

3.3 快速对比表

┌─────────────┬──────────────┬──────────────┐│   运算符    │    含义      │   形状要求   │├─────────────┼──────────────┼──────────────┤│     *       │ 元素级乘法   │ 形状相同/可广播││     @       │ 矩阵乘法     │ (m,n)×(n,p)→(m,p)││  np.dot()   │ 矩阵乘法     │ 同@          │└─────────────┴──────────────┴──────────────┘

四、聚合函数:一键统计 📊

NumPy提供了一系列聚合函数,快速计算数组的统计特征。

4.1 基础聚合函数

arr = np.array([[123],                 [456]])# 求和print("总和:", np.sum(arr))        # 21# 平均值print("均值:", np.mean(arr))       # 3.5# 最小值/最大值print("最小值:", np.min(arr))      # 1print("最大值:", np.max(arr))      # 6# 标准差/方差print("标准差:", np.std(arr))      # 1.707...print("方差:", np.var(arr))        # 2.916...

4.2 按轴(axis)聚合:行/列统计

data = np.array([[102030],                  [405060]])# axis=0:沿列方向聚合(对每列计算)print("按列求和:", np.sum(data, axis=0))  # [50 70 90]# axis=1:沿行方向聚合(对每行计算)print("按行求和:", np.sum(data, axis=1))  # [60 150]# 求每列的平均值print("按列均值:", np.mean(data, axis=0))  # [25. 35. 45.]

💡 axis记忆口诀

  • axis=0 → "压扁行",结果保留列
  • axis=1 → "压扁列",结果保留行

4.3 其他实用聚合函数

arr = np.array([31415926])# 累积求和print("累积和:", np.cumsum(arr))  # [3 4 8 9 14 23 25 31]# 累积乘积print("累积积:", np.cumprod(arr[:4]))  # [3 3 12 12]# 排序print("排序后:", np.sort(arr))  # [1 1 2 3 4 5 6 9]# 中位数print("中位数:", np.median(arr))  # 3.5

📝 今日作业

基础题 ⭐

  • 创建两个数组 [1,2,3] 和 [4,5,6],计算它们的和、差、积、商
  • 使用广播机制,将1维数组 [10,20,30] 加到2维数组的每一行
  • 计算数组 [1,4,9,16,25] 的平方根和自然对数

进阶题 ⭐⭐

  • 创建一个3×4的随机数组,分别计算每行、每列的平均值
  • 使用广播生成一个5×5的乘法表(无需循环!)
  • 对比 arr * arr 和 arr @ arr 的结果差异(注意形状)

挑战题 ⭐⭐⭐

  • 模拟学生成绩:100名学生×5门课程,计算:
    • 每个学生的平均分(按行)
    • 每门课的平均分(按列)
    • 全班总平均分
  • 使用广播计算两个点集之间的欧氏距离矩阵
  • 实现"标准化":将数组转换为均值为0、标准差为1的分布

💡 参考代码(挑战题-标准化)

import numpy as np# 生成随机数据data = np.random.randn(1005)  # 100×5的随机数# 标准化:(x - mean) / std# axis=0表示对每列(每门课)计算均值和标准差mean = np.mean(data, axis=0)std = np.std(data, axis=0)# 广播:data(100,5) - mean(5,) → 自动扩展normalized = (data - mean) / std# 验证:标准化后均值≈0,标准差≈1print("标准化后均值:", np.mean(normalized, axis=0))print("标准化后标准差:", np.std(normalized, axis=0))

🎓 明日预告

第82天:NumPy排序、搜索与集合操作

你将学到:

  • 🔸 np.sort / np.argsort 排序技巧
  • 🔸 np.where 条件搜索与定位
  • 🔸 np.unique 去重与集合运算
  • 🔸 实战:数据清洗中的高频操作

敬请期待! 🚀


💡 学习小贴士

  1. 运算选择指南
    • 元素级运算 → 直接用 + - * /
    • 矩阵乘法 → 用 @ 或 np.dot()
    • 统计计算 → 用 np.sum/mean/std 等聚合函数
  2. 广播调试技巧
    • 形状对不上?先 print(arr1.shape, arr2.shape)
    • 不确定能否广播?手动按规则推演一遍
    • 复杂广播?用小数组先测试逻辑
  3. 性能优化
    • 能用向量化就别写for循环
    • 聚合运算时指定axis避免多余计算
    • 大数组运算前检查dtype,避免隐式转换

📚 学习路线图

第74天:NumPy安装 ✓第75天:ndarray对象 ✓第76天:数据类型 ✓第77天:数组属性 ✓第78天:创建数组 ✓第79天:切片和索引 ✓第80天:高级索引 ✓第81天:数组运算 ✓ ← 你今天在这里第82天:排序与搜索第83天:文件读写...

💬 写在最后

数组运算和广播机制是NumPy的核心武器,掌握它们,你就能:

✅ 用一行代码替代复杂循环✅ 优雅处理不同形状的数据✅ 快速完成统计分析与特征工程

今天重点掌握

  • ✅ 元素级运算与矩阵乘法的区别
  • ✅ 广播机制的三条规则
  • ✅ axis参数在聚合函数中的用法

如果觉得有用,记得:

  • 👍 点赞支持一下
  • ⭐ 收藏方便复习
  • 📤 分享给更多小伙伴

完成作业的同学,欢迎在评论区打卡! 💪


【一起学Python】每天进步一点点,365天后遇见更优秀的自己!

👉 关注公众号,不错过每天的学习内容!


🎯 今日金句

"向量化是NumPy的灵魂,广播是它的翅膀。掌握它们,让数据计算飞起来!" ✈️

明天见!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 08:12:28 HTTP/2.0 GET : https://f.mffb.com.cn/a/491744.html
  2. 运行时间 : 0.095851s [ 吞吐率:10.43req/s ] 内存消耗:4,737.38kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=dc46106a155511e5ea3ab115195a831f
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000665s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000705s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000279s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000280s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000495s ]
  6. SELECT * FROM `set` [ RunTime:0.000210s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000498s ]
  8. SELECT * FROM `article` WHERE `id` = 491744 LIMIT 1 [ RunTime:0.000424s ]
  9. UPDATE `article` SET `lasttime` = 1783123948 WHERE `id` = 491744 [ RunTime:0.015692s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000352s ]
  11. SELECT * FROM `article` WHERE `id` < 491744 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000465s ]
  12. SELECT * FROM `article` WHERE `id` > 491744 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000418s ]
  13. SELECT * FROM `article` WHERE `id` < 491744 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000882s ]
  14. SELECT * FROM `article` WHERE `id` < 491744 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000753s ]
  15. SELECT * FROM `article` WHERE `id` < 491744 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000989s ]
0.097513s