【xlwings api语言参考】Range.Resize 属性

【xlwings api语言参考】Range.ShrinkToFit 属性 功能: 返回或设置一 个布尔值,该值指示文本是否自动缩小以适应可用列宽。 语法: rng.ShrinkToFit rng是一个表示 Range 对象的变量。 说明: 如果文本自动缩小以适应可用列宽,则此属性返回 True ;如果该属性不设置为指定区域内所有单元格的相同值,则返回空。 示例: 此示例使第一行中的文本自动收缩为适当尺寸以适应可用列宽。 import xlwings as xw app=xw.App() bk=app.books.active sht=bk.sheets.active sht.ap 阅读详情

功能:
调整指定区域的大小。 返回一 个 Range 对象,该对象代表调整后的单元格区域。

语法:
rng.Resize(RowSize,ColumnSize)
rng是一个返回 Range 对象的表达式。

参数:
名称 必需/可选 数据类型 说明
RowSize 可选 整数 新区域中的行数。 如果省略此参数,则区域中的行数保持不变。
ColumnSize 可选 整数 新区域中的列数。 如果省略此参数,则区域中的列数保持不变。
返回值:
Range对象

注意:
使用xlwings方式时,使用resize方法可以直接得到扩展后的区域;而使用win32com和xlwings API方式时,使用Resize方法只能得到原单元格扩展后位置上的单元格。所以,对于后者,首先要获取区域的右下角单元格,然后与原单元格重新组合成一个区域。

示例:
本例对指定单元格C2进行上下、左右和右下三个方向扩展来得到新的区域,选择它们。

import xlwings as xw
app=xw.App()
bk=app.books
xlwings操作汇总 2.range.api 区域的操作 range.api形式,实现:Copy--复制,Clear--清除,Delete--删除,Find--查找,Replace--替换,Sort--排序,AutoFilter--筛选,RemoveDuplicates--删除重复项 阅读详情

相关推荐

【xlwings api语言参考】Range.Cut 方法

功能: 将对象剪切到剪贴板,或者将其粘贴到指定的目的地。 语法 表达式。剪切 (目标) expression:一个返回 Range 对象的表达式。 参数 名称 必需/可选 数据类型 说明 Destination 可选 Variant 应在其中粘贴对象的目标区域。 如果省略此参数,区域对象会被剪切到剪贴板。 返回值 Variant 注解 剪切的区域必须由相邻的单元格组成。 ...

DataLab的博客 563

Python xlwings操作Excel(摸鱼划水必备技能)——(1)各元素属性及方法

在日常工作中,或多或少会使用到excel工具。有时繁琐重复的excel会让人感到很无聊和乏味,并且浪费大量的时间。如果你也是这样,这个时间救星就到了,学好Python的xlwings包,摸鱼无烦恼。文章为个人笔记,部分代码需要根据实际情况进行调整。............

m0_59160272的博客 7905

【xlwings api语言参考】Range.Select 方法

功能: 选择对象。语法: rng.Select() rng是一个表示 Range 对象的变量。注解: 要选择单元格或单元格区域,请使用 Select 方法。 要将单个单元格设置为活动单元格,请使用 Activate 方法。示例: 本例选择Sheet1工作表中的单元格区域B2:D6。...

DataLab的博客 1319

xlwings中文官方文档

内部有python的api,我认为最好用的操作excel的模块,办公自动化就靠它

头歌操作系统 课堂练习4.2:页式内存管理 答案 无解析

头歌操作系统 课堂练习4.2:页式内存管理 答案 无解析

kercii的博客 1万+

SCU【C】程序设计基础期末安全项目lab2-Deadbeef-writeup(附题目&源码)

项目名称(本质:栈溢出攻击)【源码在文首】和lab1一样,此题又是美国卡耐基梅隆大学的平时作业哈哈哈! 项目要求是把栈溢出,强行更改函数返回值,输出0xdeadbeef。

2301_79586491的博客 1551

深度学习基于Resnet18的图像多分类--训练自己的数据集(超详细 含源码)

深度学习基于Resnet18的图像多分类--训练自己的数据集(超详细 含源码)

她是不会无条件的!! 2万+

高通Camera HAL3调试实战:如何用camxoverridesettings.txt高效抓取日志与dump图像数据

本文深入探讨了高通Camera HAL3调试中camxoverridesettings.txt文件的高效应用,重点介绍了如何通过该文件精准控制日志输出级别与dump图像数据,帮助开发者快速定位移动影像系统中的问题。文章详细解析了日志分级配置、图像数据捕获技巧及典型问题排查流程,为高通Camera HAL3项目开发提供了实用技术点。

weixin_30315905的博客 870

【crawler笔记】R语言简单动态网页爬虫(rvest包)示例

1、爬虫目标 大家普遍认为Python的爬虫功能强大,但在解决动态加载或者登陆网站时,Python存在一定困难的,相对于一些普通爬虫,使用R语言会更方便。 以https://www.thepaper.cn/为例,爬取首页的新闻(标题、内容、时间),主要采用的是动态网页中常用的httr包。 初始学习时,参考了B站《20分钟入门基于R语言的网络爬虫_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili》的视频,但代码运行出现了报错,所以在原代码上做了修改。 2、代码分析及报错修改 library(rv

seeyouer1205的博客 3282

从零手写神经网络:用NumPy实现全连接网络与反向传播

神经网络本质上是可微分的函数复合体,其核心在于仿射变换与非线性激活的交替堆叠,以及基于链式法则的自动微分实现。理解前向传播的矩阵运算逻辑和反向传播的梯度流动机制,是掌握深度学习底层原理的关键路径。权重初始化(如He/Xavier)、激活函数选择(ReLU/Sigmoid)与数值稳定性处理(如1e-8防下溢)共同决定了训练的收敛性与鲁棒性。这些基础要素不仅支撑学术推导,更直接影响工业场景中的模型调试、FPGA部署及梯度异常定位。本文以纯NumPy实现三层全连接网络为载体,聚焦‘From Scratch’过程中

weixin_32495691的博客 291

基于TIA博途的一阶滞后滤波+中位值滤波+堆栈平均值滤波算法SCL语言程序(封装FB库)

基于TIA博途的一阶滞后滤波+中位值滤波+堆栈平均值滤波算法SCL语言程序(封装FB库)

Robot_PLC_HMI_Automation 2185

Prompt进阶2:LangGPT(构建高性能Prompt策略和技巧)--最佳实践指南

Prompt进阶2:LangGPT(构建高性能Prompt策略和技巧)--最佳实践指南

丨汀、的博客 2656

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

上一篇: 【xlwings api语言参考】Range.Range 属性
下一篇: 【xlwings api语言参考】Range.Row 属性
DataLab
博客等级 码龄7年 43粉丝 178原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

打赏作者

DataLab

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

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

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

打赏作者

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

抵扣说明:

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

余额充值