自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(37)
  • 资源 (1)
  • 收藏
  • 关注

原创 keras 2.3.0 做上采样 UpSampling2D的时候的维度出错问题解决办法

简单的说,你是不是遇到了这样的问题,上一层的数据是【None,200,14,14】你希望上采样到28x28H = UpSampling2D(size=(2, 2))(H)你以为能得到【None,200,28,28】结果却成了【None,400,28,14】维度上的错位问题,需要一个参数来解决,我看别的帖子都没有,在官方文档里找到了解决办法。UpSampling2D,有个参数叫data_formatdata_format默认参数是'channels_last',默认最后的维数是ch

2020-06-14 21:27:32 1284

原创 pygame 透明颜色 颜色透明度问题 color alpha数值 绘制透明图形

你是不是发现你的颜色给了第四个数值但绘制不起作用,颜色的透明度那里没用??别着急,哥帮你解决。一般的绘制图形和窗口填充颜色是没办法把透明度alpha的数值用起来的。需要再来一个表面,使用convert_alpha()这个函数。下面是我的一个实际例子,大家自己体会一下用法吧。图片啥的无所谓,自己随表搞几个用上就能看到效果了。import pygameimpor...

2019-08-10 12:03:13 9742 3

原创 python算法:最长公共前缀

class Solution: def longestCommonPrefix(self, strs): """ :type strs: List[str] :rtype: str """ if len(strs)==0: return '' x=0 y=...

2018-05-14 20:37:45 403

原创 python 算法:罗马数字转化

class Solution: def romanToInt(self, s): """ :type s: str :rtype: int """ d={'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000} sum=0 for i...

2018-05-14 20:05:06 598

原创 python算法:Buying a car

A man has a rather old car being worth $2000. He saw a secondhand car being worth $8000. He wants to keep his old car until he can buy the secondhand one.He thinks he can save $1000 each month but the...

2018-05-12 14:19:33 198

原创 python算法:Dubstep

Polycarpus works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.Le...

2018-05-12 11:42:47 671

原创 python算法:Equal Sides Of An Array

You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is equal to the sum of the integers to the right of N....

2018-05-12 11:21:38 584 1

原创 python算法:Palindrome chain length

Number is a palindrome if it is equal to the number with digits in reversed order. For example, 5, 44, 171, 4884 are palindromes and 43, 194, 4773 are not palindromes.Write a method palindrome_chain_l...

2018-05-11 20:20:06 391

原创 python:笔记

while 语句语法说明  1.先执行真值表达式,判断真假  2.如果为真则执行语句块1,然后跳转到第一步  3.如果为假,则执行else的语句块2,然后结束此while语句的执行,如果没有else则直接结束  4.else子句部分可省略while注意事项:  1.要控制真值表达式来防止死循环  2.通常用真值表达式内的变量来控制循环条件  3.通常要在循环语句块内改变循环变量来控制循环的次数和变...

2018-05-10 20:30:38 1647

原创 python算法:Going to zero or to infinity?

Consider the following numbers (where n! is factorial(n)):u1 = (1 / 1!) * (1!)u2 = (1 / 2!) * (1! + 2!)u3 = (1 / 3!) * (1! + 2! + 3!)un = (1 / n!) * (1! + 2! + 3! + ... + n!)Which will win: 1 / n! or ...

2018-05-09 20:45:14 372

原创 python算法:ROT13

How can you tell an extrovert from an introvert at NSA? Va gur ryringbef, gur rkgebireg ybbxf ng gur BGURE thl'f fubrf.I found this joke on USENET, but the punchline is scrambled. Maybe you can deciph...

2018-05-09 20:12:14 3071

原创 python算法:Longest Common Subsequence

Write a function called LCS that accepts two sequences and returns the longest subsequence common to the passed in sequences.SubsequenceA subsequence is different from a substring. The terms of a subs...

2018-05-09 15:50:38 906

原创 python 算法:Product of consecutive Fib numbers

The Fibonacci numbers are the numbers in the following integer sequence (Fn):0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, ...such as:F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.Given a num...

2018-05-05 10:22:31 579

原创 python 算法:Valid Parentheses

Write a function called that takes a string of parentheses, and determines if the order of the parentheses is valid. The function should return true if the string is valid, and false if it's invalid.E...

2018-05-04 20:13:16 469

原创 python基础:笔记

字符串  str 用来记录文本信息表示方法:  在非注释中,凡是用引号扩起来的部分都是字符串  '单引号  "双引号'''三单引号"""三双引号空字符串的字面值表示方式''""''''''""""""单引号和双引号的区别: 单引号内的双引号不算结束符 双引号内的单引号不算结束符三引号字符串  三引号字符串的换行会自动转换为换行符\n        三引号内可以包含单引号和多引号用转义序列代表特殊字...

2018-05-04 19:16:06 185

原创 python算法:Which are in?

Given two arrays of strings a1 and a2 return a sorted array r in lexicographical order of the strings of a1 which are substrings of strings of a2.#Example 1: a1 = ["arp", "live", "strong"]a2 = ["livel...

2018-05-03 19:52:37 472

原创 python基础知识:笔记2

如何运行python程序:  $python3  xxxx.py数字类型:整型 int 浮点型 float布尔型 bool复数类型 complex  [便于使用在数学上]Nonetype    空值 None 是对象,真是含义是啥也没有表达式  数字和运算符 +-*/ // ** %比较运算符:>< >= <= == !=布尔运算:not and or 变量:绑定数值或绑定...

2018-05-03 18:14:45 203

原创 python基础:笔记

linux的使用/操作系统/基本的计算机知识  虚拟机 终端 文件管理器 浏览器进制的转换2 8 10 16在终端当中,用shell命令完成里linux系统的使用常用shell命令ls 查看文件夹下的内容  命令  选项-l  -a .开头  . ..  路径-参数绝对路径 相对路径man     q退出cd  进入到某个路径当中cd   直接回到主目录,家目录  操作系统的用户,提供默认的工作目...

2018-05-02 17:50:53 102

原创 一道python面试题:不用sort()对list实现排序

这题偶然看到的,典型啊,值得马克一记!list=[2,3,5,4,9,6,8,7,1],从小到大排序,不许用sort,输出[1,2,3,4,5,6,,7,8,9]结题思路:    利用min()方法求出最小值,原列表删除最小值,新列表加入最小值,递归调用获取最小值的函数,反复操作list=[2,3,5,4,9,6,8,7,1]ll=[]if len(list)>0: m=min(...

2018-04-29 22:45:51 6846 5

原创 python 算法:Reverse words

刷到现在的感受是:不会的命令一定及时Google哈哈哈哈哈Write a reverseWords function that accepts a string a parameter, and reverses each word in the string. Any spaces in the string should be retained.Example:reverse_words("T...

2018-04-29 22:12:20 2435

原创 python算法:Convert string to camel case

Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output should be capitalized only if the original word was capitalized.Exa...

2018-04-29 21:54:53 1018

原创 python 算法:Descending Order

Your task is to make a function that can take any non-negative integer as a argument and return it with its digits in descending order. Essentially, rearrange the digits to create the highest possible...

2018-04-28 22:21:39 1677

原创 python算法:Beginner Series #3 Sum of Numbers

Given two integers a and b, which can be positive or negative, find the sum of all the numbers between including them too and return it. If the two numbers are equal return a or b.Note: a and b are no...

2018-04-28 20:42:37 607

原创 python算法:Find the divisors!

Create a function named divisors/Divisors that takes an integer and returns an array with all of the integer's divisors(except for 1 and the number itself). If the number is prime return the string '(...

2018-04-28 18:12:49 479

原创 python算法:Consecutive strings

You are given an array strarr of strings and an integer k. Your task is to return the first longest string consisting of k consecutive strings taken in the array.#Example: longest_consec(["zone", "abi...

2018-04-28 17:47:32 547

原创 python错误提示:AttributeError: 'NoneType' object has no attribute 'append'

写python程序时遇到的错误提示: AttributeError: 'NoneType' object has no attribute 'append'例如你定义了空list,想讲元素加进去l=[]m=''.join.s[i:i+k]l = l.append(m)请注意:l = l.append(m) 是不对的,【与之区分的是常用的a+=1】l.a...

2018-04-28 15:45:51 36808 5

原创 PYTHON算法题:Exes and Ohs

Check to see if a string has the same amount of 'x's and 'o's. The method must return a boolean and be case insensitive. The string can contain any char.Examples input/output:XO("ooxx") => trueXO("...

2018-04-28 10:12:53 420

原创 python 算法题:Sum of two lowest positive integers

Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 integers. No floats or empty arrays will be passed.For example, when an array is passed like [19, ...

2018-04-27 20:10:19 552

原创 pythion 算法题:Find the missing letter

#Find the missing letterWrite a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array.You will always get an valid array. And it will...

2018-04-27 19:55:59 436

原创 PYTHON 算法题:Categorize New Member

The Western Suburbs Croquet Club has two categories of membership, Senior and Open. They would like your help with an application form that will tell prospective members which category they will be pl...

2018-04-27 19:52:25 255

原创 python算法练习题:去除列表里的字符串

#去除列表里的字符串#去除列表里的字符串def filter_list(l): #return a new list with the strings filtered out ll=[] for i in range (len(l)): if type(l[i]) is int: ll.append(l[i]) print(l...

2018-04-27 15:40:00 1949

原创 python算法练习:寻找下一个完全平方数

题目大意:Return the next square if sq is a square, -1 otherwise我自己最开始写的:import mathdef find_next_square(sq): a=math.sqrt(sq)#a的类型是float# print(type(a)) if int(a)==a: return (a+1)**2...

2018-04-27 13:43:33 1053

原创 Python编程:学习笔记

Python编程:   开源、面向对象的解释型语言。   开发效率高,混合式(胶水语言)。编写Python程序完成功能:   根据输入的信息计算一个人的标准体重并显示。   拆分:      1、这个程序需要输入信息吗?          我们程序需要有输入部分          解决用Pyton来输入的问题      2、这个程序是否需要输出?         需要输出,显示的标准体重是多少  ...

2018-04-26 23:45:34 553

原创 Python编程:基础知识笔记

Python编程:   开源、面向对象的解释型语言。   开发效率高,混合式(胶水语言)。编写Python程序完成功能:   根据输入的信息计算一个人的标准体重并显示。   拆分:      1、这个程序需要输入信息吗?          我们程序需要有输入部分          解决用Pyton来输入的问题      2、这个程序是否需要输出?         需要输出,显示的标准体重是多少  ...

2018-04-25 22:17:25 597

原创 linux命令更新+python编程入门

sublime text 软件一个文本编辑工具(编写代码常用),功能强大。任务:      1、      自己查询一下 Sublime text3 的安装方法      用 Sublime text3 建立 Python 编辑工具。      2、查询一下 Sublime text3 的常用快捷键file 命令   查看文件类型的命令   file  文件clear 命令   清屏      C...

2018-04-24 20:57:21 389

原创 Linux 常用指令使用

Linux 常用指令使用:Linux:1、表示Linux内核2、表示Linux操作系统:Linux内核和工具软件、应用软件                                 开发工具、办公工具软件Linux系统:1、开源软件,是当前最成功的开源软件之一2、遵循的开源协议:GPL特点:1、Linux操作系统里面一切皆文件,数据,设备都是以文件的形式来管理的2、Linux的文件系统中,目...

2018-04-23 22:19:26 248

原创 计算机基础:python linux 基础和进制

(01011011)2= 1×26 + 1×24 + 1×23  + 1×21  + 1×20  = 64+16 +8 +2 + 1                      =(91)10 (14)8= 1×81+4×80            = 8+4            =(12)10十进制二进制16进制十进制二进制16进制00000081000810001191001920010210...

2018-04-23 22:15:17 89

VideoCapture-0.9.5-cp36-cp36m-win_amd64.whl

VideoCapture包 3.6 win64 ,亲测有效,主要可以用在使用pygame的camera时候,如果出现错误:No module named 'VideoCapture'时解决问题

2019-08-12

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除