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

目录

一、用法精讲

10、pandas.DataFrame.to_excel函数

10-1、语法

10-2、参数

10-3、功能

10-4、返回值

10-5、说明

10-6、用法

10-6-1、数据准备

10-6-2、代码示例

10-6-3、结果输出

11、pandas.ExcelFile类

11-1、语法

11-2、参数

11-3、功能

11-4、返回值

11-5、说明

11-5-1、文件访问

11-5-2、工作表操作

11-5-3、高级操作

11-6、用法

11-6-1、数据准备

11-6-2、代码示例

11-6-3、结果输出 

12、pandas.ExcelFile.parse函数

12-1、语法

12-2、参数

12-3、功能

12-4、返回值

12-4-1、单个工作表

12-4-2、多个工作表

12-4-3、所有工作表

12-5、说明

12-6、用法

12-6-1、数据准备

12-6-2、代码示例

12-6-3、结果输出 

二、推荐阅读

1、Python筑基之旅

2、Python函数之旅

3、Python算法之旅

4、Python魔法之旅

5、博客个人主页

一、用法精讲

10、pandas.DataFrame.to_excel函数
10-1、语法
# 10、pandas.DataFrame.to_excel函数
DataFrame.to_excel(excel_writer, *, sheet_name='Sheet1', na_rep='', float_format=None, columns=None, header=True, index=True, index_label=None, startrow=0, startcol=0, engine=None, merge_cells=True, inf_rep='inf', freeze_panes=None, storage_options=None, engine_kwargs=None)
Write object to an Excel sheet.

To write a single object to an Excel .xlsx file it is only necessary to specify a target file name. To write to multiple sheets it is necessary to create an ExcelWriter object with a target file name, and specify a sheet in the file to write to.

Multiple sheets may be written to by specifying unique sheet_name. With all data written to the file it is necessary to save the changes. Note that creating an ExcelWriter object with a file name that already exists will result in the contents of the existing file being erased.

Parameters:
excel_writerpath-like, file-like, or ExcelWriter object
File path or existing ExcelWriter.

sheet_namestr, default ‘Sheet1’
Name of sheet which will contain DataFrame.

na_repstr, default ‘’
Missing data representation.

float_formatstr, optional
Format string for floating point numbers. For example float_format="%.2f" will format 0.1234 to 0.12.

columnssequence or list of str, optional
Columns to write.

headerbool or list of str, default True
Write out the column names. If a list of string is given it is assumed to be aliases for the column names.

indexbool, default True
Write row names (index).

index_labelstr or sequence, optional
Column label for index column(s) if desired. If not specified, and header and index are True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex.

startrowint, default 0
Upper left cell row to dump data frame.

startcolint, default 0
Upper left cell column to dump data frame.

enginestr, optional
Write engine to use, ‘openpyxl’ or ‘xlsxwriter’. You can also set this via the options io.excel.xlsx.writer or io.excel.xlsm.writer.

merge_cellsbool, default True
Write MultiIndex and Hierarchical Rows as merged cells.

inf_repstr, default ‘inf’
Representation for infinity (there is no native representation for infinity in Excel).

freeze_panestuple of int (length 2), optional
Specifies the one-based bottommost row and rightmost column that is to be frozen.

storage_optionsdict, optional
Extra options that make sense for a particular storage connection, e.g. host, port, username, password, etc. For HTTP(S) URLs the key-value pairs are forwarded to urllib.request.Request as header options. For other URLs (e.g. starting with “s3://”, and “gcs://”) the key-value pairs are forwarded to fsspec.open. Please see fsspec and urllib for more details, and for more examples on storage options refer here.

New in version 1.2.0.

engine_kwargsdict, optional
Arbitrary keyword arguments passed to excel engine.
10-2、参数

10-2-1、excel_writer(必须)字符串、ExcelWriter对象或路径对象,可以是文件名(字符串或路径对象)或ExcelWriter对象。如果是文件名,则文件将被打开并以写入模式('w')打开,如果文件已存在则会被覆盖;如果传入的是ExcelWriter对象,则使用该对象来写入文件。

10-2-2、sheet_name(可选,默认值为'Sheet1')字符串,指定要写入的Excel工作表的名称。

10-2-3、na_rep(可选,默认值为'')字符串,用于替换DataFrame中缺失值(NaN)的字符串。

10-2-4、float_format(可选,默认值为None)字符串,用于格式化浮点数的格式字符串,例如 '%.2f' 会将浮点数格式化为带有两位小数的字符串。

10-2-5、columns(可选,默认值为None)序列,要写入文件的列名列表。如果为None(默认值),则写入所有列。

10-2-6、header(可选,默认值为True)布尔值或序列,如果为False,则不写入列名(即不写入DataFrame的header);如果是一个序列,则假定它是列名的别名列表。

10-2-7、index(可选,默认值为True)布尔值,如果为True,则写入行索引(即DataFrame的 index)作为一列;如果为False,则不写入行索引。

10-2-8、index_label(可选,默认值为None)字符串或序列,如果指定了索引,并且header和index都为True,则这些值将被用作索引列的列标题;如果未指定,则使用索引的名称(如果有的话)。

10-2-9、startrow/startcol(可选,默认值为0)整数,指定从哪个行和列开始写入数据(以0为索引),这对于在现有工作表中追加数据很有用。

10-2-10、engine(可选,默认值为None)字符串,指定用于写入Excel文件的引擎。pandas 支持多种引擎,如'xlsxwriter'、'openpyxl'和'xlwt'(仅用于较旧的.xls格式)。如果未指定,则pandas会尝试根据文件扩展名选择适当的引擎。

10-2-11、merge_cells(可选,默认值为True)布尔值,如果为True,则合并Excel文件中相同数据的单元格(例如,如果DataFrame中的某些列包含完全相同的值)。

10-2-12、inf_rep(可选,默认值为'inf')字符串,用于替换DataFrame中无限大值(inf)的字符串。

10-2-13、freeze_panes(可选,默认值为None)元组,指定要冻结的窗格的位置。元组应该包含两个整数,分别表示要冻结的行数和列数(从0开始计数),这对于创建具有固定标题行或列的大型Excel文件很有用。

10-2-14、storage_options(可选,默认值为None)字典,用于传递给底层文件存储接口的额外参数,这可以用于设置例如访问令牌、临时存储路径等。

10-2-15、engine_kwargs(可选,默认值为None)一个字典,包含传递给ExcelWriter引擎的额外关键字参数,这可以用于定制引擎的行为,例如设置工作簿的属性。

10-3、功能

        用于将DataFrame数据保存为Excel文件。

10-4、返回值

        没有直接的返回值。它的主要作用是将DataFrame中的数据写入到指定的Excel文件中,而不是返回一个结果或对象。

10-5、说明

        无

10-6、用法
10-6-1、数据准备
10-6-2、代码示例
# 10、pandas.DataFrame.to_excel函数
import pandas as pd
# 创建一个示例DataFrame
data = {'Name': ['Myelsa', 'Bryce', 'Jimmy'], 'Age': [25, 30, 35], 'Salary': [50000, 60000, 70000]}
df = pd.DataFrame(data)
# 将DataFrame保存为Excel文件
df.to_excel('example.xlsx', sheet_name='sheet', index=False)
10-6-3、结果输出

11、pandas.ExcelFile
11-1、语法
# 11、pandas.ExcelFile类
class pandas.ExcelFile(path_or_buffer, engine=None, storage_options=None, engine_kwargs=None)
Class for parsing tabular Excel sheets into DataFrame objects.

See read_excel for more documentation.

Parameters:
path_or_bufferstr, bytes, path object (pathlib.Path or py._path.local.LocalPath),
A file-like object, xlrd workbook or openpyxl workbook. If a string or path object, expected to be a path to a .xls, .xlsx, .xlsb, .xlsm, .odf, .ods, or .odt file.

enginestr, default None
If io is not a buffer or path, this must be set to identify io. Supported engines: xlrd, openpyxl, odf, pyxlsb, calamine Engine compatibility :

xlrd supports old-style Excel files (.xls).

openpyxl supports newer Excel file formats.

odf supports OpenDocument file formats (.odf, .ods, .odt).

pyxlsb supports Binary Excel files.

calamine supports Excel (.xls, .xlsx, .xlsm, .xlsb) and OpenDocument (.ods) file formats.

Changed in version 1.2.0: The engine xlrd now only supports old-style .xls files. When engine=None, the following logic will be used to determine the engine:

If path_or_buffer is an OpenDocument format (.odf, .ods, .odt), then odf will be used.

Otherwise if path_or_buffer is an xls format, xlrd will be used.

Otherwise if path_or_buffer is in xlsb format, pyxlsb will be used.

New in version 1.3.0.

Otherwise if openpyxl is installed, then openpyxl will be used.

Otherwise if xlrd >= 2.0 is installed, a ValueError will be raised.

Warning

Please do not report issues when using xlrd to read .xlsx files. This is not supported, switch to using openpyxl instead.

engine_kwargsdict, optional
Arbitrary keyword arguments passed to excel engine.
11-2、参数

11-2-1、path_or_buffer(可选,默认值为None)指定要写入的文件路径(字符串或路径对象)或任何文件状对象。如果为None,则输出将作为字符串返回,而不是写入文件。

11-2-2、engine(可选,默认值为None)字符串,用于解析Excel文件的引擎。常用的有openpyxl(对于.xlsx文件)和xlrd(对于较旧的.xls文件)。注意,xlrd从版本2.0.0开始不再支持.xlsx文件。

11-2-3、storage_options(可选,默认值为None)字典,对于支持的文件类型(如AWS S3、Google Cloud Storage),可以传递额外的存储选项。

11-2-4、engine_kwargs(可选,默认值为None)字典,传递给Excel读取引擎的额外关键字参数。

11-3、功能

        作为一个接口,用于读取存储在Excel文件中的数据。通过创建 ExcelFile 类的实例,用户可以方便地访问Excel文件中的不同工作表(sheets),并将这些数据加载到Pandas的DataFrame对象中,以便进行进一步的数据分析和处理。

11-4、返回值

        严格来说,pandas.ExcelFile类本身并不直接返回数据,而是创建了一个表示Excel文件的对象,这个对象提供了方法来读取文件中的数据,并将数据加载到DataFrame对象中。然而,如果我们从功能实现的角度来考虑,可以认为ExcelFile类“返回”了一个用于操作Excel文件的接口或上下文。

11-5、说明

        具体来说,ExcelFile类提供了以下功能:

11-5-1、文件访问

        它封装了对Excel文件的访问,使得用户可以通过一个统一的接口来读取文件中的数据。

11-5-2、工作表操作

        它允许用户选择性地读取文件中的一个或多个工作表,而无需将整个文件加载到内存中。

11-5-3、高级操作

        虽然ExcelFile类本身主要用于读取数据,但它提供的接口可以与Pandas的其他功能结合使用,以实现更复杂的数据处理和分析任务。

11-6、用法
11-6-1、数据准备

11-6-2、代码示例
# 11、pandas.ExcelFile类
import pandas as pd
# 创建一个ExcelFile对象
xls = pd.ExcelFile('Pandas_read_excel数据.xlsx', engine='openpyxl')
# 通过ExcelFile对象读取工作表
df1 = pd.read_excel(xls, sheet_name='生产日报')
df2 = pd.read_excel(xls, sheet_name='Sheet2')
print(df1)
print()
print(df2)

# 重要属性:pandas.ExcelFile.sheet_names
import pandas as pd
# 创建一个ExcelFile对象
xls = pd.ExcelFile('Pandas_read_excel数据.xlsx')
# 获取所有工作表的名称
sheet_names = xls.sheet_names
# 打印工作表名称
print(sheet_names)
# 假设你想要读取名为 'Sheet2' 的工作表
df = pd.read_excel(xls, sheet_name='Sheet2')  # 注意这里我们直接将ExcelFile对象传递给 pd.read_excel()
# 或者,如果你已经通过ExcelFile对象获取了DataFrame,你可以这样做:
# df = xls.parse('Sheet1')
# 打印DataFrame的前几行来验证数据
print(df.head())
11-6-3、结果输出 
# 11、pandas.ExcelFile类
#          生产日期 班别  机台 设备品牌       设备型号  ... 生产周期(s)  单重(g)  包装规格 当班产量(pc) 当日库存(pc)
# 0  2024-07-04  A   1  YZM   UN160SM2  ...    38.0  23.40   506     3236    12148
# 1  2024-07-04  A   3  YZM   UN160SM2  ...    38.6  15.80   612     2448   120000
# 2  2024-07-04  A   5  YZM     UN160A  ...    30.1   2.85  2500     4800     2205
# 3  2024-07-04  A   7  NaN     UN120A  ...    28.6   2.40  3500     8500    31244
# 4  2024-07-04  A   8   ZD    EM150-V  ...    33.0   4.60  3000     2800      417
# 5  2024-07-04  A   8   ZD    EM150-V  ...    33.0   4.60  3000     3000      312
# 6  2024-07-04  A  12   HT     HA2600  ...    23.2   8.80  1000    14500   143100
# 7  2024-07-04  A  13   HH    HM260M3  ...    44.7  18.50   600     3000    38526
# 8  2024-07-04  A  14   HH  DL260-llS  ...    43.5  68.20    85     2516     4964
# 9  2024-07-04  B   1  YZM   UN160SM2  ...    38.0  23.40   506     1518    12148
# 10 2024-07-04  B   2  YZM   UN160SM2  ...    34.6  10.40   896     3984    85236
# 11 2024-07-04  B   5  YZM     UN160A  ...    30.1   2.85  2500     6200     2205
# 12 2024-07-04  B   7  YZM     UN120A  ...    28.6   2.40  3500     8500    31244
# 13 2024-07-04  B   8   ZD    EM150-V  ...    33.0   4.60  3000     5800      263
# 14 2024-07-04  B  12   HT     HA2600  ...    23.2   8.80  1000    14800   143100
# 15 2024-07-04  B  13   HH    HM260M3  ...    44.7  18.50   600     2448    38526
# 16 2024-07-04  B  14   HH  DL260-llS  ...    43.5  68.20    85     1518     4964
# 
# [17 rows x 16 columns]
# 
#          生产日期 班别  机台 设备品牌       设备型号  ... 生产周期(s)  单重(g)  包装规格 当班产量(pc) 当日库存(pc)
# 0  2024-07-04  A   1  YZM   UN160SM2  ...    38.0  23.40   506     3236    12148
# 1  2024-07-04  A   3  YZM   UN160SM2  ...    38.6  15.80   612     2448   120000
# 2  2024-07-04  A   5  YZM     UN160A  ...    30.1   2.85  2500     4800     2205
# 3  2024-07-04  A   7  NaN     UN120A  ...    28.6   2.40  3500     8500    31244
# 4  2024-07-04  A   8   ZD    EM150-V  ...    33.0   4.60  3000     2800      417
# 5  2024-07-04  A   8   ZD    EM150-V  ...    33.0   4.60  3000     3000      312
# 6  2024-07-04  A  12   HT     HA2600  ...    23.2   8.80  1000    14500   143100
# 7  2024-07-04  A  13   HH    HM260M3  ...    44.7  18.50   600     3000    38526
# 8  2024-07-04  A  14   HH  DL260-llS  ...    43.5  68.20    85     2516     4964
# 9  2024-07-04  B   1  YZM   UN160SM2  ...    38.0  23.40   506     1518    12148
# 10 2024-07-04  B   2  YZM   UN160SM2  ...    34.6  10.40   896     3984    85236
# 11 2024-07-04  B   5  YZM     UN160A  ...    30.1   2.85  2500     6200     2205
# 12 2024-07-04  B   7  YZM     UN120A  ...    28.6   2.40  3500     8500    31244
# 13 2024-07-04  B   8   ZD    EM150-V  ...    33.0   4.60  3000     5800      263
# 14 2024-07-04  B  12   HT     HA2600  ...    23.2   8.80  1000    14800   143100
# 15 2024-07-04  B  13   HH    HM260M3  ...    44.7  18.50   600     2448    38526
# 16 2024-07-04  B  14   HH  DL260-llS  ...    43.5  68.20    85     1518     4964
# 
# [17 rows x 16 columns]

# 重要属性:pandas.ExcelFile.sheet_names
# ['生产日报', 'Sheet2']
#         生产日期 班别  机台 设备品牌      设备型号  ... 生产周期(s)  单重(g)  包装规格 当班产量(pc) 当日库存(pc)
# 0 2024-07-04  A   1  YZM  UN160SM2  ...    38.0  23.40   506     3236    12148
# 1 2024-07-04  A   3  YZM  UN160SM2  ...    38.6  15.80   612     2448   120000
# 2 2024-07-04  A   5  YZM    UN160A  ...    30.1   2.85  2500     4800     2205
# 3 2024-07-04  A   7  NaN    UN120A  ...    28.6   2.40  3500     8500    31244
# 4 2024-07-04  A   8   ZD   EM150-V  ...    33.0   4.60  3000     2800      417
# 
# [5 rows x 16 columns]
12、pandas.ExcelFile.parse函数
12-1、语法
# 12、pandas.ExcelFile.parse函数
ExcelFile.parse(sheet_name=0, header=0, names=None, index_col=None, usecols=None, converters=None, true_values=None, false_values=None, skiprows=None, nrows=None, na_values=None, parse_dates=False, date_parser=_NoDefault.no_default, date_format=None, thousands=None, comment=None, skipfooter=0, dtype_backend=_NoDefault.no_default, **kwds)
Parse specified sheet(s) into a DataFrame.

Equivalent to read_excel(ExcelFile, …) See the read_excel docstring for more info on accepted parameters.

Returns:
DataFrame or dict of DataFrames
DataFrame from the passed in Excel file.
12-2、参数

12-2-1、sheet_name(可选,默认值为0)指定要解析的工作表的名称、索引或工作表对象,如果是整数,则表示按索引顺序选择工作表(从0开始);如果是字符串,则表示按名称选择工作表;如果是列表,则表示解析列表中指定名称或索引的所有工作表,返回一个字典,键为工作表名,值为对应的DataFrame;如果为None,则返回第一个工作表。

12-2-2、header(可选,默认值为0)指定用作列名的行,如果文件不包含列标题,则应该设置为None并使用names参数。默认为0,即第一行作为列标题。

12-2-3、names(可选,默认值为None)用于结果的列名的列表,如果文件不包含列标题行,则需要提供此参数。

12-2-4、index_col(可选,默认值为None)用作行索引的列编号或列名,可以是整数、列名字符串或列名的列表。如果为None(默认),则使用从0开始的整数索引。

12-2-5、usecols(可选,默认值为None)返回一个子集的列。默认情况下,解析所有列;如果为整数列表,则返回这些位置的列;如果为字符串列表,则返回这些名称的列。

12-2-6、converters(可选,默认值为None)列的转换器字典。键可以是列名或列的索引(从0开始)。

12-2-7、true_values/false_values(可选,默认值为None)用于将字符串值转换为布尔值的序列。

12-2-8、skiprows(可选,默认值为None)需要跳过的行号列表(从0开始),或跳过文件开头的行数。

12-2-9、nrows(可选,默认值为None)需要读取的行数(从文件开始算起)。

12-2-10、na_values(可选,默认值为None)附加识别为NA/missing的字符串列表。

12-2-11、parse_dates(可选,默认值为False)尝试将数据解析为日期。

12-2-12、date_parser(可选)用于解析日期的函数。

12-2-13、date_format(可选,默认值为None)字符串或字符串列表,用于指定日期/时间的格式。

12-2-14、thousands(可选,默认值为None)千位分隔符。

12-2-15、comment(可选,默认值为None)标识注释字符的开始,行中该字符之后的部分将被忽略。如果为None(默认值),则不忽略任何行。

12-2-16、skipfooter(可选,默认值为0)从文件末尾跳过的行数(不支持迭代或分块读取)。

12-2-17、dtype_backend(可选)指定用于处理数据类型的后端,这通常不需要用户直接设置,因为pandas会根据文件内容和提供的其他参数自动选择适当的后端。

12-2-18、**kwds(可选)接受一些额外的关键字参数,这些参数将直接传递给底层的Excel读取器(如openpyxl、xlrd等,具体取决于文件类型和安装的库),这些额外的关键字参数允许用户进行更细粒度的控制,比如设置读取器的特定选项。

12-3、功能

        用于从ExcelFile对象中读取特定工作表(sheet)内容的方法。

12-4、返回值

ExcelFile.parse()函数的返回值取决于传递给它的sheet_name参数:

12-4-1、单个工作表

        如果sheet_name是一个字符串或整数,表示要读取的工作表的名称或索引,则函数返回一个DataFrame对象,该对象包含了指定工作表中的数据。

12-4-2、多个工作表

        如果sheet_name是一个整数列表或字符串列表,表示要读取的多个工作表的名称或索引,则函数返回一个字典(Dict of DataFrames),其中键是工作表的名称,值是对应的数据框(DataFrame)。

12-4-3、所有工作表

        如果sheet_name被设置为None,则函数会读取Excel文件中的所有工作表,并返回一个字典(Dict of DataFrames),其中包含了所有工作表的数据。

12-5、说明

        无

12-6、用法
12-6-1、数据准备

12-6-2、代码示例
# 12、pandas.ExcelFile.parse函数
# 12-1、读取Excel文件中的数据
import pandas as pd
# 假设Pandas_read_excel数据.xlsx文件与你的Python脚本位于同一目录下
file_path = 'Pandas_read_excel数据.xlsx'
# 使用 ExcelFile 类打开 Excel 文件
with pd.ExcelFile(file_path) as xls:
    # 使用parse()方法读取名为"Sheet2"的工作表
    # 这里我们没有指定太多额外的参数,因为假设Excel文件格式相对简单
    df = xls.parse(sheet_name='Sheet2')
# 显示读取到的 DataFrame
print(df)

# 12-2、如果你的Excel文件包含多个工作表,并且你想要读取所有工作表到一个字典中,其中键是工作表名,值是对应的DataFrame
import pandas as pd
file_path = 'Pandas_read_excel数据.xlsx'
# 使用ExcelFile类打开Excel文件
with pd.ExcelFile(file_path) as xls:
    # 读取所有工作表到一个字典中
    sheet_name_to_df_map = {sheet_name: xls.parse(sheet_name) for sheet_name in xls.sheet_names}
# 显示指定工作表的数据
print(sheet_name_to_df_map['Sheet2'])
12-6-3、结果输出 
# 12-1、读取Excel文件中的数据
#          生产日期 班别  机台 设备品牌       设备型号  ... 生产周期(s)  单重(g)  包装规格 当班产量(pc) 当日库存(pc)
# 0  2024-07-04  A   1  YZM   UN160SM2  ...    38.0  23.40   506     3236    12148
# 1  2024-07-04  A   3  YZM   UN160SM2  ...    38.6  15.80   612     2448   120000
# 2  2024-07-04  A   5  YZM     UN160A  ...    30.1   2.85  2500     4800     2205
# 3  2024-07-04  A   7  NaN     UN120A  ...    28.6   2.40  3500     8500    31244
# 4  2024-07-04  A   8   ZD    EM150-V  ...    33.0   4.60  3000     2800      417
# 5  2024-07-04  A   8   ZD    EM150-V  ...    33.0   4.60  3000     3000      312
# 6  2024-07-04  A  12   HT     HA2600  ...    23.2   8.80  1000    14500   143100
# 7  2024-07-04  A  13   HH    HM260M3  ...    44.7  18.50   600     3000    38526
# 8  2024-07-04  A  14   HH  DL260-llS  ...    43.5  68.20    85     2516     4964
# 9  2024-07-04  B   1  YZM   UN160SM2  ...    38.0  23.40   506     1518    12148
# 10 2024-07-04  B   2  YZM   UN160SM2  ...    34.6  10.40   896     3984    85236
# 11 2024-07-04  B   5  YZM     UN160A  ...    30.1   2.85  2500     6200     2205
# 12 2024-07-04  B   7  YZM     UN120A  ...    28.6   2.40  3500     8500    31244
# 13 2024-07-04  B   8   ZD    EM150-V  ...    33.0   4.60  3000     5800      263
# 14 2024-07-04  B  12   HT     HA2600  ...    23.2   8.80  1000    14800   143100
# 15 2024-07-04  B  13   HH    HM260M3  ...    44.7  18.50   600     2448    38526
# 16 2024-07-04  B  14   HH  DL260-llS  ...    43.5  68.20    85     1518     4964
# 
# [17 rows x 16 columns]

# 12-2、如果你的Excel文件包含多个工作表,并且你想要读取所有工作表到一个字典中,其中键是工作表名,值是对应的DataFrame
#          生产日期 班别  机台 设备品牌       设备型号  ... 生产周期(s)  单重(g)  包装规格 当班产量(pc) 当日库存(pc)
# 0  2024-07-04  A   1  YZM   UN160SM2  ...    38.0  23.40   506     3236    12148
# 1  2024-07-04  A   3  YZM   UN160SM2  ...    38.6  15.80   612     2448   120000
# 2  2024-07-04  A   5  YZM     UN160A  ...    30.1   2.85  2500     4800     2205
# 3  2024-07-04  A   7  NaN     UN120A  ...    28.6   2.40  3500     8500    31244
# 4  2024-07-04  A   8   ZD    EM150-V  ...    33.0   4.60  3000     2800      417
# 5  2024-07-04  A   8   ZD    EM150-V  ...    33.0   4.60  3000     3000      312
# 6  2024-07-04  A  12   HT     HA2600  ...    23.2   8.80  1000    14500   143100
# 7  2024-07-04  A  13   HH    HM260M3  ...    44.7  18.50   600     3000    38526
# 8  2024-07-04  A  14   HH  DL260-llS  ...    43.5  68.20    85     2516     4964
# 9  2024-07-04  B   1  YZM   UN160SM2  ...    38.0  23.40   506     1518    12148
# 10 2024-07-04  B   2  YZM   UN160SM2  ...    34.6  10.40   896     3984    85236
# 11 2024-07-04  B   5  YZM     UN160A  ...    30.1   2.85  2500     6200     2205
# 12 2024-07-04  B   7  YZM     UN120A  ...    28.6   2.40  3500     8500    31244
# 13 2024-07-04  B   8   ZD    EM150-V  ...    33.0   4.60  3000     5800      263
# 14 2024-07-04  B  12   HT     HA2600  ...    23.2   8.80  1000    14800   143100
# 15 2024-07-04  B  13   HH    HM260M3  ...    44.7  18.50   600     2448    38526
# 16 2024-07-04  B  14   HH  DL260-llS  ...    43.5  68.20    85     1518     4964
# 
# [17 rows x 16 columns]

二、推荐阅读

1、Python筑基之旅
2、Python函数之旅
3、Python算法之旅
4、Python魔法之旅
5、博客个人主页
  • 58
    点赞
  • 48
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 37
    评论
评论 37
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

神奇夜光杯

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值