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

news2024/9/25 1:14:55

目录

一、用法精讲

44、pandas.crosstab函数

44-1、语法

44-2、参数

44-3、功能

44-4、返回值

44-5、说明

44-6、用法

44-6-1、数据准备

44-6-2、代码示例

44-6-3、结果输出

45、pandas.cut函数

45-1、语法

45-2、参数

45-3、功能

45-4、返回值

45-5、说明

45-6、用法

45-6-1、数据准备

45-6-2、代码示例

45-6-3、结果输出 

46、pandas.qcut函数

46-1、语法

46-2、参数

46-3、功能

46-4、返回值

46-5、说明

46-6、用法

46-6-1、数据准备

46-6-2、代码示例

46-6-3、结果输出

二、推荐阅读

1、Python筑基之旅

2、Python函数之旅

3、Python算法之旅

4、Python魔法之旅

5、博客个人主页

一、用法精讲

44、pandas.crosstab函数
44-1、语法
# 44、pandas.crosstab函数
pandas.crosstab(index, columns, values=None, rownames=None, colnames=None, aggfunc=None, margins=False, margins_name='All', dropna=True, normalize=False)
Compute a simple cross tabulation of two (or more) factors.

By default, computes a frequency table of the factors unless an array of values and an aggregation function are passed.

Parameters:
index
array-like, Series, or list of arrays/Series
Values to group by in the rows.

columns
array-like, Series, or list of arrays/Series
Values to group by in the columns.

values
array-like, optional
Array of values to aggregate according to the factors. Requires aggfunc be specified.

rownames
sequence, default None
If passed, must match number of row arrays passed.

colnames
sequence, default None
If passed, must match number of column arrays passed.

aggfunc
function, optional
If specified, requires values be specified as well.

margins
bool, default False
Add row/column margins (subtotals).

margins_name
str, default ‘All’
Name of the row/column that will contain the totals when margins is True.

dropna
bool, default True
Do not include columns whose entries are all NaN.

normalize
bool, {‘all’, ‘index’, ‘columns’}, or {0,1}, default False
Normalize by dividing all values by the sum of values.

If passed ‘all’ or True, will normalize over all values.

If passed ‘index’ will normalize over each row.

If passed ‘columns’ will normalize over each column.

If margins is True, will also normalize margin values.

Returns:
DataFrame
Cross tabulation of the data.
44-2、参数

44-2-1、index(必须)用于交叉表的行索引的数组或序列,这通常是DataFrame中的一列或多列,用于确定交叉表的行。

44-2-2、columns(必须)用于交叉表的列索引的数组或序列,这同样是DataFrame中的一列或多列,用于确定交叉表的列。

44-2-3、values(可选,默认值为None)如果提供,它应该是DataFrame中的一列,其值将根据aggfunc参数指定的函数进行聚合,以填充交叉表的单元格;如果不提供,则默认计算每个组合中的观测数(即计数)。

44-2-4、rownames/colnames(可选,默认值为None)在较新版本的pandas中,这两个参数可能已被弃用或不再使用,它们原本用于为行和列索引提供自定义名称,但现在通常建议直接使用index和columns参数的列名作为行和列索引的名称。

44-2-5、aggfunc(可选,默认值为None)用于聚合values参数指定的值的函数,如果values为None,则默认为'count',即计算每个组合的观测数,其他函数有'sum'、'mean'、'max'、'min'等。

44-2-6、margins(可选,默认值为False)布尔值,如果为True,则会在交叉表的末尾添加一个全行/全列,包含所有值的聚合(基于aggfunc)。

44-2-7、margins_name(可选,默认值为'All')字符串,当margins=True时,用于命名全行/全列的标签。

44-2-8、dropna(可选,默认值为True)布尔值,如果为True,则会从结果中删除包含缺失值的行或列(取决于index和columns中的缺失值);如果为False,则包含缺失值的组合也会出现在交叉表中,但它们的值将取决于aggfunc和values的设置。

44-2-9、normalize(可选,默认值为False)布尔值或字符串('index'或'columns'),如果为True,则会对值进行归一化处理,使得每个行(或列,取决于归一化方式)的总和等于1;如果为'index',则对每行进行归一化;如果为'columns',则对每列进行归一化。

44-3、功能

        用于创建交叉表(也称为列联表或频数表)。

44-4、返回值

        返回值是一个新的DataFrame,该DataFrame展示了基于index和columns参数指定的行和列索引的交叉表。

44-5、说明

44-5-1、如果未指定values和aggfunc参数,则交叉表中的值默认为每个组合的观测数量。

44-5-2、如果指定了values和aggfunc参数,则交叉表中的值是根据aggfunc指定的聚合函数对values中的值进行聚合得到的结果。

44-5-3、如果margins参数为True,则返回的DataFrame还会包含一个额外的全行和/或全列(取决于margins的具体设置),用于显示所有行和/或列的总和。

44-5-4、如果normalize参数为True或'all',则交叉表中的值会被归一化,使得每行或每列(或整个交叉表)的总和等于 1;如果normalize为'index'或'columns',则分别对每行或每列进行归一化。

44-6、用法
44-6-1、数据准备
44-6-2、代码示例
# 44、pandas.crosstab函数
import pandas as pd
import numpy as np
# 创建一个示例数据集
data = {
    'Date': pd.date_range('2023-01-01', periods=6, freq='D'),
    'City': ['New York', 'Los Angeles', 'New York', 'Los Angeles', 'New York', 'Los Angeles'],
    'Category': ['A', 'A', 'B', 'B', 'A', 'B'],
    'Values': [100, 200, 150, 250, np.nan, 300]
}
df = pd.DataFrame(data)
print("原始数据集:")
print(df)
# 使用crosstab函数创建交叉表
crosstab_result = pd.crosstab(
    index=[df['Date'], df['City']],
    columns=df['Category'],
    values=df['Values'],
    rownames=['Date', 'City'],
    colnames=['Category'],
    aggfunc='sum',
    margins=True,
    margins_name='All',
    dropna=True,
    normalize=False
)
print("\ncrosstab结果:")
print(crosstab_result)
44-6-3、结果输出
# 44、pandas.crosstab函数
# 原始数据集:
#         Date         City Category  Values
# 0 2023-01-01     New York        A   100.0
# 1 2023-01-02  Los Angeles        A   200.0
# 2 2023-01-03     New York        B   150.0
# 3 2023-01-04  Los Angeles        B   250.0
# 4 2023-01-05     New York        A     NaN
# 5 2023-01-06  Los Angeles        B   300.0

# crosstab结果:
# Category                             A      B     All
# Date                City                             
# 2023-01-01 00:00:00 New York     100.0    NaN   100.0
# 2023-01-02 00:00:00 Los Angeles  200.0    NaN   200.0
# 2023-01-03 00:00:00 New York       NaN  150.0   150.0
# 2023-01-04 00:00:00 Los Angeles    NaN  250.0   250.0
# 2023-01-05 00:00:00 New York       0.0    NaN     NaN
# 2023-01-06 00:00:00 Los Angeles    NaN  300.0   300.0
# All                              300.0  700.0  1000.0
45、pandas.cut函数
45-1、语法
# 45、pandas.cut函数
pandas.cut(x, bins, right=True, labels=None, retbins=False, precision=3, include_lowest=False, duplicates='raise', ordered=True)
Bin values into discrete intervals.

Use cut when you need to segment and sort data values into bins. This function is also useful for going from a continuous variable to a categorical variable. For example, cut could convert ages to groups of age ranges. Supports binning into an equal number of bins, or a pre-specified array of bins.

Parameters:
x
array-like
The input array to be binned. Must be 1-dimensional.

bins
int, sequence of scalars, or IntervalIndex
The criteria to bin by.

int : Defines the number of equal-width bins in the range of x. The range of x is extended by .1% on each side to include the minimum and maximum values of x.

sequence of scalars : Defines the bin edges allowing for non-uniform width. No extension of the range of x is done.

IntervalIndex : Defines the exact bins to be used. Note that IntervalIndex for bins must be non-overlapping.

right
bool, default True
Indicates whether bins includes the rightmost edge or not. If right == True (the default), then the bins [1, 2, 3, 4] indicate (1,2], (2,3], (3,4]. This argument is ignored when bins is an IntervalIndex.

labels
array or False, default None
Specifies the labels for the returned bins. Must be the same length as the resulting bins. If False, returns only integer indicators of the bins. This affects the type of the output container (see below). This argument is ignored when bins is an IntervalIndex. If True, raises an error. When ordered=False, labels must be provided.

retbins
bool, default False
Whether to return the bins or not. Useful when bins is provided as a scalar.

precision
int, default 3
The precision at which to store and display the bins labels.

include_lowest
bool, default False
Whether the first interval should be left-inclusive or not.

duplicates
{default ‘raise’, ‘drop’}, optional
If bin edges are not unique, raise ValueError or drop non-uniques.

ordered
bool, default True
Whether the labels are ordered or not. Applies to returned types Categorical and Series (with Categorical dtype). If True, the resulting categorical will be ordered. If False, the resulting categorical will be unordered (labels must be provided).

Returns:
out
Categorical, Series, or ndarray
An array-like object representing the respective bin for each value of x. The type depends on the value of labels.

None (default) : returns a Series for Series x or a Categorical for all other inputs. The values stored within are Interval dtype.

sequence of scalars : returns a Series for Series x or a Categorical for all other inputs. The values stored within are whatever the type in the sequence is.

False : returns an ndarray of integers.

bins
numpy.ndarray or IntervalIndex.
The computed or specified bins. Only returned when retbins=True. For scalar or sequence bins, this is an ndarray with the computed bins. If set duplicates=drop, bins will drop non-unique bin. For an IntervalIndex bins, this is equal to bins.
45-2、参数

45-2-1、x(必须)输入的数组或序列,包含要分组的连续数据。

45-2-2、bins(必须)区间边界的数组或序列,如果bins是一个整数,函数会自动生成从x.min()到x.max()的等宽区间,区间数量为bins(注意,这会导致bins-1个区间);如果bins是一个序列,它将被解释为区间的边界,并定义每个区间的开放或闭合。

45-2-3、right(可选,默认值为True)布尔值,如果为True,则区间是右闭的(即每个区间包括右端点);如果为False,则区间是左闭的(即每个区间包括左端点)。

45-2-4、labels(可选,默认值为None)用于标记输出类别的数组或序列,如果给定,它必须与生成的区间数量相同;如果未提供,则使用默认标签,如[(0, 1], (1, 2], ...。

45-2-5、retbins(可选,默认值为False)布尔值,如果为True,则返回区间边界数组和分类数组。

45-2-6、precision(可选,默认值为3)整数,用于设置返回区间标签的浮点数精度。只有当bins是整数且labels未指定时,此参数才有效。

45-2-7、include_lowest(可选,默认值为False)布尔值,如果为True,则第一个区间将包括其左边界,这对于不均匀的bins或当bins的第一个值大于x的最小值时特别有用。

45-2-8、duplicates(可选,默认值为'raise'){'raise', 'drop'},如果bins包含重复值,则:

45-2-8-1、'raise':引发ValueError。
45-2-8-2、'drop':删除重复值,但仅保留第一个出现的值。

45-2-9、ordered(可选,默认值为True)布尔值,如果为True,则返回的Categorical对象是有序的,这对于后续的数据分析(如排序)很重要。

45-3、功能

        将连续的数值型数据按照指定的区间(或称为“桶”)进行分割,从而将连续的数值变量转换为离散的类别变量,这在数据分析和机器学习的特征工程中尤其有用,因为它可以帮助揭示不同区间内的数据分布特征,或者简化模型的输入。

45-4、返回值

45-4-1、当不设置retbins=True时,pandas.cut函数返回一个Categorical对象,该对象包含了输入数据 x 中每个值所属的区间标签,Categorical对象是一种特殊的pandas数据类型,用于表示固定数量的类别,且这些类别是有序的(如果ordered=True)。

45-4-2、当设置retbins=True时,pandas.cut函数除了返回上述的Categorical对象外,还会额外返回一个数组,该数组包含了用于划分区间的边界值,这允许用户同时获取区间标签和区间边界,便于后续的数据处理和分析。

45-5、说明

        无

45-6、用法
45-6-1、数据准备
45-6-2、代码示例
# 45、pandas.cut函数
import pandas as pd
# 创建一个示例数据集
data = {
    'Age': [22, 25, 45, 33, 50, 41, 23, 37, 29, 31, 35, 48, 52, 44, 27]
}
df = pd.DataFrame(data)
print("原始数据集:")
print(df)
# 定义区间
bins = [20, 30, 40, 50, 60]
# 使用cut函数将年龄分割成不同的区间
df['Age Group'] = pd.cut(
    x=df['Age'],
    bins=bins,
    right=True,
    labels=['20-30', '30-40', '40-50', '50-60'],
    retbins=False,
    precision=0,
    include_lowest=True,
    duplicates='raise',
    ordered=True
)
print("\n分割后的数据集:")
print(df)
45-6-3、结果输出 
# 45、pandas.cut函数
# 原始数据集:
#     Age
# 0    22
# 1    25
# 2    45
# 3    33
# 4    50
# 5    41
# 6    23
# 7    37
# 8    29
# 9    31
# 10   35
# 11   48
# 12   52
# 13   44
# 14   27

# 分割后的数据集:
#     Age Age Group
# 0    22     20-30
# 1    25     20-30
# 2    45     40-50
# 3    33     30-40
# 4    50     40-50
# 5    41     40-50
# 6    23     20-30
# 7    37     30-40
# 8    29     20-30
# 9    31     30-40
# 10   35     30-40
# 11   48     40-50
# 12   52     50-60
# 13   44     40-50
# 14   27     20-30
46、pandas.qcut函数
46-1、语法
# 46、pandas.qcut函数
pandas.qcut(x, q, labels=None, retbins=False, precision=3, duplicates='raise')
Quantile-based discretization function.

Discretize variable into equal-sized buckets based on rank or based on sample quantiles. For example 1000 values for 10 quantiles would produce a Categorical object indicating quantile membership for each data point.

Parameters:
x
1d ndarray or Series
q
int or list-like of float
Number of quantiles. 10 for deciles, 4 for quartiles, etc. Alternately array of quantiles, e.g. [0, .25, .5, .75, 1.] for quartiles.

labels
array or False, default None
Used as labels for the resulting bins. Must be of the same length as the resulting bins. If False, return only integer indicators of the bins. If True, raises an error.

retbins
bool, optional
Whether to return the (bins, labels) or not. Can be useful if bins is given as a scalar.

precision
int, optional
The precision at which to store and display the bins labels.

duplicates
{default ‘raise’, ‘drop’}, optional
If bin edges are not unique, raise ValueError or drop non-uniques.

Returns:
out
Categorical or Series or array of integers if labels is False
The return type (Categorical or Series) depends on the input: a Series of type category if input is a Series else Categorical. Bins are represented as categories when categorical data is returned.

bins
ndarray of floats
Returned only if retbins is True.

Notes

Out of bounds values will be NA in the resulting Categorical object
46-2、参数

46-2-1、x(必须)要分箱(或分桶)的一维数组或类似数组的对象。

46-2-2、q(必须)int或array-like of quantiles,如果是一个整数,它表示要分成的箱(或桶)的数量;如果是一个数组,则必须包含从0到1的浮点数,表示分位数。例如[0, 0.25, 0.5, 0.75, 1.]会将数据分成四个等宽的区间(或尽量等宽)。

46-2-3、labels(可选,默认值为None)用于指定每个箱(或桶)的标签,如果为None(默认值),则会自动生成标签(通常是基于整数索引的);如果为False,则不返回标签;如果提供了数组,其长度必须与生成的箱数相同。

46-2-4、retbins(可选,默认值为False)如果为True,则返回用于分箱的边界数组(即每个箱的最小值和下一个箱的最小值之间的值,除了最后一个箱,其边界是无穷大)。

46-2-5、precision(可选,默认值为3)控制内部计算的精度,更高的精度可以减少由浮点数舍入引起的误差,但可能会增加计算时间。

46-2-6、duplicates(可选,默认值为'raise')如果q参数中有重复的分位数,并且duplicates='raise'(默认值),则会抛出错误;如果duplicates='drop',则忽略重复的分位数。

46-3、功能

        用于将连续数据根据分位数划分成等频(或近似等频)区间的重要工具,其功能和返回值可以归纳如下:

46-3-1、等频分箱:pandas.qcut函数基于数据的分位数进行分箱,确保每个箱(或桶)中的样本数量大致相等(在可能的情况下),这对于需要平衡各个类别中样本数量的场景特别有用。

46-3-2、自定义分位数:除了将数据等频分箱外,用户还可以通过指定q参数中的分位数数组来自定义分箱方式,从而实现更精细的数据划分。

46-3-3、数据离散化:在数据预处理和特征工程中,pandas.qcut函数常用于将连续变量离散化,以便进行后续的分析、建模或可视化。

46-4、返回值

46-4-1、如果retbins=False(默认值),则返回两个对象:

46-4-1-1、bins:一个与x形状相同的分类数组(Categorical dtype),表示每个元素所属的箱(或桶)。

46-4-1-2、labels(如果指定了)一个数组,包含每个箱(或桶)的标签。

46-4-2、如果retbins=True,则返回三个对象:

46-4-2-1、bins :x形状相同的分类数组。

46-4-2-2、labels(如果指定了)一个数组,包含每个箱(或桶)的标签。

46-4-2-3、bin_edges:一个数组,表示箱(或桶)的边界。

46-5、说明

        无

46-6、用法
46-6-1、数据准备
46-6-2、代码示例
# 46、pandas.qcut函数
import pandas as pd
# 创建一个示例数据集
data = {
    'Age': [22, 25, 45, 33, 50, 41, 23, 37, 29, 31, 35, 48, 52, 44, 27]
}
df = pd.DataFrame(data)
print("原始数据集:")
print(df)
# 使用qcut函数将年龄按分位数分割成四个区间
df['Age Group'] = pd.qcut(
    x=df['Age'],
    q=4,
    labels=['Q1', 'Q2', 'Q3', 'Q4'],
    retbins=False,
    precision=3,
    duplicates='raise'
)
print("\n按分位数分割后的数据集:")
print(df)
46-6-3、结果输出
# 46、pandas.qcut函数
# 原始数据集:
#     Age
# 0    22
# 1    25
# 2    45
# 3    33
# 4    50
# 5    41
# 6    23
# 7    37
# 8    29
# 9    31
# 10   35
# 11   48
# 12   52
# 13   44
# 14   27

# 按分位数分割后的数据集:
#     Age Age Group
# 0    22        Q1
# 1    25        Q1
# 2    45        Q4
# 3    33        Q2
# 4    50        Q4
# 5    41        Q3
# 6    23        Q1
# 7    37        Q3
# 8    29        Q2
# 9    31        Q2
# 10   35        Q2
# 11   48        Q4
# 12   52        Q4
# 13   44        Q3
# 14   27        Q1

二、推荐阅读

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

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

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

相关文章

开启新纪元!被AI驱动的游戏世界,提升游戏体验

随着人工智能的高速发展,人工智能逐渐应用到了生活中的方方面面,人工智能在游戏中也有诸多应用,在游戏里领域扮演了相当重要的角色。游戏AI是伴随着电子游戏而出现的,在早期的游戏中就出现了对抗类AI角色,后来逐渐出现…

服务器数据恢复—开盘修复raid5阵列硬盘故障的数据恢复案例

服务器存储数据恢复环境: 某品牌P2000存储,存储中有一组由8块硬盘(包含一块热备盘)组建的raid5阵列。上层部署VMWARE ESX虚拟化平台。 服务器存储故障: 存储在运行过程中有两块硬盘指示灯亮黄色。经过运维人员的初步检…

Sentinel 学习笔记

Sentinel 学习笔记 作者:王珂 邮箱:49186456qq.com 文章目录 Sentinel 学习笔记[TOC] 前言一、基础概念二、Sentinel控制台2.1 安装控制台2.2 簇点链路2.3 请求限流2.4 线程隔离2.5 服务降级2.6 服务熔断 三、Sentinel客户端3.1 原始Jar包客户端3.2 Sp…

【Windows】XMedia Recode(免费的专业视频格式转换软件)及同类型软件介绍

今天给大家介绍的这款软件叫XMedia Recode,这是一款免费的专业视频格式转换软件。有需要的朋友可以了解一下哦。 软件介绍 XMedia Recode 是一款功能强大的免费视频转换和音频转换软件,它支持多种格式的视频和音频文件转换,以及简单的编辑…

收银系统源码-商品套餐功能视频介绍

千呼新零售2.0系统是零售行业连锁店一体化收银系统,包括线下收银线上商城连锁店管理ERP管理商品管理供应商管理会员营销等功能为一体,线上线下数据全部打通。 适用于商超、便利店、水果、生鲜、母婴、服装、零食、百货、宠物等连锁店使用。 详细介绍请…

PMP–计算--图示

文章目录 概念基准绩效预测 公式 概念 基准绩效 最常见的基准是成本和进度。跟踪范围或技术基准的项目可以使用可交付物测量指标中的信息。 大多数进度测量指标会根据以下相关的计划绩效来跟踪实际绩效: ▶ 开始日期和完成日期。将实际开始日期与计划开始日期进行…

MD4C 销售订单查询库存/需求清单 函数

MD4C 销售订单查询库存/需求清单 函数 目录 函数 MD_SALES_ORDER_STATUS_REPORT 函数MD_SALES_ORDER_STATUS_REPORT 结果 T-CODE: MD4C

Zynq系列FPGA实现SDI相机编码输出,基于GTX高速接口,提供6套工程源码和技术支持

目录 1、前言工程概述免责声明 2、相关方案推荐本博已有的 SDI 编解码方案本方案在Xilinx-Kintex7上的应用 3、详细设计方案设计原理框图输入Sensor之-->OV5640摄像头输入Sensor之-->HDMIHLS图像缩放详解VDMA图像缓存SDI视频输出架构之-->RGB转BT1120SDI视频输出架构之…

【CANoe使用】常用基础功能

CANoe使用 CANoe基础功能使用1. CANoe工程配置基础1.1 新建工程和通道配置1.2 添加DBC文件1.3 CANoe工程的保存和打开 2. 分析窗口使用2.1 Trace2.1.1 Trace窗口工具栏常用功能2.1.2 Trace数据的导入导出 2.2 Graphics2.2.1 添加分析信号2.2.2 Graphics工具栏功能 2.3 State Tr…

自定义json序列化和反序列化

一、LocalDateTime反序列化异常 首先我们定义一个java POJO实体类,其中关键的成员变量时birthDate,我们没有采用Date数据类型,而是采用了Java8 新的日期类型LocalDateTime,使用LocalDateTime的好处我就不多说了,有很多的文章解释说明。我们把…

技术成神之路:设计模式(五)抽象工厂模式

1.介绍 抽象工厂模式(Abstract Factory Pattern)是一种创建型设计模式,它提供了一种创建一系列相关或相互依赖对象的接口,而无需指定其具体类。这种模式属于工厂模式的一种扩展,它通过引入抽象层来实现工厂方法的组合&…

vue3 - vue项目自动检测更新

GitHub Demo 地址 在线预览 web项目当页面检测到需要更新,然后弹框提示是否更新(刷新页面)这种可以通过纯前端实现也可以通过接口实现 接口实现:通过调用接口轮询和本地的版本号比较,检查是否需要弹框提示更新纯前端实…

RAFT RAG GraphRAG

解读人类语言真实意图是一门不完美的学问。相关搜索是一个认知迷宫,即使是最先进的 AI 也无法(完全)解决! # RAG Retrieval-Augmented Generation # Retrieval Augmented FineTuning(RAFT) RAFT的核心思想是结合监督式微调&#…

云WAF | 云waf保护你的网络安全

随着时代的发展,云计算与网络安全成为当今社会的热点问题。由于网络环境的日益复杂,网络安全问题日益突出,网络安全问题日益突出。近年来,各类网络安全工具与技术层出不穷,以保障用户信息及企业财产安全。云服务防火墙…

机器学习——决策树(笔记)

目录 一、认识决策树 1. 介绍 2. 决策树生成过程 二、sklearn中的决策树 1. tree.DecisionTreeClassifier(分类树) (1)模型基本参数 (2)模型属性 (3)接口 2. tree.Decision…

289个地级市-资源型城市划分数据

资源型城市:经济地理的独特现象与可持续发展的挑战 资源型城市是指那些以丰富的自然资源为基础,对国家经济和工业化进程有着重要影响的城市。这些城市在国家现代化建设中扮演着关键角色,其发展状况直接关系到区域经济的繁荣与社会的稳定。 资…

Go-知识测试-模糊测试

Go-知识测试-模糊测试 1. 定义2. 例子3. 数据结构4. tesing.F.Add5. 模糊测试的执行6. testing.InternalFuzzTarget7. testing.runFuzzing8. testing.fRunner9. FuzzXyz10. RunFuzzWorker11. CoordinateFuzzing12. 总结 建议先看:https://blog.csdn.net/a1879272183…

GitHub连接超时问题 Recv failure: Connection was reset

用手机热点WIF拉取git项目的时候,遇到Recv failure: Connection was reset问题。 解决办法 一、手动开启本地代理 二、在终端(cmd)输入命令 git config --global http.proxy http://127.0.0.1:7890 git config --global https.proxy https:…

QT实现自定义带有提示信息的透明环形进度条

1. 概述 做界面开发的童鞋可能都会遇到这样的需求,就是有一些界面点击了之后比较耗时的操作,需要界面给出一个环形进度条的进度反馈信息. 如何来实现这样的需求呢,话不多说,上效果 透明进度条 2. 代码实现 waitfeedbackprogressba…

2006-2021年 291个地级市资源错配指数、劳动和资本相对扭曲指数do文件和结果

资源错配指数:衡量生产要素配置效率的关键指标 资源错配指数(Misallocation Index)是一个衡量资源配置效率的指标,它反映了生产要素是否得到了合理配置,以及是否达到了生产效率的最优状态。一个较高的资源错配指数意味…