From fee004e5c8db54237008545fc8f2e25a0ed28a04 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sat, 14 Aug 2021 10:48:03 +0800 Subject: [PATCH 01/26] Create 11.md --- md/11.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/md/11.md b/md/11.md index 40874b42..31072399 100644 --- a/md/11.md +++ b/md/11.md @@ -9,9 +9,12 @@ base为底的exp次幂,如果mod给出,取余 ```python -In [1]: pow(3, 2, 4) +In [1]: pow(2,1.5) +Out[1]: 2.8284271247461903 + +In [1]: pow(3, 2, 4) # 3的2次方结果再对4取余数 Out[1]: 1 ``` -
[上一个例子](10.md) [下一个例子](12.md)
\ No newline at end of file +
[上一个例子](10.md) [下一个例子](12.md)
From b6fa084758d309e3ce6bad7d70adc06ff57371a3 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sat, 14 Aug 2021 10:49:07 +0800 Subject: [PATCH 02/26] Update 10.md --- md/10.md | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/md/10.md b/md/10.md index b8ca63b2..1fdec254 100644 --- a/md/10.md +++ b/md/10.md @@ -6,12 +6,39 @@ #### 10 转为整型   -int(x, base =10) , x可能为字符串或数值,将 x 转换为一个普通整数。如果参数是字符串,那么它可能包含符号和小数点。 +int(x, base =10) , x可能为字符串或数值,将 x 转换为一个普通整数。 + +参数base指定x进制数,常见的2,8,10,16分别表示二进制、八进制、十进制、十六进制的数字 + +如果参数是字符串,必须为整数型字符串,如果是浮点数字符串会抛出异常。 + +如果x是浮点数,int后截去小数点,只保留整数部分。 ```python -In [1]: int('12',16) -Out[1]: 18 +In [2]: int('0110',2) + +Out[2]: 6 + +In [3]: int('0732',8) +Out[3]: 474 + +In [4]: int('12',16) +Out[4]: 18 + +In [5]: int('12',10) +Out[5]: 12 + +In [6]: int(1.45) +Out[6]: 1 + +In [7]: int('1.45') +--------------------------------------------------------------------------- +ValueError Traceback (most recent call last) + in +----> 1 int('1.45') + +ValueError: invalid literal for int() with base 10: '1.45' ``` -
[上一个例子](9.md) [下一个例子](11.md)
\ No newline at end of file +
[上一个例子](9.md) [下一个例子](11.md)
From fe458cd48b1d7170b824f13c334aff24952a64fc Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 15 Aug 2021 09:32:21 +0800 Subject: [PATCH 03/26] Update 13.md --- md/13.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/md/13.md b/md/13.md index 634ac883..3cc2f3c5 100644 --- a/md/13.md +++ b/md/13.md @@ -6,6 +6,8 @@ #### 13 链式比较 +Python支持这种连续不等比较,写起来更方便 + ```python i = 3 print(1 < i < 3) # False @@ -13,4 +15,4 @@ print(1 < i <= 3) # True ``` -
[上一个例子](12.md) [下一个例子](14.md)
\ No newline at end of file +
[上一个例子](12.md) [下一个例子](14.md)
From 0a3c263dd8e13ab9e48acb0e802a4983330942d4 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 15 Aug 2021 09:45:32 +0800 Subject: [PATCH 04/26] Update 14.md --- md/14.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/md/14.md b/md/14.md index a66f7aca..061a1d8d 100644 --- a/md/14.md +++ b/md/14.md @@ -11,9 +11,20 @@ ```python In [12]: s = "apple" -In [13]: bytes(s,encoding='utf-8') -Out[13]: b'apple' +In [13]: a = bytes(s,encoding='utf-8') +In [14] a +Out[14]: b'apple' + +# 转化后a变为字节序列,bytes类型, +# 并且每个字符都被转化为数值,如下所示 +In [15]: for i in a: + ...: print(i) +97 +112 +112 +108 +101 ``` -
[上一个例子](13.md) [下一个例子](15.md)
\ No newline at end of file +
[上一个例子](13.md) [下一个例子](15.md)
From da38cba034d783b4249435db9adc0fcbd47606c1 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Thu, 19 Aug 2021 08:32:00 +0800 Subject: [PATCH 05/26] Create 15.md --- md/15.md | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/md/15.md b/md/15.md index 60fdbe93..b5127301 100644 --- a/md/15.md +++ b/md/15.md @@ -7,16 +7,30 @@ #### 15 任意对象转为字符串   ```python -In [1]: i = 100 + -In [2]: str(i) -Out[2]: '100' +In [1]: str(100) +Out[1]: '100' -In [3]: str([]) -Out[3]: '[]' +In [2]: str([3,2,10]) +Out[2]: '[3, 2, 10]' + +In [3]: str({'a':1, 'b':10}) +Out[3]: "{'a': 1, 'b': 10}" + +In [11]: from collections import defaultdict +In [12]: dd = defaultdict(int) + +In [14]: for i in [1,3,2,2,3,3]: + ...: dd[i] += 1 + ...: + +In [15]: dd +Out[15]: defaultdict(int, {1: 1, 3: 3, 2: 2}) + +In [16]: str(dd) +Out[16]: "defaultdict(, {1: 1, 3: 3, 2: 2})" -In [4]: str(tuple()) -Out[4]: '()' ``` -
[上一个例子](14.md) [下一个例子](16.md)
\ No newline at end of file +
[上一个例子](14.md) [下一个例子](16.md)
From 941d93958ef30de6effaa8b21e49fcd23eee42a6 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 22 Aug 2021 09:58:10 +0800 Subject: [PATCH 06/26] Update 16.md --- md/16.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/md/16.md b/md/16.md index 45bccd41..e8d661fa 100644 --- a/md/16.md +++ b/md/16.md @@ -18,6 +18,16 @@ Out[3]: at 0x0000000005DE75D0, file "", line 1> In [4]: exec(r) helloworld + +s = """ +def f(): + print("hello world") + a = 100 % 52 + print(a) +f() +""" +r = compile(s,"", "exec") +exec(r) ``` -
[上一个例子](15.md) [下一个例子](17.md)
\ No newline at end of file +
[上一个例子](15.md) [下一个例子](17.md)
From bb54be45648a9d227449862d0b8e9c5de77d0db8 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 22 Aug 2021 09:58:40 +0800 Subject: [PATCH 07/26] Update 16.md --- md/16.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/md/16.md b/md/16.md index e8d661fa..5cc1a5a3 100644 --- a/md/16.md +++ b/md/16.md @@ -21,7 +21,6 @@ helloworld s = """ def f(): - print("hello world") a = 100 % 52 print(a) f() @@ -30,4 +29,7 @@ r = compile(s,"", "exec") exec(r) ``` +输出 +48 +
[上一个例子](15.md) [下一个例子](17.md)
From c86001fbed15e40b885933cdaf0c06076c31b2e0 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 22 Aug 2021 11:44:02 +0800 Subject: [PATCH 08/26] Update 17.md --- md/17.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/md/17.md b/md/17.md index e09883c3..3b3c360c 100644 --- a/md/17.md +++ b/md/17.md @@ -13,6 +13,21 @@ In [1]: s = "1 + 3 +5" In [2]: eval(s) Out[2]: 9 + +s = ["{'小汽车':10, '面包车':8}", "{'面包车':5}"] +from collections import defaultdict +d = defaultdict(int) + +for item in s: + my_dict = eval(item) + print(type(my_dict)) + for key in my_dict: + d[key] += my_dict[key] +print(d) + + + +defaultdict(, {'小汽车': 10, '面包车': 13}) ``` -
[上一个例子](16.md) [下一个例子](18.md)
\ No newline at end of file +
[上一个例子](16.md) [下一个例子](18.md)
From 8114f5a963e1b1d9cb8fc535566ff5b95ce39051 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Wed, 25 Aug 2021 09:34:57 +0800 Subject: [PATCH 09/26] Update 23.md --- md/23.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/md/23.md b/md/23.md index 05fb188b..ac994a9e 100644 --- a/md/23.md +++ b/md/23.md @@ -6,6 +6,30 @@ #### 23 交换两元素 +理解交换两个元素,需要首先明白什么是pack,什么是unpack + +```python +In [1]: a=[3,1] + +# unpack +In [2]: a0,a1 = a + +In [3]: a0 +Out[3]: 3 + +In [4]: a1 +Out[4]: 1 + +# pack +In [5]: b = a0, a1 + +In [6]: b +Out[6]: (3, 1) + +``` + +所以下面 `b,a = a,b` 交换2个元素的过程,实际是先pack a,b为元组 (a,b),然后再unpack (a,b) 给 b, a的过程 + ```python def swap(a, b): return b, a @@ -14,4 +38,4 @@ def swap(a, b): print(swap(1, 0)) # (0,1) ``` -
[上一个例子](22.md) [下一个例子](24.md)
\ No newline at end of file +
[上一个例子](22.md) [下一个例子](24.md)
From cd36035591a2432c2159a1819a1db4e9c695381f Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Fri, 27 Aug 2021 09:01:08 +0800 Subject: [PATCH 10/26] Update 29.md --- md/29.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/md/29.md b/md/29.md index a2282893..9998a648 100644 --- a/md/29.md +++ b/md/29.md @@ -9,17 +9,24 @@ 创建数据字典 ```python +# 方法1:使用dict In [1]: dict() Out[1]: {} - In [2]: dict(a='a',b='b') Out[2]: {'a': 'a', 'b': 'b'} +# 方法2:zip In [3]: dict(zip(['a','b'],[1,2])) Out[3]: {'a': 1, 'b': 2} +# 方法3:嵌入元组的列表 In [4]: dict([('a',1),('b',2)]) Out[4]: {'a': 1, 'b': 2} + +# 方法4:自典型字符串 +In [1]: s = "{'a':1, 'b':2}" +In [2]: eval(s) +Out[2]: {'a': 1, 'b': 2} ``` -
[上一个例子](28.md) [下一个例子](30.md)
\ No newline at end of file +
[上一个例子](28.md) [下一个例子](30.md)
From 851770759eafaec95076a19e37c27dd3f3786397 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Tue, 31 Aug 2021 22:55:36 +0800 Subject: [PATCH 11/26] Update 31.md --- md/31.md | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/md/31.md b/md/31.md index f2417ab3..c9a73545 100644 --- a/md/31.md +++ b/md/31.md @@ -9,10 +9,37 @@ 返回一个set对象,集合内不允许有重复元素: ```python -In [159]: a = [1,4,2,3,1] +In [1]: a = [1,4,2,3,1] -In [160]: set(a) -Out[160]: {1, 2, 3, 4} +In [2]: set(a) +Out[2]: {1, 2, 3, 4} + +In [3]: b = set(a) + +In [4]: b.add(5) + +In [5]: b +Out[5]: {1, 2, 3, 4, 5} + +In [6]: b.pop() +Out[6]: 1 + +In [7]: b +Out[7]: {2, 3, 4, 5} + +In [8]: b.pop() +Out[8]: 2 + +In [9]: b +Out[9]: {3, 4, 5} + +# 注意pop删除集合内任意一个元素 +In [10]: help(b.pop) +Help on built-in function pop: + +pop(...) method of builtins.set instance + Remove and return an arbitrary set element. + Raises KeyError if the set is empty. ``` -
[上一个例子](30.md) [下一个例子](32.md)
\ No newline at end of file +
[上一个例子](30.md) [下一个例子](32.md)
From 9e7117cf9ab1be17b4ea85772a6d0c1b2792e942 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 5 Sep 2021 11:23:36 +0800 Subject: [PATCH 12/26] Update 48.md --- md/48.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/md/48.md b/md/48.md index 38073257..c62565fc 100644 --- a/md/48.md +++ b/md/48.md @@ -5,14 +5,22 @@ ``` #### 48 查看变量所占字节数 +`getsizeof`查看变量占用字节数 +看到:字典比列表占用更多空间 ```python In [1]: import sys -In [2]: a = {'a':1,'b':2.0} +In [3]: a = [('a',1),('b',2)] + +In [5]: sys.getsizeof(a) +Out[5]: 88 + + +In [6]: a = {'a':1,'b':2.0} +In [7]: sys.getsizeof(a) +Out[7]: 248 -In [3]: sys.getsizeof(a) # 占用240个字节 -Out[3]: 240 ``` -
[上一个例子](47.md) [下一个例子](49.md)
\ No newline at end of file +
[上一个例子](47.md) [下一个例子](49.md)
From efa3de2b182f2b74189bf6ca3a5cf0f70b8376be Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 3 Oct 2021 20:09:25 +0800 Subject: [PATCH 13/26] Update 9.md --- md/9.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/md/9.md b/md/9.md index 982caa4d..ad0d55f7 100644 --- a/md/9.md +++ b/md/9.md @@ -17,6 +17,11 @@ In [1]: float('3') Out[1]: 3.0 ``` +```python +float('inf') # 正无穷大 +float('-inf') # 负无穷大 +``` + 如果不能转化为浮点数,则会报`ValueError`: ```python From 816cda665ac0f4bff3ed960275ee0786ab988c98 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 3 Oct 2021 20:09:57 +0800 Subject: [PATCH 14/26] Update 9.md --- md/9.md | 1 + 1 file changed, 1 insertion(+) diff --git a/md/9.md b/md/9.md index ad0d55f7..7864b486 100644 --- a/md/9.md +++ b/md/9.md @@ -17,6 +17,7 @@ In [1]: float('3') Out[1]: 3.0 ``` +正无穷大、负无穷大 ```python float('inf') # 正无穷大 float('-inf') # 负无穷大 From 2516dc4cd478e8d5d518bfeb53e7fd341c141e32 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 3 Oct 2021 20:11:28 +0800 Subject: [PATCH 15/26] Update 9.md --- md/9.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/md/9.md b/md/9.md index 7864b486..2e69dd2a 100644 --- a/md/9.md +++ b/md/9.md @@ -17,6 +17,13 @@ In [1]: float('3') Out[1]: 3.0 ``` +```python +import sys + +In[4]: sys.float_info.max +Out[4]: 1.7976931348623157e+308 +``` + 正无穷大、负无穷大 ```python float('inf') # 正无穷大 From 126d01f7b6aedd419affc152435256d696006fe8 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 3 Oct 2021 20:11:50 +0800 Subject: [PATCH 16/26] Update 9.md --- md/9.md | 1 + 1 file changed, 1 insertion(+) diff --git a/md/9.md b/md/9.md index 2e69dd2a..3cd61f78 100644 --- a/md/9.md +++ b/md/9.md @@ -17,6 +17,7 @@ In [1]: float('3') Out[1]: 3.0 ``` +浮点数最大值 ```python import sys From 3357afd664cf9f15a84fed9cc6b24b052303df69 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Tue, 14 Dec 2021 08:02:26 +0800 Subject: [PATCH 17/26] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7e9513f0..6028c228 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ Python小例子 https://github.com/jackzhenguo/python-small-examples | 24 | [使用堆升序列表](md/196.md) | sort heapq | v1.0 | ⭐️⭐⭐⭐ | -### 面向对象OOP +### 面向对象 | 小例子 | 链接 | 标签 | 版本 | 难度 | | ---- | ---------------------------------- | ---- | ---- | ---- | | 1 | [所有对象之根](md/43.md) | object | V1.0 | ⭐️ | @@ -240,7 +240,7 @@ Python小例子 https://github.com/jackzhenguo/python-small-examples | 37 | [一行代码让 pip 安装加速 100 倍](md/176.md) | pip install | v1.0 | ⭐️⭐⭐ | -### 案例 +### 工作常用案例 | 小例子 | 链接 | 标签 | 版本 | 难度 | | ---- | ---------------------------------- | ---- | ---- | ---- | | 1 | [不用else和if实现计算器](md/60.md) | operator | V1.0 | ⭐️⭐️⭐️ | From 6cd22b007965fda8d089fd606c888b6d9a68671f Mon Sep 17 00:00:00 2001 From: guozhen3 Date: Fri, 31 Dec 2021 14:13:11 +0800 Subject: [PATCH 18/26] =?UTF-8?q?2021=E7=9B=98=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- md/1.md | 2 +- md/2.md | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/md/1.md b/md/1.md index f135deea..817a25ea 100644 --- a/md/1.md +++ b/md/1.md @@ -4,7 +4,7 @@ @date 2019/2/10 ``` -#### 2 实现 relu +#### 1 实现 relu 在神经网络中,`relu`作为神经元的激活函数: diff --git a/md/2.md b/md/2.md index 22a5a27f..aa58feaa 100644 --- a/md/2.md +++ b/md/2.md @@ -8,21 +8,21 @@ 十进制转换为二进制: ```python -In [2]: bin(10) -Out[2]: '0b1010' +In [1]: bin(10) +Out[1]: '0b1010' ``` 十进制转换为八进制: ```python -In [3]: oct(9) -Out[3]: '0o11' +In [2]: oct(9) +Out[2]: '0o11' ``` 十进制转换为十六进制: ```python -In [4]: hex(15) -Out[4]: '0xf' +In [3]: hex(15) +Out[3]: '0xf' ``` - - + +
[上一个例子](1.md) [下一个例子](3.md)
\ No newline at end of file From 67984acfda1294709aeff3ce1183769b59c05465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E9=A3=9E?= Date: Wed, 23 Mar 2022 15:26:01 +0800 Subject: [PATCH 19/26] typo --- md/159.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/md/159.md b/md/159.md index 84bec8a9..98b7426f 100644 --- a/md/159.md +++ b/md/159.md @@ -13,7 +13,7 @@ ```python def del_item(lst,e): - return [lst.remove(i) for i in e if i==e] # NO! + return [lst.remove(i) for i in lst if i==e] # NO! ``` 考虑删除这个序列[1,3,3,3,5]中的元素3,结果发现只删除其中两个: @@ -31,4 +31,4 @@ def del_item(lst,e): ``` -
[上一个例子](158.md) [下一个例子](160.md)
\ No newline at end of file +
[上一个例子](158.md) [下一个例子](160.md)
From e8e698d82fba012829a99ac40ff7c590726cbdb0 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Fri, 9 Sep 2022 09:06:53 -0500 Subject: [PATCH 20/26] Update 118.md --- md/118.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/md/118.md b/md/118.md index ca14fe8d..8b3eaec1 100644 --- a/md/118.md +++ b/md/118.md @@ -23,7 +23,7 @@ print(t) # <_MainThread(MainThread, started 139908235814720)> 所以,验证了程序默认是在`MainThead`中执行。 -`t.getName()`获得这个线程的名字,其他常用方法,`getName()`获得线程`id`,`isAlive()`判断线程是否存活等。 +`t.getName()`获得这个线程的名字,其他常用方法,`t.ident`获得线程`id`,`isAlive()`判断线程是否存活等。 ```python print(t.getName()) # MainThread @@ -31,4 +31,4 @@ print(t.ident) # 139908235814720 print(t.isAlive()) # True ``` -
[上一个例子](117.md) [下一个例子](119.md)
\ No newline at end of file +
[上一个例子](117.md) [下一个例子](119.md)
From 4e58d55dcec9ab1b5c0e6f8d883bb9a1bf8a4fe9 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Fri, 9 Sep 2022 09:41:27 -0500 Subject: [PATCH 21/26] Update 123.md --- md/123.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/md/123.md b/md/123.md index 20f70c47..ccff06f5 100644 --- a/md/123.md +++ b/md/123.md @@ -54,10 +54,10 @@ t8 adds a to 1: 9 t9 adds a to 1: 10 ``` -一起正常,其实这已经是单线程顺序执行了,就本例子而言,已经失去多线程的价值,并且还带来了因为线程创建开销,浪费时间的副作用。 +一切正常,其实这已经是单线程顺序执行了,就本例子而言,已经失去多线程的价值,并且还带来了因为线程创建开销,浪费时间的副作用。 程序中只有一把锁,通过 `try...finally`还能确保不发生死锁。但是,当程序中启用多把锁,还是很容易发生死锁。 注意使用场合,避免死锁,是我们在使用多线程开发时需要注意的一些问题。 -
[上一个例子](122.md) [下一个例子](124.md)
\ No newline at end of file +
[上一个例子](122.md) [下一个例子](124.md)
From 7df363d6020d929d8346446388e4eb8ec7140fec Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 11 Jun 2023 19:33:10 -0500 Subject: [PATCH 22/26] Add files via upload --- script/avatar.png | Bin 0 -> 3357 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 script/avatar.png diff --git a/script/avatar.png b/script/avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..4455032c3cfa6a87b3926948efa29217e263922c GIT binary patch literal 3357 zcmV+&4dU{NP)Px>*GWV{RCr$Poo#F!M;XUw@9eAX#4j-|PVH8<8^?*0szDJHRUkW271An%N|b^G z5>TN^2o(tgA1D%P@+IvDB#__(5<=AlQ3=$1D5a$Vs@z3Im7=z6nzSK~)0~Av8 zYVCE`YX$F6*tSv3Aj^4uWbpY_?>EBG8I5oe?_c=o0el@*k^RIKd6^CfhHW2g1Sqrw zfJC<1=(8(RZ1Ay(_Fl^|e`!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xR9TD`}ibOE8_O96le0@2Y=1{3G*=E_p&ty*3uz}w+|!_-~(QP&bI$D(in;o?gJ z0Pi?tiYO)eSq2;Gx0&;S<4{U$UgYw zmUT*UeUQwFIe_H?1@ zyMuB7zZ1qFXz2<7qupa$6 zLbUj(G@z9OghD}5g<*`*KKd0kIIG@o0KvW2)Gz?7npR?$z)RIBYL Date: Sun, 3 Sep 2023 18:56:49 -0500 Subject: [PATCH 23/26] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 6028c228..327b5186 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,6 @@ 告别枯燥,告别枯燥,致力于打造 Python 经典小例子、小案例。 -同时托管在[Python中文网](http://www.zglg.work/python-small-examples/) - -使用Python制作的各种小工具:[Python实用小工具](http://www.zglg.work:5000/pytools) - ## License 允许按照要求转载,但禁止用于任何商用目的。如果转载本库小例子、小案例,请备注下方链接: From f6c6f1179e85ff53d583fde1e9ab7253bda373f2 Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Sun, 3 Sep 2023 18:57:38 -0500 Subject: [PATCH 24/26] Update README.md --- README.md | 104 ------------------------------------------------------ 1 file changed, 104 deletions(-) diff --git a/README.md b/README.md index 327b5186..8e1e9cda 100644 --- a/README.md +++ b/README.md @@ -269,107 +269,3 @@ Python小例子 https://github.com/jackzhenguo/python-small-examples | 28 | [求两点球面距离](md/199.md) | math asin | V1.0 | ⭐️⭐️⭐️⭐️⭐️ | | 29 | [获取文件编码](md/200.md) | chardet | V1.0 | ⭐️⭐️⭐️⭐️⭐️ | | 30 | [格式化json串](md/201.md) | json | V1.0 | ⭐️⭐️⭐️⭐️⭐️ | - - - -## Python原创教程 -这是经过很久打磨的一个Python教程,全部是个人原创,已首发在公众号,并且托管在我的[个人网站](http://www.zglg.work/python-level/)。 - -想系统入门Python的欢迎学习: - -[Python进阶完整教程](http://www.zglg.work/python-level/) - -[Python前言](http://www.zglg.work/Python-20-topics/intro-python/) - -[Google Python代码风格指南](http://www.zglg.work/Python-20-topics/google-python-coding-style/) - -Python关于数字的20个操作 - -[Python数字](http://www.zglg.work/Python-20-topics/python-number/) - -[Python正则之提取正整数和大于0浮点数](http://www.zglg.work/python-level/python-re-integer-float.md) - -[Python字符串](http://www.zglg.work/Python-20-topics/python-string/) - -[CSV读写乱码问题](http://www.zglg.work/Python-20-topics/csv-rw-coding-issue/) - -[Unicode标准化](http://www.zglg.work/Python-20-topics/unicode-standard/) - -[Unicode, UTF-8, ASCII](http://www.zglg.work/Python-20-topics/unicode-utf-8/) - -[Python动态生成变量](http://www.zglg.work/Python-20-topics/dynamic_variable/) - -[Python字符串对齐](http://www.zglg.work/Python-20-topics/python-string-align/) - -[Python小项目1:文本句子关键词的KWIC显示](http://www.zglg.work/Python-20-topics/python-project1-kwic/) - -[Python列表](http://www.zglg.work/Python-20-topics/python-list/) - -[Python流程控制](http://www.zglg.work/Python-20-topics/python-control/) - -[Python编程习惯专题](http://www.zglg.work/Python-20-topics/python-program-habit/) - -[Python函数专题](http://www.zglg.work/Python-20-topics/python-functions/) - -[Python面向对象编程-上篇](http://www.zglg.work/Python-20-topics/python-oop-1/) - -[Python面向对象编程-下篇](http://www.zglg.work/Python-20-topics/python-oop-2/) - -[Python十大数据结构使用专题](http://www.zglg.work/Python-20-topics/python-data-structure/) - -[Python包和模块使用注意事项专题](http://www.zglg.work/Python-20-topics/python-package-module-apply-items/) - -[Python正则使用专题](http://www.zglg.work/Python-20-topics/python-re-apply/) - -[Python时间专题](http://www.zglg.work/Python-20-topics/python-time/) - -[Python装饰器专题](http://www.zglg.work/Python-20-topics/python-decorator-apply/) - -[Python迭代器使用专题](http://www.zglg.work/Python-20-topics/python-iterator-apply/) - -[Python生成器使用专题](http://www.zglg.work/Python-20-topics/python-generator-apply/) - -[Python 绘图入门专题](http://www.zglg.work/Python-20-topics/python-graph-intro/) - -[Matplotlib绘图基础专题](http://www.zglg.work/Python-20-topics/python-matplotlib-1/) - -[Matplotlib绘图进阶专题](http://www.zglg.work/Python-20-topics/python-matplotlib-2/) - -[Matplotlib绘图案例](http://www.zglg.work/Python-20-topics/python-matplotlib-examples/) - -[NumPy图解入门](http://www.zglg.work/Python-20-topics/numpy-graph-intro/) - - -## NumPy入门教程 - -1 [NumPy介绍](http://www.zglg.work/numpy-intro/) - -2 [安装和导入NumPy](http://www.zglg.work/numpy/numpy-install/) - -3 [Python列表和NumPy数组有什么区别?](http://www.zglg.work/numpy/numpy-array-different-python-list/) - -4 [什么是array?](http://www.zglg.work/numpy/what-is-numpy/) - -5 [有关Array的详细信息](http://www.zglg.work/numpy/numpy-array-more/) - -6 [如何创建array](http://www.zglg.work/numpy/numpy-create-array/) - -7 [添加、删除和排序元素](http://www.zglg.work/numpy/numpy-add-remove-sort/) - -8 [数组形状和大小](http://www.zglg.work/numpy/numpy-shape/) - -9 [重塑array](http://www.zglg.work/numpy/numpy-reshape/) - -10 [如何将一维array转换为二维array(如何向数组添加新轴)](http://www.zglg.work/numpy/numpy-1d-2d-more/) - -11 [NumPy索引和切片](http://www.zglg.work/numpy/numpy-indexing-slicing/) - -12 [如何从现有数据创建数组](http://www.zglg.work/numpy/numpy-create-an-array-from-existing-data/) - -13 [数组基本操作](http://www.zglg.work/numpy/numpy-basic-array-operations/) - -14 [广播](http://www.zglg.work/numpy/numpy-broadcasting/) - -15 [更有用的数组操作](http://www.zglg.work/numpy/numpy-more-array-operations/) - -16 [生成随机数](http://www.zglg.work/numpy/numpy-generate-random-number/) From 4944885a61768bf9ac7dd7ec4c5bbf553675514e Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Wed, 26 Jun 2024 11:36:48 -0500 Subject: [PATCH 25/26] Update README.md --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e1e9cda..a3e3868e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ 允许按照要求转载,但禁止用于任何商用目的。如果转载本库小例子、小案例,请备注下方链接: -Python小例子 https://github.com/jackzhenguo/python-small-examples +[Python小例子](https://ai-jupyter.com/python-small-examples/) ## Python 小例子 @@ -269,3 +269,32 @@ Python小例子 https://github.com/jackzhenguo/python-small-examples | 28 | [求两点球面距离](md/199.md) | math asin | V1.0 | ⭐️⭐️⭐️⭐️⭐️ | | 29 | [获取文件编码](md/200.md) | chardet | V1.0 | ⭐️⭐️⭐️⭐️⭐️ | | 30 | [格式化json串](md/201.md) | json | V1.0 | ⭐️⭐️⭐️⭐️⭐️ | + +### 更多教程 + +[AI消息](https://ai-jupyter.com/) + +[AI新闻报道](https://ai-jupyter.com/ai-news-all/) + +[AI大模型](https://ai-jupyter.com/ai-llm/) + +[AI工具集](https://ai-jupyter.com/ai-chatgpt/) + +[ChatGPT4o免费使用六种方法](https://ai-jupyter.com/ai-chatgpt/) + +[Python教程](https://ai-jupyter.com/python-packages/) + +[数据分析教程](https://ai-jupyter.com/numpy-intro/) + +[算法教程](https://ai-jupyter.com/algorithm-basic/) + +[AI教程](https://ai-jupyter.com/statistics/) + +[Git教程](https://ai-jupyter.com/git/) + +[程序员](https://ai-jupyter.com/others/) + +[资料下载](https://ai-jupyter.com/python-20/) + + + From aa11da6ac252f13bda7eaff976ca06446c70ef6d Mon Sep 17 00:00:00 2001 From: jackzhenguo Date: Wed, 26 Jun 2024 11:37:35 -0500 Subject: [PATCH 26/26] Update README.md --- README.md | 54 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index a3e3868e..91ab7d1f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,34 @@ 允许按照要求转载,但禁止用于任何商用目的。如果转载本库小例子、小案例,请备注下方链接: -[Python小例子](https://ai-jupyter.com/python-small-examples/) +[Python小例子所有汇总](https://ai-jupyter.com/python-small-examples/) + +### 更多教程 + +[AI消息](https://ai-jupyter.com/) + +[AI新闻报道](https://ai-jupyter.com/ai-news-all/) + +[AI大模型](https://ai-jupyter.com/ai-llm/) + +[AI工具集](https://ai-jupyter.com/ai-chatgpt/) + +[ChatGPT4o免费使用六种方法](https://ai-jupyter.com/ai-chatgpt/) + +[Python教程](https://ai-jupyter.com/python-packages/) + +[数据分析教程](https://ai-jupyter.com/numpy-intro/) + +[算法教程](https://ai-jupyter.com/algorithm-basic/) + +[AI教程](https://ai-jupyter.com/statistics/) + +[Git教程](https://ai-jupyter.com/git/) + +[程序员](https://ai-jupyter.com/others/) + +[资料下载](https://ai-jupyter.com/python-20/) + ## Python 小例子 @@ -270,31 +297,6 @@ | 29 | [获取文件编码](md/200.md) | chardet | V1.0 | ⭐️⭐️⭐️⭐️⭐️ | | 30 | [格式化json串](md/201.md) | json | V1.0 | ⭐️⭐️⭐️⭐️⭐️ | -### 更多教程 - -[AI消息](https://ai-jupyter.com/) - -[AI新闻报道](https://ai-jupyter.com/ai-news-all/) - -[AI大模型](https://ai-jupyter.com/ai-llm/) - -[AI工具集](https://ai-jupyter.com/ai-chatgpt/) - -[ChatGPT4o免费使用六种方法](https://ai-jupyter.com/ai-chatgpt/) - -[Python教程](https://ai-jupyter.com/python-packages/) - -[数据分析教程](https://ai-jupyter.com/numpy-intro/) - -[算法教程](https://ai-jupyter.com/algorithm-basic/) - -[AI教程](https://ai-jupyter.com/statistics/) - -[Git教程](https://ai-jupyter.com/git/) - -[程序员](https://ai-jupyter.com/others/) - -[资料下载](https://ai-jupyter.com/python-20/)