自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 machine Learning

how it works:we build a model or an enginegive it lots of datafind and learn patterns and input datasteps:import the Data(.csvclean the Data(remove duplicated data, convert data into numeri...

2020-02-08 20:43:45 67

原创 excel spreadsheets

查找某个cell的值import openpyxl as xlwb = xl.load_workbook('transactions.xlsx')sheet = wb['Sheet1']cell = sheet['a1']cell = sheet.cell(1,1)print(cell.value)最大行数print(sheet.max_row)利用for loop遍历某一列的值...

2020-02-08 11:11:34 225

原创 学习笔记

files and directoriesabsolute path(start from the root of our hard-disk)relative path(a path starting from the current directory)

2020-02-08 10:15:55 74

原创 Generating Random Values

throw a diceimport randomclass Dice: def roll(): return random.randint(1, 6), random.randint(1, 6)dice1 = Dice()print(Dice.roll())random.random()random.randiant(num1, num2)

2020-02-07 11:04:10 158

原创 module & package

module is a file with some python codes. We use module to organize our code into multiple files. We break our codes into multiple files. Each file is referred to as module.a module should contain al...

2020-02-07 10:34:37 66

原创 Inheritance

inheritance is a mechanism for reusing codesdon’t repeat yourselfto prevent an empty class, add ‘pass’class Mammal: def walk(self): print('walk')class Dog(Mammal): def bark(sel...

2020-02-06 17:50:54 61

原创 Classes

ues classes to define new types to model real conceptsthe new type has the methods for working with this classuse lower case letters to name variables and functions and separate mutiple words using...

2020-02-06 11:07:14 142

原创 exceptions & comments

Exceptionhandle errors in python programexit code 0 means program terminated successfully.try: age = int(input('Age: ')) print(age)except ValueError: print('Invalid value')try: ...

2020-02-06 10:08:12 79

原创 function, parameters, keyword arguments

container for a few lines of codes that perform a specific taskparameters are used to pass information to funtiondef greet_user(name): print(f'Hi {name}!')print('Start')greet_user('John')...

2020-02-05 21:59:10 98

原创 dictionary

store information come as key-value pairseach key should be unique通过key获得valuecustomer = { 'name':'John Smith', 'age':'30', 'is_verified':True}customer['name']customer.get('name')...

2020-02-05 16:33:16 71

原创 unpack

coordinates = (1, 2, 3)x = coordinates[0]y = coordinates[1]z = coordinates[2]x, y, z, = coordinates上下两种结果相同将coordinate解压为3个变量同样的方法适用于列表

2020-02-04 20:05:52 91

原创 Lists , 2D lists & tuple学习

index指定其中的任何一个元素index修改其中的元素Lists找到最大的数字第一次可能的方法:max方法sort方法input_list = [9, 3, 5, 1, 7, 9]largest_num = 0input_list.sort(reverse = True)largest_num = input_list[0]print(largest_num)逐项比较...

2020-02-04 19:41:14 81

原创 For loops & nested loop学习

while loop is used to excute a block of code multipule times.for loop is used to iterate items of a collection. The collection can be a string, a list, or a range of objects. Each time create a new ...

2020-02-04 17:16:22 475

原创 While loop 学习

Guess gametarget_num = 9guess_num = 0i = 1result = ''while i <= 3: guess_num = int(input("Guess: ")) if guess_num == target_num: result = 'You win!' i = 4 else: ...

2020-02-03 19:04:17 790

原创 基本操作

这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Ma...

2019-05-07 12:27:00 112

空空如也

空空如也

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

TA关注的人

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