count () function to derive a list of the formula
In [85]:
The number of occurrences of the word # statistics for each element specified in the list
words=['apple','pare','banana','and','peach','Anda']
for word in words:
Print ( Word. Lower (). COUNT ( 'A')) #lower () is case-sensitive
In [86]:
[
word for word in words if word.lower().count('a')>=2]
Out[86]:
In [69]:
strings=['a','bv','tit','apple','ctr']
[x.title() for x in strings if len(x)>2]
Out[69]:
In [74]:
list(map(len,strings))
Out[74]:
TRANSPOSE () transpose
In [88]:
import numpy as np
three=np.arange(18).reshape(2,3,3)
In [89]:
three
Out[89]:
In [97]:
three.transpose(2,1,0)
Out[97]: