Python酷库之旅-第三方库Pandas(020)

news2024/9/20 15:08:30

目录

一、用法精讲

49、pandas.merge_asof函数

49-1、语法

49-2、参数

49-3、功能

49-4、返回值

49-5、说明

49-5-1、功能

49-6、用法

49-6-1、数据准备

49-6-2、代码示例

49-6-3、结果输出

50、pandas.concat函数

50-1、语法

50-2、参数

50-3、功能

50-4、返回值

50-5、说明

50-6、用法

50-6-1、数据准备

50-6-2、代码示例

50-6-3、结果输出 

51、pandas.get_dummies函数

51-1、语法

51-2、参数

51-3、功能

51-4、返回值

51-5、说明

51-6、用法

51-6-1、数据准备

51-6-2、代码示例

51-6-3、结果输出

二、推荐阅读

1、Python筑基之旅

2、Python函数之旅

3、Python算法之旅

4、Python魔法之旅

5、博客个人主页

一、用法精讲

49、pandas.merge_asof函数
49-1、语法
# 49、pandas.merge_asof函数
pandas.merge_asof(left, right, on=None, left_on=None, right_on=None, left_index=False, right_index=False, by=None, left_by=None, right_by=None, suffixes=('_x', '_y'), tolerance=None, allow_exact_matches=True, direction='backward')
Perform a merge by key distance.

This is similar to a left-join except that we match on nearest key rather than equal keys. Both DataFrames must be sorted by the key.

For each row in the left DataFrame:

A “backward” search selects the last row in the right DataFrame whose ‘on’ key is less than or equal to the left’s key.

A “forward” search selects the first row in the right DataFrame whose ‘on’ key is greater than or equal to the left’s key.

A “nearest” search selects the row in the right DataFrame whose ‘on’ key is closest in absolute distance to the left’s key.

Optionally match on equivalent keys with ‘by’ before searching with ‘on’.

Parameters:
left
DataFrame or named Series
right
DataFrame or named Series
on
label
Field name to join on. Must be found in both DataFrames. The data MUST be ordered. Furthermore this must be a numeric column, such as datetimelike, integer, or float. On or left_on/right_on must be given.

left_on
label
Field name to join on in left DataFrame.

right_on
label
Field name to join on in right DataFrame.

left_index
bool
Use the index of the left DataFrame as the join key.

right_index
bool
Use the index of the right DataFrame as the join key.

by
column name or list of column names
Match on these columns before performing merge operation.

left_by
column name
Field names to match on in the left DataFrame.

right_by
column name
Field names to match on in the right DataFrame.

suffixes
2-length sequence (tuple, list, …)
Suffix to apply to overlapping column names in the left and right side, respectively.

tolerance
int or Timedelta, optional, default None
Select asof tolerance within this range; must be compatible with the merge index.

allow_exact_matches
bool, default True
If True, allow matching with the same ‘on’ value (i.e. less-than-or-equal-to / greater-than-or-equal-to)

If False, don’t match the same ‘on’ value (i.e., strictly less-than / strictly greater-than).

direction
‘backward’ (default), ‘forward’, or ‘nearest’
Whether to search for prior, subsequent, or closest matches.

Returns:
DataFrame
49-2、参数

49-2-1、left(必须)左侧DataFrame对象。

49-2-2、right(必须)右侧DataFrame对象。

49-2-3、on(可选,默认值为None)指定用于合并的列,这个列在两个DataFrame中都必须存在。如果没有指定left_on和right_on,则必须提供该参数。

49-2-4、left_on(可选,默认值为None)左侧DataFrame中用于合并的列。

49-2-5、right_on(可选,默认值为None)右侧DataFrame中用于合并的列。

49-2-6、left_index(可选,默认值为False)布尔值,表示是否使用左侧DataFrame的索引来进行合并。

49-2-7、right_index(可选,默认值为False)布尔值,表示是否使用右侧DataFrame的索引来进行合并。

49-2-8、by(可选,默认值为None)在执行合并前先对指定列进行分组,by列在两个DataFrame 中都必须存在,类似于SQL中的“分区”合并。

49-2-9、left_by(可选,默认值为None)左侧DataFrame中用于分组的列。

49-2-10、right_by(可选,默认值为None)右侧DataFrame中用于分组的列。

49-2-11、suffixes(可选,默认值为('_x', '_y'))当两个DataFrame中存在同名列时,指定列名的后缀。

49-2-12、tolerance(可选,默认值为None)指定合并时允许的最大时间差,可以是一个数值或Timedelta对象。

49-2-13、allow_exact_matches(可选,默认值为True)布尔值,表示是否允许精确匹配。

49-2-14、direction(可选,默认值为'backward')指定匹配的方向,可以是'backward'(向后匹配),'forward'(向前匹配)或者 'nearest'(最近匹配)。

49-3、功能

        进行“按时间顺序的近似匹配”合并操作,它特别适用于时间序列数据,当两个DataFrame的时间戳并不完全匹配时,可以通过该函数找到最近的匹配点进行合并。

49-4、返回值

        返回一个新的DataFrame,该DataFrame包含合并后的结果。

49-5、说明
49-5-1、功能

49-5-1-1、近似时间匹配:pandas.merge_asof()可以在两个DataFrame之间基于时间戳列进行合并,即使时间戳不完全匹配。它会根据指定的方向找到最近的匹配点。

49-5-1-2、方向控制:用户可以指定合并方向,如向后匹配(backward)、向前匹配(forward)或最近匹配(nearest)。

49-5-1-3、容差范围:可以设置一个容差范围(tolerance),限制匹配点的最大时间差。

49-5-1-4、分组合并:可以按指定列进行分组,然后在每个分组内进行合并。

49-5-1-5、索引合并:允许使用索引进行合并,而不仅限于列。

49-5-2、返回值

49-5-2-1、合并列:用于合并操作的列(例如时间戳列)。

49-5-2-2、原始列:来自左侧和右侧DataFrame的所有列。对于同名列,会根据suffixes参数添加后缀。

49-5-2-3、匹配列:合并时所找到的最近匹配点的对应值。

49-6、用法
49-6-1、数据准备
49-6-2、代码示例
# 49、pandas.merge_asof函数
import pandas as pd
# 创建示例DataFrame
df1 = pd.DataFrame({
    'time': pd.to_datetime(['2024-07-13 01:00', '2024-07-13 02:00', '2024-07-13 03:00']),
    'value1': [10, 20, 30]
})
df2 = pd.DataFrame({
    'time': pd.to_datetime(['2024-07-13 01:30', '2024-07-13 02:30']),
    'value2': [100, 200]
})
# 使用merge_asof进行近似时间匹配合并
result = pd.merge_asof(df1, df2, on='time', direction='nearest', suffixes=('_left', '_right'))
print(result)
49-6-3、结果输出
# 49、pandas.merge_asof函数
#                  time  value1  value2
# 0 2024-07-13 01:00:00      10     100
# 1 2024-07-13 02:00:00      20     100
# 2 2024-07-13 03:00:00      30     200
50、pandas.concat函数
50-1、语法
# 50、pandas.concat函数
pandas.concat(objs, *, axis=0, join='outer', ignore_index=False, keys=None, levels=None, names=None, verify_integrity=False, sort=False, copy=None)
Concatenate pandas objects along a particular axis.

Allows optional set logic along the other axes.

Can also add a layer of hierarchical indexing on the concatenation axis, which may be useful if the labels are the same (or overlapping) on the passed axis number.

Parameters:
objs
a sequence or mapping of Series or DataFrame objects
If a mapping is passed, the sorted keys will be used as the keys argument, unless it is passed, in which case the values will be selected (see below). Any None objects will be dropped silently unless they are all None in which case a ValueError will be raised.

axis
{0/’index’, 1/’columns’}, default 0
The axis to concatenate along.

join
{‘inner’, ‘outer’}, default ‘outer’
How to handle indexes on other axis (or axes).

ignore_index
bool, default False
If True, do not use the index values along the concatenation axis. The resulting axis will be labeled 0, …, n - 1. This is useful if you are concatenating objects where the concatenation axis does not have meaningful indexing information. Note the index values on the other axes are still respected in the join.

keys
sequence, default None
If multiple levels passed, should contain tuples. Construct hierarchical index using the passed keys as the outermost level.

levels
list of sequences, default None
Specific levels (unique values) to use for constructing a MultiIndex. Otherwise they will be inferred from the keys.

names
list, default None
Names for the levels in the resulting hierarchical index.

verify_integrity
bool, default False
Check whether the new concatenated axis contains duplicates. This can be very expensive relative to the actual data concatenation.

sort
bool, default False
Sort non-concatenation axis if it is not already aligned. One exception to this is when the non-concatentation axis is a DatetimeIndex and join=’outer’ and the axis is not already aligned. In that case, the non-concatenation axis is always sorted lexicographically.

copy
bool, default True
If False, do not copy data unnecessarily.

Returns:
object, type of objs
When concatenating all Series along the index (axis=0), a Series is returned. When objs contains at least one DataFrame, a DataFrame is returned. When concatenating along the columns (axis=1), a DataFrame is returned.
50-2、参数

50-2-1、objs(必须)待连接的DataFrame或Series对象的列表或字典。

50-2-2、axis(可选,默认值为0)沿指定轴进行连接,0表示纵向(沿行),1表示横向(沿列)。

50-2-3、join(可选,默认值为'outer')指定连接方式,‘outer’为外连接,‘inner’为内连接。

50-2-4、ignore_index(可选,默认值为False)若为True,则忽略索引,生成新的整数索引。

50-2-5、keys(可选,默认值为None)用于构建多层索引,如果提供该参数,则连接结果会有一个多层索引。

50-2-6、levels(可选,默认值为None)用于构建多层索引级别,必须与keys参数一起使用。

50-2-7、names(可选,默认值为None)多层索引级别的名称,必须与keys参数一起使用。

50-2-8、verify_integrity(可选,默认值为False)若为True,检查新连接的对象是否有重复索引,如果有重复,抛出异常。

50-2-9、sort(可选,默认值为False)若为True,则根据连接的索引进行排序,为了提升性能,默认不排序。

50-2-10、copy(可选,默认值为None)若为False,则不复制数据。

50-3、功能

        用于沿指定轴将多个DataFrame或Series对象进行连接。

50-4、返回值

        返回值是一个新的DataFrame或Series,具体取决于输入对象和参数设置。

50-5、说明

        返回值的类型和结构主要取决于以下几个因素:

50-5-1、输入对象的类型:输入的对象可以是DataFrame或Series。

50-5-2、连接的轴(axis):指定是沿行(axis=0)还是沿列(axis=1)进行连接。

50-5-3、连接方式(join):指定是内连接还是外连接。

50-5-4、是否忽略索引(ignore_index):决定是否生成新的整数索引。

50-5-5、多层索引(keys, levels, names):如果提供这些参数,返回的将是一个具有多层索引的DataFrame。

50-6、用法
50-6-1、数据准备
50-6-2、代码示例
# 50、pandas.concat函数
import pandas as pd
# 创建示例DataFrame
df1 = pd.DataFrame({
    'A': ['A0', 'A1', 'A2'],
    'B': ['B0', 'B1', 'B2']
}, index=[0, 1, 2])
df2 = pd.DataFrame({
    'A': ['A3', 'A4', 'A5'],
    'B': ['B3', 'B4', 'B5']
}, index=[3, 4, 5])
# 纵向连接
result = pd.concat([df1, df2], axis=0)
print(result,end='\n\n')
# 横向连接,忽略索引
result = pd.concat([df1, df2], axis=1, ignore_index=True)
print(result, end='\n\n')
# 多层索引
result = pd.concat([df1, df2], keys=['df1', 'df2'])
print(result)
50-6-3、结果输出 
# 50、pandas.concat函数
#     A   B
# 0  A0  B0
# 1  A1  B1
# 2  A2  B2
# 3  A3  B3
# 4  A4  B4
# 5  A5  B5

#      0    1    2    3
# 0   A0   B0  NaN  NaN
# 1   A1   B1  NaN  NaN
# 2   A2   B2  NaN  NaN
# 3  NaN  NaN   A3   B3
# 4  NaN  NaN   A4   B4
# 5  NaN  NaN   A5   B5

#         A   B
# df1 0  A0  B0
#     1  A1  B1
#     2  A2  B2
# df2 3  A3  B3
#     4  A4  B4
#     5  A5  B5
51、pandas.get_dummies函数
51-1、语法
# 51、pandas.get_dummies函数
pandas.get_dummies(data, prefix=None, prefix_sep='_', dummy_na=False, columns=None, sparse=False, drop_first=False, dtype=None)
Convert categorical variable into dummy/indicator variables.

Each variable is converted in as many 0/1 variables as there are different values. Columns in the output are each named after a value; if the input is a DataFrame, the name of the original variable is prepended to the value.

Parameters:
data
array-like, Series, or DataFrame
Data of which to get dummy indicators.

prefix
str, list of str, or dict of str, default None
String to append DataFrame column names. Pass a list with length equal to the number of columns when calling get_dummies on a DataFrame. Alternatively, prefix can be a dictionary mapping column names to prefixes.

prefix_sep
str, default ‘_’
If appending prefix, separator/delimiter to use. Or pass a list or dictionary as with prefix.

dummy_na
bool, default False
Add a column to indicate NaNs, if False NaNs are ignored.

columns
list-like, default None
Column names in the DataFrame to be encoded. If columns is None then all the columns with object, string, or category dtype will be converted.

sparse
bool, default False
Whether the dummy-encoded columns should be backed by a SparseArray (True) or a regular NumPy array (False).

drop_first
bool, default False
Whether to get k-1 dummies out of k categorical levels by removing the first level.

dtype
dtype, default bool
Data type for new columns. Only a single dtype is allowed.

Returns:
DataFrame
Dummy-coded data. If data contains other columns than the dummy-coded one(s), these will be prepended, unaltered, to the result.
51-2、参数

51-2-1、data(必须)要转换的输入数据,可以是数组、Series或DataFrame。

51-2-2、prefix(可选,默认值为None)前缀字符串,用于哑变量列的命名,如果输入是DataFrame,可以传递一个字典来分别为每一列指定前缀。

51-2-3、prefix_sep(可选,默认值为'_')前缀和分类值之间的分隔符。例如,如果前缀是A,分类值是cat,那么结果列名将是A_cat

51-2-4、dummy_na(可选,默认值为False)如果为True,则会为NaN/缺失值添加一列指示变量,缺失值将被视为一个有效的分类。

51-2-5、columns(可选,默认值为None)指定要转换的列,如果未指定,将转换所有分类变量列(包括objectcategory类型的列)。

51-2-6、sparse(可选,默认值为False)如果为True,返回的哑变量列将是稀疏的(SparseDataFrame 或 SparseArray),这对于大数据集可能更有效。

51-2-7、drop_first(可选,默认值为False)如果为True,则删除第一个分类变量的哑变量列,以避免多重共线性,这在回归模型中很常用。

51-2-8、dtype(可选,默认值为None)指定输出哑变量列的dtype,默认情况下,输出列为uint8类型。

51-3、功能

        用于将分类变量转换为哑变量(虚拟变量)或指标变量,它可以将带有分类数据的列转换为多个二进制(0/1)列,方便在机器学习模型中使用。

51-4、返回值

        返回值是一个DataFrame,其中包含原始数据框中的所有非分类变量列,以及为每个分类变量生成的哑变量列。

51-5、说明

        无

51-6、用法
51-6-1、数据准备
51-6-2、代码示例
# 51、pandas.get_dummies函数
# 51-1、基本用法
import pandas as pd
df = pd.DataFrame({
    'A': ['a', 'b', 'a'],
    'B': ['c', 'c', 'b'],
    'C': [1, 2, 3]
})
print('原始数据框:')
print(df, end='\n\n')
result = pd.get_dummies(df)
print('基本用法:')
print(result, end='\n\n')

# 51-2、指定前缀和前缀分隔符
import pandas as pd
df = pd.DataFrame({
    'A': ['a', 'b', 'a'],
    'B': ['c', 'c', 'b'],
    'C': [1, 2, 3]
})
result = pd.get_dummies(df, prefix=['colA', 'colB'], prefix_sep='-')
print('指定前缀和前缀分隔符:')
print(result, end='\n\n')

# 51-3、删除第一个哑变量列
import pandas as pd
df = pd.DataFrame({
    'A': ['a', 'b', 'a'],
    'B': ['c', 'c', 'b'],
    'C': [1, 2, 3]
})
result = pd.get_dummies(df, drop_first=True)
print('删除第一个哑变量列:')
print(result, end='\n\n')

# 51-4、为特定列生成哑变量
import pandas as pd
df = pd.DataFrame({
    'A': ['a', 'b', 'a'],
    'B': ['c', 'c', 'b'],
    'C': [1, 2, 3]
})
result = pd.get_dummies(df, columns=['A'])
print('为特定列生成哑变量:')
print(result)
51-6-3、结果输出
# 51、pandas.get_dummies函数
# 51-1、基本用法
# 原始数据框:
#    A  B  C
# 0  a  c  1
# 1  b  c  2
# 2  a  b  3

# 基本用法:
#    C    A_a    A_b    B_b    B_c
# 0  1   True  False  False   True
# 1  2  False   True  False   True
# 2  3   True  False   True  False

# 51-2、指定前缀和前缀分隔符
# 指定前缀和前缀分隔符:
#    C  colA-a  colA-b  colB-b  colB-c
# 0  1    True   False   False    True
# 1  2   False    True   False    True
# 2  3    True   False    True   False

# 51-3、删除第一个哑变量列
# 删除第一个哑变量列:
#    C    A_b    B_c
# 0  1  False   True
# 1  2   True   True
# 2  3  False  False

# 51-4、为特定列生成哑变量
# 为特定列生成哑变量:
#    B  C    A_a    A_b
# 0  c  1   True  False
# 1  c  2  False   True
# 2  b  3   True  False

二、推荐阅读

1、Python筑基之旅
2、Python函数之旅
3、Python算法之旅
4、Python魔法之旅
5、博客个人主页

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1923604.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

中仕公考:没有教师资格证能考编吗?

没有教师资格证的考生,是不能参加教师编考试的。但是,符合“先上岗,再考证”的阶段性措施,高校毕业生可在未获得教师资格证的情况下先行就业。其他考生必须首先取得教师资格证,才能参与教师编考试。 报考普通小学和幼…

【Android Studio】实现底部导航栏Tab切换(提供Gitee源码)

前言:本期教学如何制作底部导航栏以及使用Fragment实现页面切换的完整功能,本篇提供所有源代码,均测试无误,大家可以放心使用。 目录 一、功能演示 二、代码实现 2.1、bottom.xml 2.2、message.xml、book.xml和mine.xml 2.3、…

第三期书生大模型实战营之Git前置知识

闯关任务1 每位参与者提交一份自我介绍。 提交地址&#xff1a;https://github.com/InternLM/Tutorial 的 camp3 分支&#xff5e; 要求 1. 命名格式为 camp3_<id>.md&#xff0c;其中 <id> 是您的报名问卷ID。 2. 文件路径应为 ./data/Git/task/。 3. 在 GitHub…

单网口设备的IP地址识别-还原-自组网

1.如果知道该设备所在网段&#xff1a; 此时可以使用nmap工具&#xff0c;进行网段扫描&#xff1a; nmap -sn 192.168.0.0/24 256个地址的子网10秒就能扫描一轮。关掉设备&#xff0c;打开设备&#xff0c;diff&#xff0c;基本就可以定位所要找到目标设备的IP 2.如果不知道…

链接追踪系列-04.linux服务器docker安装elk

[rootVM-24-17-centos ~]# cat /proc/sys/vm/max_map_count 65530 [rootVM-24-17-centos ~]# sysctl -w vm.max_map_count262144 vm.max_map_count 262144 #先创建出相应目录&#xff1a;/opt/dockerV/es/…docker run -e ES_JAVA_OPTS"-Xms512m -Xmx512m" -d -p 92…

隔离驱动-视频课笔记

目录 1、需要隔离的原因 1.2、四种常用的隔离方案 2、脉冲变压器隔离 2.1、脉冲变压器的工作原理 2.2、泄放电阻对开关电路的影响 2.3、本课小结 3、光耦隔离驱动 3.1、光耦隔离驱动原理 3.2、光耦隔离驱动的电源进行分析 3.3、本课小结 4、自举升压驱动 4.1…

哪款开放式运动耳机佩戴最舒服?2024五款备受推崇产品分享!

​热爱户外活动的你&#xff0c;定是对生活有着独到品味的行者。想象一下&#xff0c;在户外活动时&#xff0c;若有一款耳机能完美融入场景&#xff0c;为你带来无与伦比的音乐享受&#xff0c;岂不是锦上添花&#xff1f;此时&#xff0c;开放式耳机便应运而生&#xff0c;其…

SEO:6个避免被搜索引擎惩罚的策略-华媒舍

在当今数字时代&#xff0c;搜索引擎成为了绝大多数人获取信息和产品的首选工具。为了在搜索结果中获得良好的排名&#xff0c;许多网站采用了各种优化策略。有些策略可能会适得其反&#xff0c;引发搜索引擎的惩罚。以下是彭博社发稿推广的6个避免被搜索引擎惩罚的策略。 1. 内…

结合实体类型信息(3)——TransT: 基于类型的多重嵌入表示用于知识图谱补全

1 引言 1.1 问题 仅仅依赖于三元组的结构化信息有其局限性&#xff0c;因为它们往往忽略了知识图谱中丰富的语义信息以及由这些语义信息所代表的先验知识。语义信息是指实体和关系的含义&#xff0c;比如“北京”是“中国”的首都&#xff0c;“苹果”是一种水果。先验知识则…

uniapp编译成h5后接口请求参数变成[object object]

问题&#xff1a;uniapp编译成h5后接口请求参数变成[object object] 但是运行在开发者工具上没有一点问题 排查&#xff1a; 1&#xff1a;请求参数&#xff1a;看是否是在请求前就已经变成了[object object]了 结果&#xff1a; 一切正常 2&#xff1a;请求头&#xff1a;看…

yolov8-obb训练自己的数据集(标注,训练,推理,转化模型)

一、源码 直接去下载官方的yolov8源码就行&#xff0c;那里面集成了 obb ultralytics/ultralytics/cfg/models/v8 at main ultralytics/ultralytics GitHub 二、环境 如果你训练过yolov5以及以上的yolo环境&#xff0c;可以直接拷贝一个用就行&#xff0c;如果没有的话 直…

破解数据孤岛:论数据中台对企业数据治理的作用与挑战-亿发

在数字化转型浪潮中&#xff0c;数据中台这一概念频频被提及。然而&#xff0c;业界目前尚未对数据中台形成统一的定义。本文将基于PowerData的理解&#xff0c;深入探讨数据中台的核心价值与挑战。 数据中台的本质 数据中台不仅仅是一项单一的技术&#xff0c;而是涵盖数据集…

R语言中交互式图表绘制

revenue <- read.csv("data/revenue.csv") 数据集放在了文章末尾&#xff0c;需要自取。 if(!require(plotly)) install.packages("plotly") # 绘制柱状图 p <- plot_ly(revenue,y ~本周,x ~游戏名称,type "bar",name "本周&q…

记一次项目经历

一、项目需求 1、设备四个工位&#xff0c;每个工位需要测试产品的电参数&#xff1b; 2、每个另外加四个位置温度&#xff1b; 3、显示4个通道电流曲线&#xff0c;16个通道温度曲线&#xff1b; 4、可切换工艺参数&#xff1b; 5、常规判定&#xff0c;测试数据保存到表格内&…

AndoridStudio 使用 Inspect code 检查优化代码

日常开发时&#xff0c;AS 会有报黄提示&#xff0c;如果不修改&#xff0c;日积月累下来&#xff0c;应用性能就有问题了。 针对这种情况&#xff0c;可以使用 AS 自带的 Inspect code 功能来批量检查、优化代码。 选择 Code – Inspect Code &#xff0c; 按需选择 整个工…

如何允许从互联网(外网)进入路由器管理页面

1.绑定UDP端口 操作如图所示&#xff1a; 2.然后再绑定虚拟换回网卡 3.然后再把出端口编号设置成为2 使他成为一个双向输入输出具体操作如图所示&#xff1a; 4.进入防火墙然后再启动防火墙进行端口配置&#xff1a; 1.进入端口g0/0/0配置ip地址&#xff08;注意配置的ip地…

【web]-f12-iphone6

题目&#xff1a;屌丝没有苹果&#xff0c;手机都买不起&#xff0c;咋办&#xff1f;室友的iphone6好眼馋&#xff0c;某些网站也只有手机打得开(答案为flag{}形式&#xff0c;提交{}中内容即可) 手机模式浏览&#xff0c;F5刷新下就可以看到了。 flag a2a7c20140d7520903a70…

uniapp内置组件scroll-view案例解析

参考资料 文档地址&#xff1a;https://uniapp.dcloud.net.cn/component/scroll-view.html 官方给的完整代码 <script>export default {data() {return {scrollTop: 0,old: {scrollTop: 0}}},methods: {upper: function(e) {console.log(e)},lower: function(e) {cons…

MSPM0G3507(三十七)——最新资料包

所有代码本人全部试过都能用 &#xff0c;有啥疑问直接提出 推荐用软件OLED硬件6050&#xff0c;硬件6050读取速度较快&#xff0c;比较稳定 OLED是单独的纯OLED 两个6050程序分别为硬件6050软件oled&#xff0c;软件6050硬件OLED 全都是在CCStheia上编程&#xff0c;有啥问…

sentinel源码分析: dashboard与微服务的交互、pull模式持久化

文章目录 原始方式微服务端规则如何保存规则如何加载进内存微服务端接收控制台请求控制台推送规则总结 pull拉模式官方demo如何整合Spring Cloud整合Spring Cloud 前置知识 SentinelResource的实现原理、SphU.entry()方法中ProcessorSlotChain链、entry.exit() 建议先会使用se…