python学习day04

昇腾Ascend310b部署deepseek-r1-7b的学习记录 9.鲲鹏服务器+昇腾卡(Atlas 300I pro)搭建DeepSeek-R1-Distill-Qwen-7B(自己存档详细版)5.如何使用昇腾Ascend 300I Pro 310P芯片 单卡运行DeepSeek-R1-Distilled-Qwen-7B。6.鲲鹏服务器+昇腾卡(Atlas 300I pro)搭建DeepSeek-R1-Distill-Qwen-7B。7.鲲鹏+昇腾部署DeepSeek-R1-Distill-Qwen-32B+Open-webui。 阅读详情

记于2019年7月11日 地点:江苏无锡
今天学习了关于python以下几个方面

1.函数的高阶用法

2.文件的使用

3.每日作业

函数高阶用法
高阶参数定义:参数有:默认的参数,可变参数,引用传参

  • 默认的参数:带有默认值的参数一定要位于参数列表最后面
  • 可变参数:参数的数量不确定:包括未命名的变量参数和关键字参数
  • 引用传参:指函数传参
    递归函数:函数调用自己
    匿名函数:lambda

文件的使用
文件的打开关闭读写:
f = open(‘test.txt’, ‘r’)
content = f.readlines()
print(type(content))
print(content)
f.close()
文件的备份
文件的定位
文件的重命名删除

每日作业
链接: https://pan.baidu.com/s/1LMdjscb5Gf7RqJmzUKsR7w 提取码: mc6a 作业有疑问的可以私聊我喔,有错误望指正

全覆盖路径规划开源项目Clean-robot-turtlebot3关键函数解析(上) 本系列文章主要介绍全覆盖路径规划开源项目Clean-robot-turtlebot3的相关内容,包含如下四篇文章,分别介绍了开源项目Clean-robot-turtlebot3流程的概括总结、ROS坐标系常用坐标及其变换、Clean-robot-turtlebot3关键函数解析等内容。 阅读详情

相关推荐

WorkBuddy入门到 多Agent团队协作完全指南(附实操代码与配图)

WorkBuddy的Agent Teams功能支持多智能体协作,通过创建AI团队提升复杂任务处理效率。该功能支持自然语言创建团队、任务分配与依赖管理、成员间消息通信(包括直接消息和广播),并提供任务审批机制。典型应用场景包括软件开发、内容创作等协作任务。环境要求WorkBuddy 2026年3月及以上版本,支持Windows和macOS系统。用户可快速创建包含不同角色的AI团队,通过共享任务列表和信箱系统实现协作。高级功能包括委派模式、任务依赖管理和成员自主认领等,适合各类协作场景。

三棱球的专栏 6457

Python基础day04学习笔记回顾

 

凋落的枫叶 219

CH569 USBSS库函数分析

CH569 USB3.0 解析

havc_W的博客 7685

Python学习day04

列表:用于存储任意数目、任意类型的数据集合。列表是内置可变序列,是包含多个元素的有序连续的内存空间。列表定义的标准语法格式:其中,10,20,30,40这些称为:列表a的元素。列表中的元素可以各不相同,可以是任意类型。比如:列表对象的常用方法汇总如下,方便大家学习和查阅。方法要点描述增加元素将元素x增加到列表list尾部增加元素将列表alist所有元素加到列表list尾部增加元素在列表list指定位置index处插入元素x删除元素在列表list中删除首次出现的指定元素x。

qq_34839164的博客 1032

旋转变压器软件解码simulink仿真

旋转变压器软件解码simulink仿真、电机转速位置测量

qq_31446727的博客 2582

从零搭建企业网络:使用Packet Tracer模拟多区域OSPF组网全过程

本文通过Cisco Packet Tracer模拟,详细演示了从零搭建一个典型企业多区域OSPF网络的完整流程。内容涵盖网络拓扑规划、IP地址设计、多区域划分原理,并提供了从设备初始化、接口配置到OSPF多区域核心配置与验证的详细步骤。文章旨在帮助网络学习者与IT支持人员通过动手实验,将理论知识转化为实际的配置与排障能力。

day7的博客 1031

学习python(day04)

###03内容回顾 ascii码包括:字母,特殊字符,1个字节,8位 Unicode:16位,两个字节 升级三十二位,四个字节 utf-8:最少用8位,英文字母8位1个字节,欧洲16位,2个字节,中文24位,3个字节 gbk:中文2个字节,英文一个字节 int:数字类型,一个方法,bit_length()计算最少字节 bool: True, False str:str->bool 有东西就...

qq_40312231的博客 154

Android 集成 Google 与 Facebook 第三方登录实战详解(2024版)

本文详细介绍了2024年Android应用集成Google与Facebook第三方登录的完整实战指南。通过分步教程和代码示例,帮助开发者快速实现一键登录功能,提升用户体验和注册转化率,同时涵盖隐私合规和常见错误处理的最佳实践。

blue的专栏 822

python小白学习总结day04

果然说一会儿写总结都是骗人的T T~~昨晚有事出门回来也没接着上篇写总结,今天补上。 今天写了字典,CSV文件,异常处理,try语句,生成随机数,海龟图。 #注意,使用outfile创建文件时,文件名要加引号,不然会有错误。 #outfile,infile没有clear方法,只有outfile有一个导包os然后remove方法可以删文件,不要混淆。 在分析字典的应用之前,首先补上“CSV文件”部分...

weixin_43782979的博客 318

实战教程:用DETR+超分辨率搞定红外小目标检测(附完整代码)

本文提供了一套完整的红外小目标检测实战方案,通过融合EDSR超分辨率技术与改进型DETR深度学习算法,有效解决了红外图像中小目标检测的难题。文章详细介绍了从环境搭建、数据预处理、模型定制(如引入EMA注意力与S2特征层)到训练调优的全流程,并附有完整代码,旨在帮助开发者将前沿算法高效落地于安防、自动驾驶等实际场景。

weixin_29057163的博客 532

【教程4>第1章>第11节】使用MATLAB快速产生批量verilog语句加快FPGA开发

...........如果手动写,那么就非常麻烦,这个时候,我们借助matlab,则可以快速生成上述类型的verilog程序,我们编写如下的MATLAB语句。\n");\n");end。

FPGA/MATLAB学习教程/源码/项目合作开发 1241

Python学习Day04

Python学习Day04 循环结构 while循环 语法结构:while condition: ​ statement(s) 计算1~1000的和 >>> i = 1 >>> sum = 0 >>> while i <= 1000: sum = sum + i i = i + 1 >>> print(sum) 500500 break语句 当break被执行时,剩余

qq_51915924的博客 196

【WRF后处理】基于wrf-python处理wrf运行结果wrfout_d01

基于wrf-python处理wrf运行结果wrfout_d01

WW、forever的博客 5209

python基础学习总结day04

函数代码块以 def 关键词开头,后接函数标识符名称和圆括号()。 任何传入参数和自变量必须放在圆括号中间。圆括号之间可以用于定义参数。 函数的第一行语句可以选择性地使用文档字符串—用于存放函数说明。 函数内容以冒号起始,并且缩进。 return [表达式] 结束函数,选择性地返回一个值给调用方。不带表达式的return相当于返回 None。

weixin_44690932的博客 422

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

深度学习工具包 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")

python进阶学习 day_04

将函数作为参数或返回值的函数.

qq_59348412的博客 1006

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

Python学习笔记—Day04

Python学习第四天之基础知识04: 注释: '#'在python之中是注释符号,用于单行注释,注释应该言而又物,应当写一些算法里面比较难懂的地方。 字符串: 还记得我们之前写的一个实例吗?在第二天的时候,以下是代码重现: x=input("你今年多少岁了?\n") y=input("你叫什么名字?\n") print(y+"今年"+x+"岁了") 那么在这个print(y+“今年”+x+“岁...

dyc1522的博客 263

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Python学习笔记——Day04

这是目录Python学习笔记——Day04类面向对象基础@property装饰器__slots__的使用静态方法和类方法方法的重写文件异常文件复制小案例json读取 Python学习笔记——Day04 第四天,继续加油,面向对象开始 类 使用class关键字定义类,然后在类中通过之前学习过的函数来定义方法,再创建对象,这样就可以通过对象去存储一些数据或调用相应的行为。先来看一个示例代码 class...

我的博客 697

python学习之day04

今天来总结一下文件输入输出操作的主要内容。 1、以t模式为基础进行内存操作 r(默认的操作模式):只读模式,当文件不存在时报错,当文件存在时文件指针跳到开始位置 with open(‘c.txt’,mode=‘rt’,encoding=‘utf-8’) as f: print(‘第一次读’.center(50,’*’)) res=f.read() # 把所有内容从硬盘读入内存 2、w:只写模式,当...

weixin_43138641的博客 142

Python学习打卡:day04

笔记来源于:黑马程序员python教程,8天python从入门到精通,学python看这套就够了基本语法格式: 注意事项:示例程序: 29、while 循环案例 — 九九乘法表 补充知识 print 输出不换行 制表符 示例:九九乘法表 输出结果:基本语法格式: 从待处理数据集中:逐个取出数据,赋值给临时变量。 for循环是将字符串的内容:依次取出,所以,for循环也被称之为:遍历循环理论上讲,Python的for循环无法构建无限循环(被处理的数据集不可能无限大)for循环的注意点: 32、

胜天半子祁厅的博客 1285
上一篇: python学习day03
下一篇: mysql下载并安装教程及简单操作(基于win和mac)超级详细
By喜儿
博客等级 码龄12年 5粉丝 13原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值