logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

【python】详解threading模块:lock、Rlock的使用(二)

在之前的【python】多线程threading详解一文中,是有对多线程进行一个详细的梳理的。其中就提到了线程锁这一功能。主要基于Rlock实现。本文将进一步总结,丰富线程锁内容。在使用多线程的应用下,如何保证线程安全,以及线程之间的同步,或者访问共享变量等问题是十分棘手的问题,也是使用多线程下面临的问题,如果处理不好,会带来较严重的后果,使用python多线程中提供Lock 、Rlock 、..

【python】详解python元组tuple与列表List异同

1、元组tuple与列表List相同点元组tuple与列表List都是序列类型的容器对象,可以存放任何类型的数据、支持切片、迭代等操作。In [3]: a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]#支持切片操作In [4]: a[1:10:3]Out[4]: [1, 4, 7]In [5]: b = (0, 1, 2, 3, 4, 5, 6, 7,

#python#list
【python】pandas库pd.read_excel操作读取excel文件参数整理与实例

除了使用xlrd库或者xlwt库进行对excel表格的操作读与写,而且pandas库同样支持excel的操作;且pandas操作更加简介方便。首先是pd.read_excel的参数:函数为:pd.read_excel(io, sheetname=0,header=0,skiprows=None,index_col=None,names=None,arse_

#pandas#python
【机器学习】卷积神经网络(CNN)模型结构

图像输入层,通过卷积层(Convolution Layer)进行运算,然后池化,这两个是CNN特有的,卷积层的激活函数使用的是ReLU,池化就是对原矩阵进行压缩,得到一个值。

#神经网络#cnn
【python】numpy库linspace相同间隔采样 详解

linspace可以用来实现相同间隔的采样;numpy.linspace(start,stop,num=50,endpoint=True,retstep=False, dtype=None)返回num均匀分布的样本,在[start, stop]。Parameters(参数):start : scalar(标量) The starting value of the sequen

#python#numpy
【python】详解pandas dataframe 去重函数 pandas.DataFrame.drop_duplicates

-1、首先直接看文档:df.drop_duplicates?Signature: df.drop_duplicates(subset=None, keep='first', inplace=False)Docstring:Return DataFrame with duplicate rows removed, optionally onlyconsidering certain...

【python】详解DataFrame中的插入函数df.insert

DataFrame.insert(loc, column, value, allow_duplicates=False)[source]Insert column into DataFrame at specified location.Raises a ValueError if column is already contained in the DataFrame, unless al...

#pandas
【python】详解pandas库的pd.merge函数

pandas.DataFrame.mergepd.merge(left, right, how='inner', on=None, left_on=None, right_on=None,left_index=False, right_index=False, sort=True,suffixes=('_x', '_y'), copy=True, indi...

【python】pandas库pd.to_excel操作写入excel文件参数整理与实例

excel的写入函数为pd.DataFrame.to_excel();必须是DataFrame写入excel, 即Write DataFrame to an excel sheet。to_excel(self, excel_writer, sheet_name='Sheet1', na_rep='', float_format=None,columns=None,header=True

#python#pandas
【python】numpy库ndarray多维数组的的运算:np.abs(x)、np.sqrt(x)、np.modf(x)等

numpy库提供非常便捷的数组运算,方便数据的处理。1、数组与标量之间可直接进行运算In [45]: aOut[45]:array([[ 0,1,2,3],[ 4,5,6,7],[ 8,9, 10, 11]])In [46]: a/5Out[46]:array([[ 0. ,0.2,0.4,0.6],

    共 36 条
  • 1
  • 2
  • 3
  • 4
  • 请选择