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

news2024/9/23 17:20:54

目录

一、用法精讲

441、pandas.DataFrame.mask方法

441-1、语法

441-2、参数

441-3、功能

441-4、返回值

441-5、说明

441-6、用法

441-6-1、数据准备

441-6-2、代码示例

441-6-3、结果输出

442、pandas.DataFrame.query方法

442-1、语法

442-2、参数

442-3、功能

442-4、返回值

442-5、说明

442-6、用法

442-6-1、数据准备

442-6-2、代码示例

442-6-3、结果输出

443、pandas.DataFrame.__add__魔法方法

443-1、语法

443-2、参数

443-3、功能

443-4、返回值

443-5、说明

443-6、用法

443-6-1、数据准备

443-6-2、代码示例

443-6-3、结果输出

444、pandas.DataFrame.add方法

444-1、语法

444-2、参数

444-3、功能

444-4、返回值

444-5、说明

444-6、用法

444-6-1、数据准备

444-6-2、代码示例

444-6-3、结果输出

445、pandas.DataFrame.sub方法

445-1、语法

445-2、参数

445-3、功能

445-4、返回值

445-5、说明

445-6、用法

445-6-1、数据准备

445-6-2、代码示例

445-6-3、结果输出

二、推荐阅读

1、Python筑基之旅

2、Python函数之旅

3、Python算法之旅

4、Python魔法之旅

5、博客个人主页

一、用法精讲

441、pandas.DataFrame.mask方法
441-1、语法
# 441、pandas.DataFrame.mask方法
pandas.DataFrame.mask(cond, other=_NoDefault.no_default, *, inplace=False, axis=None, level=None)
Replace values where the condition is True.

Parameters:
cond
bool Series/DataFrame, array-like, or callable
Where cond is False, keep the original value. Where True, replace with corresponding value from other. If cond is callable, it is computed on the Series/DataFrame and should return boolean Series/DataFrame or array. The callable must not change input Series/DataFrame (though pandas doesn’t check it).

other
scalar, Series/DataFrame, or callable
Entries where cond is True are replaced with corresponding value from other. If other is callable, it is computed on the Series/DataFrame and should return scalar or Series/DataFrame. The callable must not change input Series/DataFrame (though pandas doesn’t check it). If not specified, entries will be filled with the corresponding NULL value (np.nan for numpy dtypes, pd.NA for extension dtypes).

inplace
bool, default False
Whether to perform the operation in place on the data.

axis
int, default None
Alignment axis if needed. For Series this parameter is unused and defaults to 0.

level
int, default None
Alignment level if needed.

Returns:
Same type as caller or None if
inplace=True.
441-2、参数

441-2-1、cond(必须)一个条件,可以是布尔DataFrame、Series或数组,当满足此条件时,将替换值。

441-2-2、other(可选)替换的值,可以是标量、DataFrame、Series或数组,默认为_NoDefault.no_default,实际使用时通常会指定某个值。

441-2-3、inplace(可选,默认值为False)布尔值,是否直接修改原DataFrame。

441-2-4、axis(可选,默认值为None)参数用于选择沿哪个轴应用条件,0或'index'表示沿行,1或'columns'表示沿列。

441-2-5、level(可选,默认值为None)多级索引的级别,仅在某些情况下适用。

441-3、功能

        用于根据给定条件替换值的方法,它与DataFrame.where功能相反:where在满足条件时保持原值,而mask在满足条件时会用其他值替换原值。

441-4、返回值

        返回一个新的DataFrame,除非inplace=True,此时将直接修改原DataFrame。

441-5、说明

        无

441-6、用法
441-6-1、数据准备
441-6-2、代码示例
# 441、pandas.DataFrame.mask方法
# 441-1、用标量替换值
import pandas as pd
# 创建一个DataFrame实例
df = pd.DataFrame({
    'A': [1, 2, 3, 4],
    'B': [10, 20, 30, 40]
})
# 使用mask方法,将大于2的值替换为 0
masked_df = df.mask(df > 2, other=0)
print(masked_df, end='\n\n')

# 441-2、用另一个DataFrame替换值
import pandas as pd
# 创建一个DataFrame实例
df = pd.DataFrame({
    'A': [1, 2, 3, 4],
    'B': [10, 20, 30, 40]
})
# 创建另一个DataFrame
replacement_df = pd.DataFrame({
    'A': [100, 200, 300, 400],
    'B': [1000, 2000, 3000, 4000]
})
# 使用mask方法,将大于2的值替换为replacement_df中的对应值
masked_df = df.mask(df > 2, other=replacement_df)
print(masked_df, end='\n\n')

# 441-3、原地修改DataFrame
import pandas as pd
# 创建一个DataFrame实例
df = pd.DataFrame({
    'A': [1, 2, 3, 4],
    'B': [10, 20, 30, 40]
})
# 原地修改DataFrame,将大于2的值替换为-1
df.mask(df > 2, other=-1, inplace=True)
print(df)
441-6-3、结果输出
# 441、pandas.DataFrame.mask方法
# 441-1、用标量替换值
#    A  B
# 0  1  0
# 1  2  0
# 2  0  0
# 3  0  0

# 441-2、用另一个DataFrame替换值
#      A     B
# 0    1  1000
# 1    2  2000
# 2  300  3000
# 3  400  4000

# 441-3、原地修改DataFrame
#    A  B
# 0  1 -1
# 1  2 -1
# 2 -1 -1
# 3 -1 -1
442、pandas.DataFrame.query方法
442-1、语法
# 442、pandas.DataFrame.query方法
pandas.DataFrame.query(expr, *, inplace=False, **kwargs)
Query the columns of a DataFrame with a boolean expression.

Parameters:
exprstr
The query string to evaluate.

You can refer to variables in the environment by prefixing them with an ‘@’ character like @a + b.

You can refer to column names that are not valid Python variable names by surrounding them in backticks. Thus, column names containing spaces or punctuations (besides underscores) or starting with digits must be surrounded by backticks. (For example, a column named “Area (cm^2)” would be referenced as `Area (cm^2)`). Column names which are Python keywords (like “list”, “for”, “import”, etc) cannot be used.

For example, if one of your columns is called a a and you want to sum it with b, your query should be `a a` + b.

inplacebool
Whether to modify the DataFrame rather than creating a new one.

**kwargs
See the documentation for eval() for complete details on the keyword arguments accepted by DataFrame.query().

Returns:
DataFrame or None
DataFrame resulting from the provided query expression or None if inplace=True.
442-2、参数

442-2-1、expr(必须)一个字符串,表示查询的表达式,表达式中的变量名应与DataFrame中的列名一致,可以使用任何有效的Python表达式语法。

442-2-2、inplace(可选,默认值为False)布尔值,如果为True,则在原地修改DataFrame,否则返回一个新的DataFrame。

442-2-3、**kwargs(可选)其他关键字参数,包括影响表达式执行环境的参数:

  • level:整数或级别名称,默认为None,查询沿着指定的级别进行计算(仅适用于多等级索引)。
  • global_dict:映射,将被用作全局命名空间中的变量。
  • local_dict:映射,将被用作局部命名空间中的变量。
442-3、功能

        通过查询表达式来过滤数据,从DataFrame中筛选出符合条件的行,它提供了一种更直观的方法,特别是对于较复杂的条件筛选,与标准的布尔索引方式相比,它显得更加简洁和可读。

442-4、返回值

        返回一个新的DataFrame,其中包含所有符合查询表达式条件的行,如果inplace=True,则直接修改原DataFrame并返回None。

442-5、说明

        无

442-6、用法
442-6-1、数据准备
442-6-2、代码示例
# 442、pandas.DataFrame.query方法
# 442-1、基本使用
import pandas as pd
# 创建一个DataFrame实例
df = pd.DataFrame({
    'A': [1, 2, 3, 4],
    'B': [10, 20, 30, 40],
    'C': ['foo', 'bar', 'foo', 'bar']
})
# 使用query方法筛选出'A'大于2的行
filtered_df = df.query('A > 2')
print(filtered_df, end='\n\n')

# 442-2、结合多个条件
import pandas as pd
# 创建一个DataFrame实例
df = pd.DataFrame({
    'A': [1, 2, 3, 4],
    'B': [10, 20, 30, 40],
    'C': ['foo', 'bar', 'foo', 'bar']
})
# 使用query方法筛选出'A'大于2且'C'等于'foo'的行
filtered_df = df.query('A > 2 and C == "foo"')
print(filtered_df, end='\n\n')

# 442-3、使用inplace=True
import pandas as pd
# 创建一个DataFrame实例
df = pd.DataFrame({
    'A': [1, 2, 3, 4],
    'B': [10, 20, 30, 40],
    'C': ['foo', 'bar', 'foo', 'bar']
})
# 使用query方法原地筛选出'A'大于2的行
df.query('A > 2', inplace=True)
print(df, end='\n\n')

# 442-4、使用局部和全局命名空间中的变量
import pandas as pd
# 创建一个DataFrame实例
df = pd.DataFrame({
    'A': [1, 2, 3, 4],
    'B': [10, 20, 30, 40]
})
# 定义一些全局变量
low = 2
high = 30
# 使用query方法,引用全局变量进行筛选
filtered_df = df.query('A > @low and B < @high')
print(filtered_df)
442-6-3、结果输出
# 442、pandas.DataFrame.query方法
# 442-1、基本使用
#    A   B    C
# 2  3  30  foo
# 3  4  40  bar

# 442-2、结合多个条件
#    A   B    C
# 2  3  30  foo

# 442-3、使用inplace=True
#    A   B    C
# 2  3  30  foo
# 3  4  40  bar

# 442-4、使用局部和全局命名空间中的变量
# Empty DataFrame
# Columns: [A, B]
# Index: []
443、pandas.DataFrame.__add__魔法方法
443-1、语法
# 443、pandas.DataFrame.__add__魔法方法
pandas.DataFrame.__add__(other)
Get Addition of DataFrame and other, column-wise.

Equivalent to DataFrame.add(other).

Parameters:
other
scalar, sequence, Series, dict or DataFrame
Object to be added to the DataFrame.

Returns:
DataFrame
The result of adding other to DataFrame.
443-2、参数

443-2-1、other(必须)要与当前DataFrame相加的对象,可以是以下几种类型:

  • DataFrame:如果传入另一个DataFrame,则进行元素对元素的加法操作。
  • Series:如果传入Series,pandas会尝试将其广播到每一行或每一列,然后执行加法。
  • 标量值:如果传入一个标量值,则将该值加到DataFrame的每个元素上。
443-3、功能

        执行元素级的加法运算,对于两个DataFrame,它会对齐索引和列,然后逐元素相加,如果在某些位置上有缺失数据(NaN),结果将在这些位置保留NaN。

443-4、返回值

        返回一个新的DataFrame,其每个元素是当前DataFrame与other中对应元素相加的结果。

443-5、说明

        无

443-6、用法
443-6-1、数据准备
443-6-2、代码示例
# 443、pandas.DataFrame.__add__魔法方法
# 443-1、两个DataFrame相加
import pandas as pd
df1 = pd.DataFrame({
    'A': [1, 2, 3],
    'B': [4, 5, 6]
})
df2 = pd.DataFrame({
    'A': [10, 20, 30],
    'B': [40, 50, 60]
})
result = df1 + df2
print(result, end='\n\n')

# 443-2、DataFrame与Series相加
import pandas as pd
df = pd.DataFrame({
    'A': [1, 2, 3],
    'B': [4, 5, 6]
})
s = pd.Series([10, 20], index=['A', 'B'])
result = df + s
print(result, end='\n\n')

# 443-3、DataFrame与标量值相加
import pandas as pd
df = pd.DataFrame({
    'A': [1, 2, 3],
    'B': [4, 5, 6]
})
result = df + 10
print(result)
443-6-3、结果输出
# 443、pandas.DataFrame.__add__魔法方法
# 443-1、两个DataFrame相加
#     A   B
# 0  11  44
# 1  22  55
# 2  33  66

# 443-2、DataFrame与Series相加
#     A   B
# 0  11  24
# 1  12  25
# 2  13  26

# 443-3、DataFrame与标量值相加
#     A   B
# 0  11  14
# 1  12  15
# 2  13  16
444、pandas.DataFrame.add方法
444-1、语法
# 444、pandas.DataFrame.add方法
pandas.DataFrame.add(other, axis='columns', level=None, fill_value=None)
Get Addition of dataframe and other, element-wise (binary operator add).

Equivalent to dataframe + other, but with support to substitute a fill_value for missing data in one of the inputs. With reverse version, radd.

Among flexible wrappers (add, sub, mul, div, floordiv, mod, pow) to arithmetic operators: +, -, *, /, //, %, **.

Parameters:
other
scalar, sequence, Series, dict or DataFrame
Any single or multiple element data structure, or list-like object.

axis
{0 or ‘index’, 1 or ‘columns’}
Whether to compare by the index (0 or ‘index’) or columns. (1 or ‘columns’). For Series input, axis to match Series index on.

level
int or label
Broadcast across a level, matching Index values on the passed MultiIndex level.

fill_value
float or None, default None
Fill existing missing (NaN) values, and any new element needed for successful DataFrame alignment, with this value before computation. If data in both corresponding DataFrame locations is missing the result will be missing.

Returns:
DataFrame
Result of the arithmetic operation.
444-2、参数

444-2-1、other(必须)要与当前DataFrame相加的对象,可以是DataFrame、Series或标量值。

444-2-2、axis(可选,默认值为'columns'){0 or ‘index’, 1 or ‘columns’}, 如果other是一个Series,则该参数指示沿哪个轴对齐。

  • 0或'index':沿行对齐
  • 1或'columns':沿列对齐

444-2-3、level(可选,默认值为None)如果具有多层索引(MultiIndex),则此参数用来指定在哪一层上对齐;默认情况下,不使用多层索引。

444-2-4、fill_value(可选,默认值为None)在执行加法操作时,用于替代缺失数据(NaN)的值,如果一方的元素是NaN,则使用fill_value替代。

444-3、功能

        用于执行元素级的加法操作,同时提供了灵活的参数来处理不同类型的数据对齐和缺失数据填充。

444-4、返回值

        返回一个新的DataFrame,其每个元素是当前DataFrame与other中对应元素相加的结果,应用了指定的对齐和填充规则。

444-5、说明

        无

444-6、用法
444-6-1、数据准备
444-6-2、代码示例
# 444、pandas.DataFrame.add方法
# 444-1、两个DataFrame相加
import pandas as pd
df1 = pd.DataFrame({
    'A': [1, 2, 3],
    'B': [4, 5, 6]
})
df2 = pd.DataFrame({
    'A': [10, 20, 30],
    'B': [40, 50, 60]
})
result = df1.add(df2)
print(result, end='\n\n')

# 444-2、DataFrame与Series相加(沿列对齐)
import pandas as pd
df = pd.DataFrame({
    'A': [1, 2, 3],
    'B': [4, 5, 6]
})
s = pd.Series([10, 20], index=['A', 'B'])
result = df.add(s, axis='columns')
print(result, end='\n\n')

# 444-3、DataFrame与标量值相加
import pandas as pd
df = pd.DataFrame({
    'A': [1, 2, 3],
    'B': [4, 5, 6]
})
result = df.add(10)
print(result, end='\n\n')

# 444-4、使用fill_value
import pandas as pd
df1 = pd.DataFrame({
    'A': [1, 2, None],
    'B': [4, None, 6]
})
df2 = pd.DataFrame({
    'A': [10, 20, 30],
    'B': [40, 50, 60]
})
result = df1.add(df2, fill_value=0)
print(result)
444-6-3、结果输出
# 444、pandas.DataFrame.add方法
# 444-1、两个DataFrame相加
#     A   B
# 0  11  44
# 1  22  55
# 2  33  66

# 444-2、DataFrame与Series相加(沿列对齐)
#     A   B
# 0  11  24
# 1  12  25
# 2  13  26

# 444-3、DataFrame与标量值相加
#     A   B
# 0  11  14
# 1  12  15
# 2  13  16

# 444-4、使用fill_value
#       A     B
# 0  11.0  44.0
# 1  22.0  50.0
# 2  30.0  66.0
445、pandas.DataFrame.sub方法
445-1、语法
# 445、pandas.DataFrame.sub方法
pandas.DataFrame.sub(other, axis='columns', level=None, fill_value=None)
Get Subtraction of dataframe and other, element-wise (binary operator sub).

Equivalent to dataframe - other, but with support to substitute a fill_value for missing data in one of the inputs. With reverse version, rsub.

Among flexible wrappers (add, sub, mul, div, floordiv, mod, pow) to arithmetic operators: +, -, *, /, //, %, **.

Parameters:
other
scalar, sequence, Series, dict or DataFrame
Any single or multiple element data structure, or list-like object.

axis
{0 or ‘index’, 1 or ‘columns’}
Whether to compare by the index (0 or ‘index’) or columns. (1 or ‘columns’). For Series input, axis to match Series index on.

level
int or label
Broadcast across a level, matching Index values on the passed MultiIndex level.

fill_value
float or None, default None
Fill existing missing (NaN) values, and any new element needed for successful DataFrame alignment, with this value before computation. If data in both corresponding DataFrame locations is missing the result will be missing.

Returns:
DataFrame
Result of the arithmetic operation.
445-2、参数

445-2-1、other(必须)要与当前DataFrame相减的对象,可以是DataFrame、Series或标量值。

445-2-2、axis(可选,默认值为'columns'){0 or ‘index’, 1 or ‘columns’}, 如果other是一个Series,则该参数指示沿哪个轴对齐。

  • 0或'index':沿行对齐
  • 1或'columns':沿列对齐

445-2-3、level(可选,默认值为None)如果具有多层索引(MultiIndex),则此参数用来指定在哪一层上对齐;默认情况下,不使用多层索引。

445-2-4、fill_value(可选,默认值为None)在执行减法操作时,用于替代缺失数据(NaN)的值,如果一方的元素是NaN,则使用fill_value替代。

445-3、功能

        用于执行元素级的减法操作,同时提供了灵活的参数来处理不同类型的数据对齐和缺失数据填充。

445-4、返回值

        返回一个新的DataFrame,其每个元素是当前DataFrame与other中对应元素相减的结果,应用了指定的对齐和填充规则。

445-5、说明

        无

445-6、用法
445-6-1、数据准备
445-6-2、代码示例
# 445、pandas.DataFrame.sub方法
# 445-1、两个DataFrame相减
import pandas as pd
df1 = pd.DataFrame({
    'A': [10, 20, 30],
    'B': [40, 50, 60]
})
df2 = pd.DataFrame({
    'A': [1, 2, 3],
    'B': [4, 5, 6]
})
result = df1.sub(df2)
print(result, end='\n\n')

# 445-2、DataFrame与Series相减(沿列对齐)
import pandas as pd
df = pd.DataFrame({
    'A': [1, 2, 3],
    'B': [4, 5, 6]
})
s = pd.Series([1, 2], index=['A', 'B'])
result = df.sub(s, axis='columns')
print(result, end='\n\n')

# 445-3、DataFrame与标量值相减
import pandas as pd
df = pd.DataFrame({
    'A': [1, 2, 3],
    'B': [4, 5, 6]
})
result = df.sub(1)
print(result, end='\n\n')

# 445-4、使用fill_value
import pandas as pd
df1 = pd.DataFrame({
    'A': [1, 2, None],
    'B': [4, None, 6]
})
df2 = pd.DataFrame({
    'A': [10, 20, 30],
    'B': [40, 50, 60]
})
result = df1.sub(df2, fill_value=0)
print(result)
445-6-3、结果输出
# 445、pandas.DataFrame.sub方法
# 445-1、两个DataFrame相减
#     A   B
# 0   9  36
# 1  18  45
# 2  27  54

# 445-2、DataFrame与Series相减(沿列对齐)
#    A  B
# 0  0  2
# 1  1  3
# 2  2  4

# 445-3、DataFrame与标量值相减
#    A  B
# 0  0  3
# 1  1  4
# 2  2  5

# 445-4、使用fill_value
#       A     B
# 0  -9.0 -36.0
# 1 -18.0 -50.0
# 2 -30.0 -54.0

二、推荐阅读

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

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

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

相关文章

【C++题解】1223. 汉诺塔的移动次数

欢迎关注本专栏《C从零基础到信奥赛入门级&#xff08;CSP-J&#xff09;》 问题&#xff1a;1223. 汉诺塔的移动次数 类型&#xff1a;函数、递归基础 题目描述&#xff1a; 汉诺塔的问题大家都已经很熟悉了&#xff0c;有三个柱子&#xff0c;每个柱子上有一些大小不一的金…

Python(C)图像压缩导图

&#x1f3af;要点 傅里叶和小波变换主成分分析彩色图压缩制作不同尺寸图像K均值和生成式对抗网络压缩无损压缩算法压缩和解压缩算法离散小波变换压缩树结构象限算法压缩矩阵分解有损压缩算法量化模型有损压缩算法JPEG压缩解压缩算法 Python图像压缩 图像压缩可以是有损的&…

Gazebo Harmonic gz-harmonic 和 ROS2 Jazzy 注意事项

激光显示 点呈现 射线呈现 rviz2 新旧版本并存的混乱 本教程旨在为在Ubuntu Jammy&#xff08;最新支持Gazebo Classic包的Ubuntu版本&#xff09;上运行Gazebo Classic&#xff08;如Gazebo 11&#xff09;的用户提供指导&#xff0c;这些用户计划将其代码迁移到新的Gazebo版…

大语言模型(LLMs)全面学习指南

大语言模型&#xff08;LLMs&#xff09;作为人工智能&#xff08;AI&#xff09;领域的一项突破性发展&#xff0c;已经改变了自然语言处理&#xff08;NLP&#xff09;和机器学习&#xff08;ML&#xff09;应用的面貌。这些模型&#xff0c;包括OpenAI的GPT-4o和Google的gem…

泛运动生态持续破圈,重估Keep时刻来临

在中国超40万亿的庞大消费市场中&#xff0c;从不缺少“燃点”。 前不久举办的巴黎奥运会&#xff0c;就带火了国内规模空前的“奥运经济”。在诸多品牌助力下&#xff0c;这股运动消费热潮持续破圈。 比如&#xff0c;运动科技公司Keep通过发布主题为《心火已燃》的品牌TVC&…

生信圆桌x生信友好期刊:助力生物信息学研究的学术平台

介绍 生物信息学作为一门交叉学科&#xff0c;近年来得到了快速发展。为了促进生信领域的科研交流&#xff0c;许多学术期刊开始关注并专门发表生物信息学相关的研究成果。这些期刊被称为“生信友好期刊”&#xff0c;它们为研究人员提供了一个展示和传播最新科研成果的重要平…

怎么成为ChatGPT使用大神?

成为高效使用ChatGPT的高手&#xff0c;可以通过以下几个方面来提升你的使用体验和效果&#xff1a; 1. 清晰明确的提问 明确问题&#xff1a;尽量将问题表述清楚、具体。例如&#xff0c;“如何提高文章写作技巧&#xff1f;” 比 “写作技巧” 更具体。提供上下文&#xf…

UnrealEngine学习(01):安装虚幻引擎

1. 下载安装 Epic Games 目前下载UE引擎需要先下载Epic Games&#xff0c;官网为我们提供了下载路径&#xff1a; https://www.unrealengine.com/zh-CN/downloadhttps://www.unrealengine.com/zh-CN/download 我们点击图中步骤一即可进行下载。 注释&#xff1a;Unreal Engi…

AI嵌入式开发 ---- pt模型文件 -> ONNX模型 -> rknn模型 -> 部署到RK3588开发板上(以yolov5为例)

目录 一、前言 1.1 任务 1.2 开发板下跑预训练模型流程 二、pt 文件转换为 onnx 或 TorchScript 文件&#xff08;平台&#xff1a;x86机器Windows系统&#xff09; 二、将 .onnx 模型文件转换为 .rknn 模型文件【平台&#xff1a;x86上的 Linux虚拟系统】 三、在 Linux虚…

python爬虫控制aiohttp并发数量方式例子解析

在使用Python的aiohttp库进行爬虫开发时&#xff0c;控制并发数量是一个重要的环节&#xff0c;以避免对目标网站造成过大压力或触发反爬机制。以下是一些控制并发数量的方法和示例&#xff1a; 使用Semaphore限制并发数&#xff1a;Semaphore&#xff08;信号量&#xff09;是…

用大模型学习大模型-40问掌握大模型入门知识点(上)

采用提问方式&#xff0c;从个人知识盲点开始&#xff0c;渐进式掌握大模型入门知识点。‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ 1、大模型中7b、70B代表什么 在讨论人工智能领域特别是大型语言模型&#xff08;LLMs&#xff09;时&#xff0c;“7b”和“70B”均…

【Kotlin设计模式】Kotlin实现装饰器模式

前言 装饰器模式&#xff08;Decorator Pattern&#xff09;&#xff0c;用于动态地为对象添加新功能&#xff0c;而无需修改其结构&#xff0c;通过使用不用装饰类及这些装饰类的排列组合&#xff0c;可以实现不同的功能和效果&#xff0c;但是这样的效果就是会增加很多类&…

debian12 - rsyslog的安装/配置/使用

文章目录 debian12 - rsyslog的安装/配置/使用概述笔记实现main.cppmy_syslog.hmy_syslog.cppMakefileMakefile的准备工作END debian12 - rsyslog的安装/配置/使用 概述 以前在debian7.5中用syslog可以。 现在准备在debian12虚拟机中做个rsyslog的实验&#xff0c;看syslog还…

2024年PDF转换成PPT三步走,职场小白秒变高手

这个信息满天飞的时代&#xff0c;我们几乎天天都得处理一堆文件&#xff0c;PDF和PPT这对搭档简直就是我们工作学习中的老面孔。你有没有碰到过这种头疼事&#xff1a;急着要把PDF转成PPT来准备个演讲&#xff0c;但就是找不到个又快又好使的招&#xff1f;别慌&#xff0c;今…

一文搞懂大模型!基础知识、 LLM 应用、 RAG 、 Agent 与未来发展

LLM 探秘&#xff1a;想要深入了解人工智能界的“新宠”大型语言模型&#xff08;LLM&#xff09;吗&#xff1f;本文将带你走进 LLM 的世界&#xff0c;从入门知识到实际应用&#xff0c;全方位解读这个充满魔力的“大模型”。我们将一起揭开 LLM 的神秘面纱&#xff0c;领略其…

代码随想录算法训练营第三十九天 | 198.打家劫舍 , 213.打家劫舍II , 337.打家劫舍III

目录 198.打家劫舍 思路 1.确定dp数组&#xff08;dp table&#xff09;以及下标的含义 2.确定递推公式 3.dp数组如何初始化 4.确定遍历顺序 5.举例推导dp数组 方法一&#xff1a; 动态规划-一维 方法二&#xff1a;动态规划-二维 方法三&#xff1a;动态规划-两个变…

零知识证明-基础数学(二)

零知识证明(Zero—Knowledge Proof)&#xff0c;是指一种密码学工具&#xff0c;允许互不信任的通信双方之间证明某个命题的有效性&#xff0c;同时不泄露任何额外信息 导数、偏导数 ,互质数&#xff0c;费马小定理&#xff0c;欧拉定理 1 导数 导数是微积分学中的重要概念&am…

从《黑神话:悟空》看中国3A游戏之路:历史回顾与未来展望

近年来&#xff0c;随着中国游戏行业的不断发展&#xff0c;一款名为《黑神话&#xff1a;悟空》的游戏引发了全球的广泛关注。这款游戏不仅在视觉效果和动作设计上令人惊艳&#xff0c;还被誉为中国3A游戏的里程碑。然而&#xff0c;从《黑神话&#xff1a;悟空》的发布&#…

STM32-PWM驱动呼吸灯——HAL库

&#xff08;根据B站up主keysking的STM32教程视频的笔记&#xff09; 【STM32】动画讲解轻松学会STM32的PWM_哔哩哔哩_bilibili 什么是PWM&#xff1f; PWM&#xff0c;全称为脉冲宽度调制&#xff08;Pulse Width Modulation&#xff09;&#xff0c;是一种调制技术&#xf…

对各项数据的统计汇总,集中展示,便于查看厂区情况的智慧物流开源了。

智慧物流视频监控平台是一款功能强大且简单易用的实时算法视频监控系统。它的愿景是最底层打通各大芯片厂商相互间的壁垒&#xff0c;省去繁琐重复的适配流程&#xff0c;实现芯片、算法、应用的全流程组合&#xff0c;从而大大减少企业级应用约95%的开发成本。构建基于Ai技术的…