{"id":8932,"date":"2024-05-02T18:01:01","date_gmt":"2024-05-02T10:01:01","guid":{"rendered":""},"modified":"2024-05-02T18:01:01","modified_gmt":"2024-05-02T10:01:01","slug":"python\u8d28\u6570\u5217_Python\u4e2d\u5e38\u7528\u5185\u7f6e\u51fd\u6570\u4ecb\u7ecd(filter,map,reduce,apply,zip)","status":"publish","type":"post","link":"https:\/\/mushiming.com\/8932.html","title":{"rendered":"python\u8d28\u6570\u5217_Python\u4e2d\u5e38\u7528\u5185\u7f6e\u51fd\u6570\u4ecb\u7ecd(filter,map,reduce,apply,zip)"},"content":{"rendered":"
\n

Python\u662f\u4e00\u95e8\u5f88\u7b80\u6d01\uff0c\u5f88\u4f18\u96c5\u7684\u8bed\u8a00\uff0c\u5176\u5f88\u591a\u5185\u7f6e\u51fd\u6570\u7ed3\u5408\u8d77\u6765\u4f7f\u7528\uff0c\u53ef\u4ee5\u4f7f\u7528\u5f88\u5c11\u7684\u4ee3\u7801\u6765\u5b9e\u73b0\u5f88\u591a\u590d\u6742\u7684\u529f\u80fd\uff0c\u5982\u679c\u540c\u6837\u7684\u529f\u80fd\u8981\u8ba9C\/C++\/Java\u6765\u5b9e\u73b0\u7684\u8bdd\uff0c\u53ef\u80fd\u4f1a\u5934\u5927\uff0c\u5176\u5b9ePython\u662f\u5c06\u590d\u6742\u7684\u6570\u636e\u7ed3\u6784\u9690\u85cf\u5728\u5185\u7f6e\u51fd\u6570\u4e2d\uff0c\u53ea\u8981\u5199\u51fa\u81ea\u5df1\u7684\u4e1a\u52a1\u903b\u8f91Python\u4f1a\u81ea\u52a8\u5f97\u51fa\u4f60\u60f3\u8981\u7684\u7ed3\u679c\u3002\u8fd9\u65b9\u9762\u7684\u5185\u7f6e\u51fd\u6570\u4e3b\u8981\u6709,filter,map,reduce,apply,\u7ed3\u5408\u533f\u540d\u51fd\u6570\uff0c\u5217\u8868\u89e3\u6790\u4e00\u8d77\u4f7f\u7528\uff0c\u529f\u80fd\u66f4\u52a0\u5f3a\u5927.\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\u6700\u663e\u800c\u6613\u89c1\u7684\u597d\u5904\u662f:<\/p>\n

1. \u901f\u5ea6\u5feb\uff0c\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\uff0c\u6bd4\u666e\u901a\u7684PYTHON\u5b9e\u73b0\uff0c\u901f\u5ea6\u8981\u5feb\u4e00\u500d\u5de6\u53f3\u3002\u76f8\u5f53\u4e8eC\/C++\u7684\u901f\u5ea6<\/p>\n

2. \u4ee3\u7801\u7b80\u6d01<\/p>\n

filter:<\/p>\n

\u8bed\u6cd5:<\/p>\n

>>> help(filter)<\/p>\n

Help on built-in function filter in module __builtin__:<\/p>\n

filter(...)<\/p>\n

filter(function or None, sequence) -> list, tuple, or string<\/p>\n

Return those items of sequence for which function(item) is true. If<\/p>\n

function is None, return the items that are true. If sequence is a tuple<\/p>\n

or string, return the same type, else return a list.<\/p>\n

\u7528\u9014:<\/p>\n

\u7528\u4e8e\u8fc7\u6ee4\u4e0e\u51fd\u6570func()\u4e0d\u5339\u914d\u7684\u503c, \u7c7b\u4f3c\u4e8eSQL\u4e2dselect value != \u2018a\u2018<\/p>\n

\u76f8\u5f53\u4e8e\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u8c03\u7528\u4e00\u4e2a\u5e03\u5c14\u51fd\u6570func\u6765\u8fed\u4ee3seq\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\uff0c\u8fd4\u56de\u4e00\u4e2a\u662fbool_seq\u8fd4\u56de\u4e3aTrue\u7684\u5e8f\u5217<\/p>\n

>>>\u7b2c\u4e00\u4e2a\u53c2\u6570: function or None, \u51fd\u6570\u6216None<\/p>\n

>>>\u7b2c\u4e8c\u4e2a\u53c2\u6570: sequence,\u5e8f\u5217<\/p>\n

\u8bf4\u660e:<\/p>\n

>>>\u5982\u679c\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e3afunction,\u90a3\u4e48\u8fd4\u56de\u6761\u4ef6\u4e3a\u771f\u7684\u5e8f\u5217(\u5217\u8868\uff0c\u5143\u7956\u6216\u5b57\u7b26\u4e32)<\/p>\n

>>>\u5982\u679c\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e3aNone\u7684\u8bdd,\u90a3\u4e48\u8fd4\u56de\u5e8f\u5217\u4e2d\u6240\u6709\u4e3aTrue\u7684\u9879\u76ee<\/p>\n

\u4f8b1: \u8981\u8fc7\u6ee4\u6389\u6240\u6709\u503c\u4e3aFalse\u7684\u5217\u8868<\/p>\n

print filter(None,[-2,0,2,'',{},()]) #\u8f93\u51fa[-2,2],\u5176\u4f59\u7684\u90fd\u4e3aFalse<\/p>\n

\u4f8b2: \u8981\u8fc7\u6ee4\u67d0\u4e2a\u5b57\u6bcd<\/p>\n

>>> filter(lambda x: x !=\u2018a\u2018,\u2018abcd\u2018)<\/p>\n

\u2018bcd\u2018<\/p>\n

\u4f8b3: \u8fc7\u6ee4\u5b57\u6bcd\u4ee5B\u5f00\u5934\u7684\u4eba\u540d<\/p>\n

>>> names = [\u2018Alice\u2018,\u2018Bob\u2018,\u2018Smith\u2018,\u2018David\u2018,\u2018Barbana\u2018]<\/p>\n

>>> filter(lambda x: x.startswith(\u2018B\u2018),names)<\/p>\n

[\u2018Bob\u2018, \u2018Barbana\u2018]<\/p>\n

\u4f8b4: \u8981\u8fc7\u6ee4fib\u5217\u8868\u4e2d\u7684\u5947\u6570\uff0c\u5076\u6570\u9879<\/p>\n

>>> fib = [0,1,1,2,3,5,8,13,21]<\/p>\n

>>> filter(lambda x: x%2,fib)   #\u5b9e\u9645\u4e0a\u7b49\u540c\u4e8ex%2 == 1\u7684\u9879\u624d\u8fc7\u6ee4<\/p>\n

[1, 1, 3, 5, 13, 21]<\/p>\n

>>> filter(lambda x: x%2 ==0,fib)<\/p>\n

[0, 2, 8]<\/p>\n

\u4f8b5: \u8981\u5c062-20\u95f4\u6240\u6709\u8d28\u6570\u5217\u51fa\u6765<\/p>\n

>>> filter(lambda x: not [x%i for i in range(2,x) if x%i == 0],range(2,20))<\/p>\n

[2, 3, 5, 7, 11, 13, 17, 19]<\/p>\n

\u4f8b6: \u8981\u8fc7\u6ee4\u6240\u6709\u5b50\u5217\u8868\u4e2d\uff0c\u5355\u8bcd\u4e3a\u2018Python\u2018\u7684.<\/p>\n

def filter_word(word):<\/p>\n

try:<\/p>\n

return word != 'Python'<\/p>\n

except ValueError:<\/p>\n

return False<\/p>\n

words = [['Perl','Python','Shell'],['Java','C\/C++'],['VB','Dephi']]<\/p>\n

print [filter(filter_word,word) for word in words]<\/p>\n

#\u7528\u4e86\u5217\u8868\u89e3\u6790\u7684\u65b9\u6cd5<\/p>\n

filter\u7684\u903b\u8f91\u5b9e\u73b0:<\/p>\n

def filter(func,seq):<\/p>\n

f_seq = [] #\u5efa\u4e00\u4e2a\u7a7a\u5e8f\u5217\uff0c\u7528\u4e8e\u5b58\u50a8\u8fc7\u6ee4\u540e\u7684\u5143\u7d20<\/p>\n

for item in seq: #\u5bf9\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8fdb\u884c\u8fed\u4ee3<\/p>\n

if func(item): #\u5982\u679c\u4e3a\u771f\u7684\u8bdd<\/p>\n

f_seq.append(item) #\u6ee1\u8db3\u6761\u4ef6\u8005\uff0c\u5219\u52a0\u5165<\/p>\n

return f_seq #\u8fd4\u56de\u8fc7\u6ee4\u540e\u7684\u5143\u7d20<\/p>\n

print filter(lambda x: x> 0,[-2,0, 2]) #\u5bf9\u533f\u540d\u51fd\u6570\u8fdb\u884c\u8fc7\u6ee4\uff0c\u8fd4\u56de\u6b63\u503c<\/p>\n

>>><\/p>\n

[2]map:>>> help(map)<\/p>\n

Help on built-in function map in module __builtin__:<\/p>\n

map(...)<\/p>\n

map(function, sequence[, sequence, ...]) -> list<\/p>\n

Return a list of the results of applying the function to the items of<\/p>\n

the argument sequence(s). If more than one sequence is given, the<\/p>\n

function is called with an argument list consisting of the corresponding<\/p>\n

item of each sequence, substituting None for missing values when not all<\/p>\n

sequences have the same length. If the function is None, return a list of<\/p>\n

the items of the sequence (or a list of tuples if more than one sequence).\u7528\u9014:<\/p>\n

>>>\u5bf9\u4e00\u4e2a\u53ca\u591a\u4e2a\u5e8f\u5217\u6267\u884c\u540c\u4e00\u4e2a\u64cd\u4f5c\uff0c\u8fd4\u56de\u4e00\u4e2a\u5217\u8868<\/p>\n

\u8bf4\u660e:<\/p>\n

1. \u8fd4\u56de\u4e00\u4e2a\u5217\u8868\uff0c\u8be5\u5217\u8868\u662f\u53c2\u6570func\u5bf9seq1,seq2\u5904\u7406\u7684\u7ed3\u679c\u96c6<\/p>\n

2. \u53ef\u4ee5\u6709\u591a\u4e2a\u5e8f\u5217,\u5982\u679c\u51fd\u6570\u4e3aNone\u7684\u8bdd\uff0c\u8fd4\u56de\u4e00\u4e2a\u5e8f\u5217\u7684\u5217\u8868<\/p>\n

\u4f8b1:\u5e38\u89c4\u7528\u6cd5<\/p>\n

>>> map(lambda x: x+1,[1,2,3,4])<\/p>\n

[2, 3, 4, 5]<\/p>\n

>>> map(lambda x,y: x+y,[1,2,3,4],(10,20,30,40))<\/p>\n

[11, 22, 33, 44]<\/p>\n

>>> map(lambda x,y: x+y if y else x+10,[1,2,3,4,5],(1,2,3,4))<\/p>\n

#\u7b2c\u4e00\u4e2a\u5e8f\u5217\u4e2d\u7684\u7b2c\u4e94\u4e2a\u5143\u7d20\u5b58\u5728,\u4f46\u5728\u7b2c\u4e8c\u4e2a\u5e8f\u5217\u4e2d\u4e0d\u5b58\u5728\uff0c\u6240\u4ee5y\u4e3aFalse,\u6240\u4ee5\u6267\u884c5+10<\/p>\n

[2, 4, 6, 8, 14]<\/p>\n

>>> map(None,[1,2,3,4,5],(1,2)) #\u5982\u679c\u662fNone\u7684\u8bdd\uff0c\u4ee5None\u6765\u8865\u9f50\u77ed\u5e8f\u5217\u9020\u6210\u7684\u7a7a\u7f3a<\/p>\n

[(1, 1), (2, 2), (3, None), (4, None), (5, None)]<\/p>\n

>>> names = [\u2018Alice\u2018,\u2018Jerry\u2018,\u2018Bob\u2018,\u2018Barbar\u2018]<\/p>\n

>>> map(len,names)        #\u6c42\u5217\u8868\u4e2d\u6bcf\u4e2a\u5143\u7d20\u7684\u957f\u5ea6<\/p>\n

[5, 5, 3, 6]<\/p>\n

\u4f8b2: \u6c420-5\u4e4b\u95f4\u6570\uff0c[\u672c\u8eab\uff0c\u5e73\u65b9\uff0c\u7acb\u65b9],\u5982:\u5143\u7d202\uff0c\u5219\u8fd4\u56de:[2,4,8]<\/p>\n

def func1(x): return x #\u8fd4\u56de\u81ea\u8eab<\/p>\n

def func2(x): return x ** 2 #\u8fd4\u56de\u5e73\u65b9<\/p>\n

def func3(x): return x ** 3 #\u8fd4\u56de\u7acb\u65b9<\/p>\n

funcs = [func1,func2,func3] #\u51fd\u6570\u5217\u8868<\/p>\n

for i in range(5): #\u904d\u5386\u5217\u8868<\/p>\n

print map(lambda func: func(i),funcs)#\u5bf9\u5176\u4e2d\u6bcf\u4e2a\u5143\u7d20\u6267\u884cfunc1(i),func2(i),func3(i)\u64cd\u4f5c\u4f8b3: \u5b9e\u73b0\u4e0b\u9762\u7684\u903b\u8f91\u7ed3\u6784<\/p>\n

1.0 [1,2,3,4,5]<\/p>\n

2.0 [1,2,3,4,5]<\/p>\n

....<\/p>\n

foos = [1.0,2.0,3.0,4.0,5.0]<\/p>\n

bars = [1,2,3,4,5]<\/p>\n

def test(foo):<\/p>\n

print foo,bars<\/p>\n

print map(test,foos)map\u7684\u5b9e\u73b0\u903b\u8f91def map(func,seq):<\/p>\n

map_seq = [] #\u5efa\u7a7a\u5e8f\u5217<\/p>\n

for item in seq: #\u5bf9\u5e8f\u5217\u4e2d\u6bcf\u4e2a\u5143\u7d20\u8fdb\u884c\u5904\u7406<\/p>\n

map_seq.append(func(item)) #\u5f80\u7a7a\u5e8f\u5217\u4e2d\u6dfb\u52a0func\u5904\u7406\u8fc7\u7684\u5143\u7d20<\/p>\n

return map_seq #\u8fd4\u56de\u6700\u540e\u7684\u5217\u8868<\/p>\n

print map(lambda x: x * 2,[1,2,3,4]) #[2,4,6,8]reduce:<\/p>\n

\u7528\u9014:<\/p>\n

func\u4e3a\u4e8c\u5143\u51fd\u6570\uff0c\u5c06func\u4f5c\u7528\u4e8eseq\u5e8f\u5217\u7684\u5143\u7d20\uff0c\u6bcf\u6b21\u643a\u5e26\u4e00\u5bf9(\u5148\u524d\u7684\u7ed3\u679c\u4ee5\u53ca\u4e0b\u4e00\u4e2a\u5e8f\u5217\u7684\u5143\u7d20)\uff0c\u8fde\u7eed\u7684\u5c06\u73b0\u6709\u7684\u7ed3\u679c\u548c\u4e0b\u4e00\u4e2a\u503c\u4f5c\u7528\u5728\u83b7\u5f97\u7684\u968f\u540e\u7684\u7ed3\u679c\u4e0a\uff0c\u6700\u540e\u51cf\u5c11\u6211\u4eec\u7684\u5e8f\u5217\u4e3a\u4e00\u4e2a\u5355\u4e00\u7684\u8fd4\u56de\u503c\uff1a\u5982\u679c\u521d\u59cb\u503cinit\u7ed9\u5b9a\uff0c\u7b2c\u4e00\u4e2a\u6bd4\u8f83\u4f1a\u662finit\u548c\u7b2c\u4e00\u4e2a\u5e8f\u5217\u5143\u7d20\u800c\u4e0d\u662f\u5e8f\u5217\u7684\u5934\u4e24\u4e2a\u5143\u7d20\u3002<\/p>\n

\u8bf4\u660e:<\/p>\n

>>> help(reduce)<\/p>\n

Help on built-in function reduce in module __builtin__:<\/p>\n

reduce(...)<\/p>\n

reduce(function, sequence[, initial]) -> value<\/p>\n

Apply a function of two arguments cumulatively to the items of a sequence,<\/p>\n

from left to right, so as to reduce the sequence to a single value.<\/p>\n

For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates<\/p>\n

((((1+2)+3)+4)+5). If initial is present, it is placed before the items<\/p>\n

of the sequence in the calculation, and serves as a default when the<\/p>\n

sequence is empty.<\/p>\n

\u4f8b\u5b50:<\/p>\n

>>> reduce(lambda x,y: x+y, [47,11,42,13])<\/p>\n

113<\/p>\n

\u5176\u5b9e\u73b0\u8fc7\u7a0b\u5982\u4e0b\u56fe\u6240\u793a:<\/p>\n

\"python\u8d28\u6570\u5217_Python\u4e2d\u5e38\u7528\u5185\u7f6e\u51fd\u6570\u4ecb\u7ecd(filter,map,reduce,apply,zip)<\/p>\n

reduce\u7684\u903b\u8f91\u5b9e\u73b0:<\/p>\n

def reduce(func,seq,init=None):<\/p>\n

l_seq = list(seq) #\u5148\u8f6c\u4e3a\u5217\u8868<\/p>\n

if init is None: #\u5982\u679c\u521d\u59cb\u503c<\/p>\n

res = l_seq.pop(0)<\/p>\n

else:<\/p>\n

res = init<\/p>\n

for item in l_seq:<\/p>\n

res = func(res,item) #func(res,item)\u4f5c\u4e3a\u7ed3\u679c\u96c6\u4f20\u7ed9res<\/p>\n

return res #\u8fd4\u56de\u7ed3\u679c\u96c6<\/p>\n

print reduce(lambda x,y:x+y,[1,2,3,4]) #\u7ed3\u679c\u4e3a10<\/p>\n

print reduce(lambda x,y:x+y,[1,2,3,4],10) #\u7ed3\u679c\u4e3a20,init\u521d\u59cb\u503c\u4e3a10apply:<\/p>\n

\u8bed\u6cd5:<\/p>\n

>>> help(apply)<\/p>\n

Help on built-in function apply in module __builtin__:<\/p>\n

apply(...)<\/p>\n

apply(object[, args[, kwargs]]) -> value<\/p>\n

Call a callable object with positional arguments taken from the tuple args,<\/p>\n

and keyword arguments taken from the optional dictionary kwargs.<\/p>\n

Note that classes are callable, as are instances with a __call__() method<\/p>\n

Deprecated since release 2.3. Instead, use the extended call syntax:<\/p>\n

function(*args, **keywords).<\/p>\n

\u7528\u9014:<\/p>\n

>>>\u5f53\u4e00\u4e2a\u51fd\u6570\u7684\u53c2\u6570\u5b58\u5728\u4e8e\u4e00\u4e2a\u5143\u7ec4\u6216\u8005\u4e00\u4e2a\u5b57\u5178\u4e2d\u65f6\uff0c\u7528\u6765\u95f4\u63a5\u7684\u8c03\u7528\u8fd9\u4e2a\u51fd\u6570\uff0c\u5143\u7ec4\u6216\u8005\u5b57\u5178\u4e2d\u7684\u53c2\u6570\u6309\u7167\u987a\u5e8f\u4f20\u9012<\/p>\n

\u8bf4\u660e:<\/p>\n

1. args\u662f\u4e00\u4e2a\u5305\u542b\u6309\u7167\u51fd\u6570\u6240\u9700\u53c2\u6570\u4f20\u9012\u7684\u4f4d\u7f6e\u53c2\u6570\u7684\u4e00\u4e2a\u5143\u7ec4\uff0c\u5047\u5982func(a=1,b=2),\u90a3\u4e48\u8fd9\u4e2a\u5143\u7ec4\u4e2d\u5c31\u5fc5\u987b\u4e25\u683c\u6309\u7167\u8fd9\u4e2a\u53c2\u6570\u7684\u4f4d\u7f6e\u987a\u5e8f\u8fdb\u884c\u4f20\u9012(a=3,b=4)\uff0c\u800c\u4e0d\u80fd\u662f(b=4,a=3)\u8fd9\u6837\u7684\u987a\u5e8f<\/p>\n

2. kwargs\u662f\u4e00\u4e2a\u5305\u542b\u5173\u952e\u5b57\u53c2\u6570\u7684\u5b57\u5178\uff0c\u800c\u5176\u4e2dargs\u5982\u679c\u4e0d\u4f20\u9012\uff0ckwargs\u9700\u8981\u4f20\u9012\uff0c\u5219\u5fc5\u987b\u5728args\u7684\u4f4d\u7f6e\u7559\u7a7a<\/p>\n

3. apply\u51fd\u6570\u7684\u8fd4\u56de\u503c\u5c31\u662ffunc\u51fd\u6570\u7684\u8fd4\u56de\u503c.<\/p>\n

\u4f8b1\uff1a \u5e38\u89c4\u4f7f\u7528<\/p>\n

def func1(): #\u65e0\u53c2\u51fd\u6570<\/p>\n

print 'No Args!'<\/p>\n

def func2(arg1,arg2): #\u4e24\u4e2a\u53c2\u6570<\/p>\n

print arg1,arg2<\/p>\n

def func3(arg1=1,arg2=2): #\u5e26\u5b57\u5178\u51fd\u6570<\/p>\n

print arg1,arg2<\/p>\n

if __name__=='__main__':<\/p>\n

apply(func1)<\/p>\n

apply(func2,('Hello','World!'))<\/p>\n

apply(func3,(),{'arg1':'This is param1','arg2':'This is param2'}) #\u6ce8\u610f\u5143\u7956\u53c2\u6570\u4e3a()<\/p>\n

zip<\/p>\n

>>> help(zip)<\/p>\n

Help on built-in function zip in module __builtin__:<\/p>\n

zip(...)<\/p>\n

zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)]<\/p>\n

Return a list of tuples, where each tuple contains the i-th element<\/p>\n

from each of the argument sequences. The returned list is truncated<\/p>\n

in length to the length of the shortest argument sequence.\u7528\u9014:<\/p>\n

>>>\u8fd4\u56de\u4e00\u4e2a\u5143\u7956\u5217\u8868\uff0c\u8be5\u5143\u7956\u6309\u987a\u5e8f\u5305\u542b\u6bcf\u4e2a\u5e8f\u5217\u7684\u76f8\u5e94\u5143\u7d20\uff0c\u4ee5\u6700\u5c0f\u7684\u4e00\u4e2a\u4e3a\u51c6<\/p>\n

\u8bf4\u660e:<\/p>\n

>>>\u8fd9\u4e2a\u5185\u7f6e\u51fd\u6570\u5176\u5b9e\u6bd4\u8f83\u597d\u7406\u89e3\uff0c\u8fd4\u56de\u7684\u5bf9\u8c61\u5c31\u662f\u4e00\u4e2a\u5143\u7956\u5217\u8868\uff0c\u770b\u4f8b\u5b50\u5c31\u597d\u660e\u767d<\/p>\n

\u4f8b\u5b50:<\/p>\n

>>> zip(range(5),range(1,20,2))<\/p>\n

[(0, 1), (1, 3), (2, 5), (3, 7), (4, 9)]<\/p>\n

>>> x=(1,2,3); y=(4,5);z=(6,)<\/p>\n

>>> zip(x,y,z)<\/p>\n

[(1, 4, 6)]<\/p>\n

\u53ef\u4ee5\u53c2\u770b\u8fd9\u4e2a\u7efc\u5408\u4f8b\u5b50:<\/p>\n

http:\/\/www.360doc.com\/content\/14\/0507\/11\/7821691_375450523.shtml<\/p>\n

http:\/\/my.oschina.net\/cloudcoder\/blog\/226461<\/p>\n

\u539f\u6587\uff1ahttp:\/\/blog.csdn.net\/jerry_1126\/article\/details\/41143579<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"python\u8d28\u6570\u5217_Python\u4e2d\u5e38\u7528\u5185\u7f6e\u51fd\u6570\u4ecb\u7ecd(filter,map,reduce,apply,zip)Python\u662f\u4e00\u95e8\u5f88\u7b80\u6d01\uff0c\u5f88\u4f18\u96c5\u7684\u8bed\u8a00\uff0c\u5176\u5f88\u591a\u5185\u7f6e\u51fd\u6570\u7ed3...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8932"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=8932"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8932\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=8932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=8932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=8932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}