当前位置:首页>python>17_Python数据分析:时间序列

17_Python数据分析:时间序列

  • 2026-05-05 19:59:04
17_Python数据分析:时间序列

Python数据分析:时间序列

1. 核心知识点概述

Pandas提供了强大的时间序列处理功能:

  • Timestamp
    : 时间戳,表示具体的某个时间点。
  • Period
    : 时间段,表示一个时间区间。
  • DatetimeIndex
    : 时间戳索引,用于时间序列数据。
  • date_range()
    : 生成时间范围。
  • resample()
    : 重采样,改变时间频率。
  • tz_localize()/tz_convert()
    : 时区处理。

关键参数说明

  • freq
    : 频率字符串,如'D'(日)、'W'(周)、'M'(月)、'H'(小时)。
  • start
    /end: 时间范围的起止。
  • periods
    : 生成的时间点数量。
  • closed
    : 区间闭合方式。

2. 示例代码

2.1 准备数据

In [1]:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# 设置中文字体
plt.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans']
plt.rcParams['axes.unicode_minus'] = False
print("Pandas时间序列功能演示")
print("=" * 40)
Pandas时间序列功能演示
========================================

2.2 创建时间戳 (Timestamp)

创建和解析时间戳。

In [2]:

# 创建时间戳的不同方式
ts1 = pd.Timestamp('2024-03-15')
ts2 = pd.Timestamp(2024, 3, 15, 14, 30, 0)
ts3 = pd.Timestamp('2024-03-15 14:30:00')
print("创建时间戳:")
print(f"ts1: {ts1}")
print(f"ts2: {ts2}")
print(f"ts3: {ts3}")
# 时间戳属性
print(f"\n时间戳属性:")
print(f"年份: {ts1.year}")
print(f"月份: {ts1.month}")
print(f"日期: {ts1.day}")
print(f"星期几: {ts1.dayofweek} (0=周一)")
print(f"星期几名称: {ts1.day_name()}")
print(f"是否月末: {ts1.is_month_end}")
print(f"是否闰年: {ts1.is_leap_year}")
# 时间戳运算
print(f"\n时间戳运算:")
print(f"加1天: {ts1 + pd.Timedelta(days=1)}")
print(f"加3小时: {ts1 + pd.Timedelta(hours=3)}")
print(f"减1周: {ts1 - pd.Timedelta(weeks=1)}")
创建时间戳:
ts1: 2024-03-15 00:00:00
ts2: 2024-03-15 14:30:00
ts3: 2024-03-15 14:30:00
时间戳属性:
年份: 2024
月份: 3
日期: 15
星期几: 4 (0=周一)
星期几名称: Friday
是否月末: False
是否闰年: True
时间戳运算:
加1天: 2024-03-16 00:00:00
加3小时: 2024-03-15 03:00:00
减1周: 2024-03-08 00:00:00

2.3 生成时间范围 (date_range)

使用date_range生成时间序列索引。

In [3]:

# 按日期生成
daily = pd.date_range(start='2024-01-01', end='2024-01-10', freq='D')
print("每日时间范围:")
print(daily)
# 按周生成
weekly = pd.date_range(start='2024-01-01', periods=5, freq='W')
print("\n每周时间范围(周日):")
print(weekly)
# 按工作日生成
business_days = pd.date_range(start='2024-01-01', periods=10, freq='B')
print("\n工作日时间范围:")
print(business_days)
# 按月生成
monthly = pd.date_range(start='2024-01-01', periods=6, freq='ME')
print("\n每月末时间范围:")
print(monthly)
# 按小时生成
hourly = pd.date_range(start='2024-01-01', periods=12, freq='h')
print("\n每小时时间范围:")
print(hourly)
每日时间范围:
DatetimeIndex(['2024-01-01', '2024-01-02', '2024-01-03', '2024-01-04',
               '2024-01-05', '2024-01-06', '2024-01-07', '2024-01-08',
               '2024-01-09', '2024-01-10'],
              dtype='datetime64[ns]', freq='D')
每周时间范围(周日):
DatetimeIndex(['2024-01-07', '2024-01-14', '2024-01-21', '2024-01-28',
               '2024-02-04'],
              dtype='datetime64[ns]', freq='W-SUN')
工作日时间范围:
DatetimeIndex(['2024-01-01', '2024-01-02', '2024-01-03', '2024-01-04',
               '2024-01-05', '2024-01-08', '2024-01-09', '2024-01-10',
               '2024-01-11', '2024-01-12'],
              dtype='datetime64[ns]', freq='B')
每月末时间范围:
DatetimeIndex(['2024-01-31', '2024-02-29', '2024-03-31', '2024-04-30',
               '2024-05-31', '2024-06-30'],
              dtype='datetime64[ns]', freq='ME')
每小时时间范围:
DatetimeIndex(['2024-01-01 00:00:00', '2024-01-01 01:00:00',
               '2024-01-01 02:00:00', '2024-01-01 03:00:00',
               '2024-01-01 04:00:00', '2024-01-01 05:00:00',
               '2024-01-01 06:00:00', '2024-01-01 07:00:00',
               '2024-01-01 08:00:00', '2024-01-01 09:00:00',
               '2024-01-01 10:00:00', '2024-01-01 11:00:00'],
              dtype='datetime64[ns]', freq='h')

2.4 创建时间序列数据

创建带有DatetimeIndex的DataFrame。

In [4]:

# 创建时间序列数据
np.random.seed(42)
dates = pd.date_range('2024-01-01', periods=30, freq='D')
values = np.random.randn(30).cumsum() + 100
ts_data = pd.Series(values, index=dates)
print("时间序列数据(前10个):")
print(ts_data.head(10))
# 创建DataFrame
df_ts = pd.DataFrame({
    'value': values,
    'volume': np.random.randint(1000, 5000, 30)
}, index=dates)
print("\n时间序列DataFrame(前5行):")
print(df_ts.head())
print(f"\n索引类型: {type(df_ts.index)}")
时间序列数据(前10个):
2024-01-01    100.496714
2024-01-02    100.358450
2024-01-03    101.006138
2024-01-04    102.529168
2024-01-05    102.295015
2024-01-06    102.060878
2024-01-07    103.640091
2024-01-08    104.407525
2024-01-09    103.938051
2024-01-10    104.480611
Freq: D, dtype: float64
时间序列DataFrame(前5行):
                 value  volume
2024-01-01  100.496714    2363
2024-01-02  100.358450    3139
2024-01-03  101.006138    2390
2024-01-04  102.529168    4003
2024-01-05  102.295015    2478
索引类型: <class 'pandas.core.indexes.datetimes.DatetimeIndex'>

2.5 时间序列索引和切片

使用时间进行索引和切片。

In [5]:

# 使用日期字符串索引
print("使用日期字符串索引:")
print(f"2024-01-05: {ts_data['2024-01-05']}")
# 使用切片
print("\n切片 2024-01-05 到 2024-01-10:")
print(ts_data['2024-01-05':'2024-01-10'])
# 使用年月切片
print("\n2024年1月的数据:")
print(ts_data['2024-01'])
# 使用truncate截断
print("\ntruncate截断后的数据:")
print(ts_data.truncate(before='2024-01-10', after='2024-01-20'))
使用日期字符串索引:
2024-01-05: 102.29501487162543
切片 2024-01-05 到 2024-01-10:
2024-01-05    102.295015
2024-01-06    102.060878
2024-01-07    103.640091
2024-01-08    104.407525
2024-01-09    103.938051
2024-01-10    104.480611
Freq: D, dtype: float64
2024年1月的数据:
2024-01-01    100.496714
2024-01-02    100.358450
2024-01-03    101.006138
2024-01-04    102.529168
2024-01-05    102.295015
2024-01-06    102.060878
2024-01-07    103.640091
2024-01-08    104.407525
2024-01-09    103.938051
2024-01-10    104.480611
2024-01-11    104.017193
2024-01-12    103.551464
2024-01-13    103.793426
2024-01-14    101.880146
2024-01-15    100.155228
2024-01-16     99.592940
2024-01-17     98.580109
2024-01-18     98.894357
2024-01-19     97.986332
2024-01-20     96.574029
2024-01-21     98.039678
2024-01-22     97.813901
2024-01-23     97.881429
2024-01-24     96.456681
2024-01-25     95.912299
2024-01-26     96.023221
2024-01-27     94.872228
2024-01-28     95.247926
2024-01-29     94.647287
2024-01-30     94.355593
Freq: D, dtype: float64
truncate截断后的数据:
2024-01-10    104.480611
2024-01-11    104.017193
2024-01-12    103.551464
2024-01-13    103.793426
2024-01-14    101.880146
2024-01-15    100.155228
2024-01-16     99.592940
2024-01-17     98.580109
2024-01-18     98.894357
2024-01-19     97.986332
2024-01-20     96.574029
Freq: D, dtype: float64

2.6 重采样 (Resample)

改变时间序列的频率。

In [6]:

# 创建高频数据(每小时)
np.random.seed(42)
hourly_dates = pd.date_range('2024-01-01', periods=168, freq='h')  # 一周数据
hourly_values = np.random.randn(168).cumsum() + 100
hourly_ts = pd.Series(hourly_values, index=hourly_dates)
print("高频数据(前10个):")
print(hourly_ts.head(10))
# 降采样:小时 -> 日
daily_mean = hourly_ts.resample('D').mean()
print("\n日平均(降采样):")
print(daily_mean.head())
# 降采样:日 -> 周
weekly_sum = daily_mean.resample('W').sum()
print("\n周总和:")
print(weekly_sum)
高频数据(前10个):
2024-01-01 00:00:00    100.496714
2024-01-01 01:00:00    100.358450
2024-01-01 02:00:00    101.006138
2024-01-01 03:00:00    102.529168
2024-01-01 04:00:00    102.295015
2024-01-01 05:00:00    102.060878
2024-01-01 06:00:00    103.640091
2024-01-01 07:00:00    104.407525
2024-01-01 08:00:00    103.938051
2024-01-01 09:00:00    104.480611
Freq: h, dtype: float64
日平均(降采样):
2024-01-01    100.851231
2024-01-02     93.170429
2024-01-03     89.778946
2024-01-04     91.223889
2024-01-05     88.648586
Freq: D, dtype: float64
周总和:
2024-01-07    642.595795
Freq: W-SUN, dtype: float64

In [7]:

# 多种聚合方式
resampled = hourly_ts.resample('D').agg(['mean', 'min', 'max', 'std'])
print("\n多种聚合方式:")
print(resampled.head())
# 升采样:日 -> 小时(需要填充)
daily_data = pd.Series([100, 105, 98, 102, 108], 
                       index=pd.date_range('2024-01-01', periods=5, freq='D'))
# 前向填充
hourly_ffill = daily_data.resample('h').ffill()
print("\n升采样 - 前向填充(前10个):")
print(hourly_ffill.head(10))
# 线性插值
hourly_interp = daily_data.resample('h').interpolate(method='linear')
print("\n升采样 - 线性插值(前10个):")
print(hourly_interp.head(10))
多种聚合方式:
                  mean        min         max       std
2024-01-01  100.851231  96.456681  104.480611  2.635300
2024-01-02   93.170429  89.088604   96.023221  2.180211
2024-01-03   89.778946  87.753344   92.469581  1.115705
2024-01-04   91.223889  89.287646   93.998399  1.042130
2024-01-05   88.648586  86.473055   90.499713  1.233611
升采样 - 前向填充(前10个):
2024-01-01 00:00:00    100
2024-01-01 01:00:00    100
2024-01-01 02:00:00    100
2024-01-01 03:00:00    100
2024-01-01 04:00:00    100
2024-01-01 05:00:00    100
2024-01-01 06:00:00    100
2024-01-01 07:00:00    100
2024-01-01 08:00:00    100
2024-01-01 09:00:00    100
Freq: h, dtype: int64
升采样 - 线性插值(前10个):
2024-01-01 00:00:00    100.000000
2024-01-01 01:00:00    100.208333
2024-01-01 02:00:00    100.416667
2024-01-01 03:00:00    100.625000
2024-01-01 04:00:00    100.833333
2024-01-01 05:00:00    101.041667
2024-01-01 06:00:00    101.250000
2024-01-01 07:00:00    101.458333
2024-01-01 08:00:00    101.666667
2024-01-01 09:00:00    101.875000
Freq: h, dtype: float64

2.7 时区处理

处理不同时区的时间数据。

In [8]:

# 创建无时区的时间序列
ts_no_tz = pd.Series(range(5), index=pd.date_range('2024-01-01', periods=5, freq='h'))
print("无时区的时间序列:")
print(ts_no_tz)
print(f"时区: {ts_no_tz.index.tz}")
# 添加时区信息
ts_utc = ts_no_tz.tz_localize('UTC')
print("\n转换为UTC时区:")
print(ts_utc)
print(f"时区: {ts_utc.index.tz}")
# 转换时区
ts_shanghai = ts_utc.tz_convert('Asia/Shanghai')
print("\n转换为上海时区:")
print(ts_shanghai)
ts_ny = ts_utc.tz_convert('America/New_York')
print("\n转换为纽约时区:")
print(ts_ny)
无时区的时间序列:
2024-01-01 00:00:00    0
2024-01-01 01:00:00    1
2024-01-01 02:00:00    2
2024-01-01 03:00:00    3
2024-01-01 04:00:00    4
Freq: h, dtype: int64
时区: None
转换为UTC时区:
2024-01-01 00:00:00+00:00    0
2024-01-01 01:00:00+00:00    1
2024-01-01 02:00:00+00:00    2
2024-01-01 03:00:00+00:00    3
2024-01-01 04:00:00+00:00    4
Freq: h, dtype: int64
时区: UTC
转换为上海时区:
2024-01-01 08:00:00+08:00    0
2024-01-01 09:00:00+08:00    1
2024-01-01 10:00:00+08:00    2
2024-01-01 11:00:00+08:00    3
2024-01-01 12:00:00+08:00    4
Freq: h, dtype: int64
转换为纽约时区:
2023-12-31 19:00:00-05:00    0
2023-12-31 20:00:00-05:00    1
2023-12-31 21:00:00-05:00    2
2023-12-31 22:00:00-05:00    3
2023-12-31 23:00:00-05:00    4
Freq: h, dtype: int64

2.8 时间段 (Period)

使用Period表示时间区间。

In [9]:

# 创建Period
p1 = pd.Period('2024-01', freq='M')
p2 = pd.Period('2024-Q1', freq='Q')
p3 = pd.Period('2024', freq='Y')
print("创建Period:")
print(f"月度: {p1}")
print(f"季度: {p2}")
print(f"年度: {p3}")
# Period属性
print(f"\nPeriod属性:")
print(f"开始时间: {p1.start_time}")
print(f"结束时间: {p1.end_time}")
# Period运算
print(f"\nPeriod运算:")
print(f"下一个月: {p1 + 1}")
print(f"上一个月: {p1 - 1}")
print(f"加3个月: {p1 + 3}")
# Period范围
period_range = pd.period_range('2024-01', periods=6, freq='M')
print("\n月度Period范围:")
print(period_range)
创建Period:
月度: 2024-01
季度: 2024Q1
年度: 2024
Period属性:
开始时间: 2024-01-01 00:00:00
结束时间: 2024-01-31 23:59:59.999999999
Period运算:
下一个月: 2024-02
上一个月: 2023-12
加3个月: 2024-04
月度Period范围:
PeriodIndex(['2024-01', '2024-02', '2024-03', '2024-04', '2024-05', '2024-06'], dtype='period[M]')

2.9 日期偏移 (DateOffset)

使用DateOffset进行灵活的日期运算。

In [10]:

from pandas.tseries.offsets import Day, Week, MonthEnd, QuarterEnd, BusinessDay
ts = pd.Timestamp('2024-03-15')
print("DateOffset运算:")
print(f"原始时间: {ts}")
print(f"加5天: {ts + Day(5)}")
print(f"加2周: {ts + Week(2)}")
print(f"月末: {ts + MonthEnd(0)}")
print(f"下月末: {ts + MonthEnd(1)}")
print(f"下季度末: {ts + QuarterEnd(1)}")
print(f"5个工作日后: {ts + BusinessDay(5)}")
# 自定义偏移
from pandas.tseries.offsets import DateOffset
custom_offset = DateOffset(months=2, days=5)
print(f"\n自定义偏移(2个月5天): {ts + custom_offset}")
DateOffset运算:
原始时间: 2024-03-15 00:00:00
加5天: 2024-03-20 00:00:00
加2周: 2024-03-29 00:00:00
月末: 2024-03-31 00:00:00
下月末: 2024-03-31 00:00:00
下季度末: 2024-03-31 00:00:00
5个工作日后: 2024-03-22 00:00:00
自定义偏移(2个月5天): 2024-05-20 00:00:00

2.10 时间序列可视化

绘制时间序列图表。

In [11]:

# 创建月度数据
np.random.seed(42)
monthly_dates = pd.date_range('2023-01-01', periods=12, freq='M')
monthly_sales = np.random.randint(100, 200, 12) + np.linspace(0, 50, 12)
monthly_ts = pd.Series(monthly_sales, index=monthly_dates)
# 绘制
fig, axes = plt.subplots(2, 1, figsize=(12, 8))
# 时间序列图
monthly_ts.plot(ax=axes[0], marker='o', title='Monthly Sales Trend')
axes[0].set_xlabel('Date')
axes[0].set_ylabel('Sales')
axes[0].grid(True, alpha=0.3)
# 同比数据
yoy_growth = monthly_ts.pct_change() * 100
yoy_growth.plot(ax=axes[1], kind='bar', color='steelblue', title='Month-over-Month Growth (%)')
axes[1].set_xlabel('Date')
axes[1].set_ylabel('Growth (%)')
axes[1].axhline(y=0, color='r', linestyle='--', alpha=0.5)
axes[1].grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
print("月度销售数据:")
print(monthly_ts)
print("\n环比增长率:")
print(yoy_growth.round(2))
C:\Users\zhanghc\AppData\Local\Temp\ipykernel_16360\2668907939.py:3: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.
  monthly_dates = pd.date_range('2023-01-01', periods=12, freq='M')
月度销售数据:
2023-01-31    151.000000
2023-02-28    196.545455
2023-03-31    123.090909
2023-04-30    184.636364
2023-05-31    178.181818
2023-06-30    142.727273
2023-07-31    209.272727
2023-08-31    217.818182
2023-09-30    210.363636
2023-10-31    214.909091
2023-11-30    232.454545
2023-12-31    249.000000
Freq: ME, dtype: float64
环比增长率:
2023-01-31      NaN
2023-02-28    30.16
2023-03-31   -37.37
2023-04-30    50.00
2023-05-31    -3.50
2023-06-30   -19.90
2023-07-31    46.62
2023-08-31     4.08
2023-09-30    -3.42
2023-10-31     2.16
2023-11-30     8.16
2023-12-31     7.12
Freq: ME, dtype: float64

3. 常见应用场景总结

  1. 金融数据分析
    :股票价格、交易量等时间序列分析。
  2. 销售报表
    :按日、周、月、季度汇总销售数据。
  3. 日志分析
    :按时间聚合服务器日志。
  4. 传感器数据
    :处理时间序列的IoT传感器数据。
  5. 时区转换
    :处理跨时区的业务数据。
  6. 重采样
    :将高频数据聚合为低频数据进行分析。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-05-07 17:54:45 HTTP/2.0 GET : https://f.mffb.com.cn/a/486663.html
  2. 运行时间 : 0.097561s [ 吞吐率:10.25req/s ] 内存消耗:4,720.83kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=8dcaf0b137829bad78ff850b585c717f
  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.000589s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000724s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000295s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000293s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000507s ]
  6. SELECT * FROM `set` [ RunTime:0.000228s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000549s ]
  8. SELECT * FROM `article` WHERE `id` = 486663 LIMIT 1 [ RunTime:0.001594s ]
  9. UPDATE `article` SET `lasttime` = 1778147685 WHERE `id` = 486663 [ RunTime:0.001740s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000249s ]
  11. SELECT * FROM `article` WHERE `id` < 486663 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000464s ]
  12. SELECT * FROM `article` WHERE `id` > 486663 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000387s ]
  13. SELECT * FROM `article` WHERE `id` < 486663 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002707s ]
  14. SELECT * FROM `article` WHERE `id` < 486663 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.008651s ]
  15. SELECT * FROM `article` WHERE `id` < 486663 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.007724s ]
0.099187s