- 博客(35)
- 问答 (2)
- 收藏
- 关注
原创 一起学Pandas系列基础篇---数据选择
以上展示了对DataFrame数据选择一列,可以是Series或DataFrame数据;切片列举,包括选择前两行、第4至第9行、全部数据、取偶数前五行、反转顺序、特定两列等。
2022-04-06 18:34:07
3023
原创 《征服C指针》学习笔记---第1章(一)
最近学习C语言,对C指针不是很理解,翻阅了知乎上的一些学习经验,推荐了一本日本作者前桥和弥的《征服C指针》的书,粗粗翻阅了一下,感觉对自己很有帮助,借此博客记录下学习笔记和自己的一些理解,也希望和对此感兴趣的朋友共勉。几点补充:使用了原文(翻译版)的章节题目没有涉及指针等重点内容的都一掠而过作者的语言诙谐、专业性较强,强烈建议阅读原书第1章 从基础开始—预备知识和复习1.1 C是什么样的语言1.1.1 比喻为了解决眼前问题,由开发现场的人发明(即由系统开发者发明,用于解决
2020-10-17 07:57:01
236
原创 Python基础---异常
例1 多个异常 def exception_v1(): try: num1 = int(input("请输入被除数:" )) num2 = int(input("请输入除数: ")) print("商为:" + str(num1/num2)) except ValueError as err: print("请...
2019-08-15 22:02:53
150
原创 Python基础---文件的读写
例1 将字符串写入指定文件中def main(): # 打开桌面文件name.txt(如果该文件不存在,则创建;如果已存在,则删除文件内容),创建文件对象file_1 file_1 = open(r'C:\Users\yyf24\Desktop\name.txt', 'w') # 将字符串写入文件中 file_1.write('Zoe\n') file_...
2019-08-07 22:14:57
402
原创 Turtle Graphics
Turtle graphics is an interesting and easy way to learn basic programming concepts. The Python turtle graphics system simulates a “turtle” that obeys commands to draw simple graphics.import the tur...
2019-07-24 08:13:10
1055
原创 Python基础---Constants(常量)
A named constant is a name that represents a value that cannot bechanged during the program’s execution.e.g.INTEREST_RATE = 0.072
2019-07-23 20:13:27
6290
原创 Python基础---Formatting Numbers(对数字格式化)
保留小数点后几位e.g.>>> print(format(1.23456, '.2f'))1.23• The .2 specifies the precision. It indicates that we want to round the number to two decimal places.• The f specifies that the data t...
2019-07-23 20:08:17
783
原创 Python基础---Escape Characters(转义字符串)
常见的转义字符串参考文献[1] Tony Gaddis,Starting Out with Python[M],United Kingdom: Pearson,2019
2019-07-23 19:35:54
1670
原创 Python基础---Breaking Long Statements into Multiple Lines(代码分行)
using the line continuation character, which is a backslash ().>>> result = 1 + 2 + 3 + 4 \ + 5>>> using parentheses ()result = (1 + 2 + 3 + 4 + 5)print(result)...
2019-07-15 19:29:06
160
原创 Python基础---数字与数学运算知识点整理
Some Conceptsoperand操作数、运算数Python Math Operators# This program gets an item's original price and calculates its sale price,with a 20% discount.# Get the item's original price.origi...
2019-07-15 19:21:30
350
原创 PYTHON CRASH COURSE【Project2: Data visualization】跟随学习---Installing matplotlib
Some ConceptsData visualizationexploring data through visual representationsdata mininguses code to explore the patterns and connections in a data seta data seta small list of numb...
2019-07-10 07:50:11
216
原创 Python基础---Input【input()】
input()一般格式>>> name = input("What's your name? ")What's your name? Pegga>>> print(name)Pegga注意input()返回字符串格式(The input function always returns the user’s input as a string...
2019-07-09 20:03:01
213
原创 Python基础---Variable(变量)
Some TermsTerms解释Variable标识符the Variable Name标识符Variable Naming Rules(变量命名规则)不能使用python关键字(no key words)不能有空格(no spaces)必须以字母或者_开头可以包含字母、数字和_区分大小写见名知意分割标识符下划线分割驼峰命名(the c...
2019-07-08 19:38:10
13644
原创 Python基础---Comments(注释)
ConceptComments are notes of explanation that document lines or sections of aprogram.Comments are part of the program, but the Python interpreterignores them. They are intended for people who may ...
2019-06-30 21:59:48
2708
原创 Python基础---output【print()】
一、 输出字符串1. 一般字符串>>> print("My name is Pegga!") My name is Pegga! 2. 输出带单引号(’)的字符串方法一:>>> print("I'm Pegga!") I'm Pegga! 方法二:>>> print('I\'m Pegga!')I'm Peg...
2019-06-27 22:41:13
8555
原创 Python基础---如何运行Python程序?(How to Excute a python programe?)
如何运行Python程序?(How to Excute a python programe?)一些概念(Concept)Python InterpreterThe Python interpreter can run Python programs that are saved in files or interactively execute Python statements ...
2019-06-24 23:52:52
547
空空如也
在Python中使用os.remove()发生异常
2019-08-15
TA创建的收藏夹 TA关注的收藏夹
TA关注的人