为什么要来东时学习Python

我希望初学Python时就能知道的一些用法 - Python - 伯乐在线
& 我希望初学Python时就能知道的一些用法
有时候我反问我自己,怎么不知道在Python 3中用更简单的方式做“这样”的事,当我寻求答案时,随着时间的推移,我当然发现更简洁、有效并且bug更少的代码。总的来说(不仅仅是这篇文章),“那些”事情总共数量是超过我想象的,但这里是第一批不明显的特性,后来我寻求到了更有效的/简单的/可维护的代码。
字典中的keys()和items()
你能在字典的keys和items中做很多有意思的操作,它们类似于集合(set):
aa = {‘mike’: ‘male’, ‘kathy’: ‘female’, ‘steve’: ‘male’, ‘hillary’: ‘female’}
bb = {‘mike’: ‘male’, ‘ben’: ‘male’, ‘hillary’: ‘female’}
aa.keys() & bb.keys() # {‘mike’, ‘hillary’} # these are set-like
aa.keys() - bb.keys() # {‘kathy’, ‘steve’}
# If you want to get the common key-value pairs in the two dictionaries
aa.items() & bb.items() # {(‘mike’, ‘male’), (‘hillary’, ‘female’)}
aa = {‘mike’: ‘male’, ‘kathy’: ‘female’, ‘steve’: ‘male’, ‘hillary’: ‘female’}&bb = {‘mike’: ‘male’, ‘ben’: ‘male’, ‘hillary’: ‘female’}&aa.keys() & bb.keys() # {‘mike’, ‘hillary’} # these are set-likeaa.keys() - bb.keys() # {‘kathy’, ‘steve’}# If you want to get the common key-value pairs in the two dictionariesaa.items() & bb.items() # {(‘mike’, ‘male’), (‘hillary’, ‘female’)}
太简洁啦!
在字典中校验一个key的存在
下面这段代码你写了多少遍了?
dictionary = {}
for k, v in ls:
if not k in dictionary:
dictionary[k] = []
dictionary[k].append(v)
dictionary = {}for k, v in ls:&&&&if not k in dictionary:&&&&&&&&dictionary[k] = []&&&&dictionary[k].append(v)
这段代码其实没有那么糟糕,但是为什么你一直都需要用if语句呢?
from collections import defaultdict
dictionary = defaultdict(list) # defaults to list
for k, v in ls:
dictionary[k].append(v)
from collections import defaultdictdictionary = defaultdict(list) # defaults to listfor k, v in ls:&&&&dictionary[k].append(v)
这样就更清晰了,没有一个多余而模糊的if语句。
用另一个字典来更新一个字典
from itertools import chain
a = {‘x’: 1, ‘y’:2, ‘z’:3}
b = {‘y’: 5, ‘s’: 10, ‘x’: 3, ‘z’: 6}
# Update a with b
c = dict(chain(a.items(), b.items()))
c # {‘y’: 5, ‘s’: 10, ‘x’: 3, ‘z’: 6}
from itertools import chaina = {‘x’: 1, ‘y’:2, ‘z’:3}b = {‘y’: 5, ‘s’: 10, ‘x’: 3, ‘z’: 6}&# Update a with b c = dict(chain(a.items(), b.items()))c # {‘y’: 5, ‘s’: 10, ‘x’: 3, ‘z’: 6}
这样看起来还不错,但是不够简明。看看我们是否能做得更好:
c = a.copy()
c.update(b)
c = a.copy()c.update(b)
更清晰而且更有可读性了!
从一个字典获得最大值
如果你想获取一个字典中的最大值,可能会像这样直接:
aa = {k: sum(range(k)) for k in range(10)}
aa # {0: 0, 1: 0, 2: 1, 3: 3, 4: 6, 5: 10, 6: 15, 7: 21, 8: 28, 9: 36}
max(aa.values()) #36
aa = {k: sum(range(k)) for k in range(10)}aa # {0: 0, 1: 0, 2: 1, 3: 3, 4: 6, 5: 10, 6: 15, 7: 21, 8: 28, 9: 36}max(aa.values()) #36
这么做是有效的,但是如果你需要key,那么你就需要在value的基础上再找到key。然而,我们可以用过zip来让展现更扁平化,并返回一个如下这样的key-value形式:
max(zip(aa.values(), aa.keys()))
# (36, 9) =& value, key pair
max(zip(aa.values(), aa.keys()))# (36, 9) =& value, key pair
同样地,如果你想从最大到最小地去遍历一个字典,你可以这么干:
sorted(zip(aa.values(), aa.keys()), reverse=True)
# [(36, 9), (28, 8), (21, 7), (15, 6), (10, 5), (6, 4), (3, 3), (1, 2), (0, 1), (0, 0)]
sorted(zip(aa.values(), aa.keys()), reverse=True)# [(36, 9), (28, 8), (21, 7), (15, 6), (10, 5), (6, 4), (3, 3), (1, 2), (0, 1), (0, 0)]
在一个list中打开任意数量的items
我们可以运用*的魔法,获取任意的items放到list中:
def compute_average_salary(person_salary):
person, *salary = person_salary
return person, (sum(salary) / float(len(salary)))
person, average_salary = compute_average_salary([“mike”, 4, 60000])
person # ‘mike’
average_salary # 50000.0
def compute_average_salary(person_salary):&&&&person, *salary = person_salary&&&&return person, (sum(salary) / float(len(salary)))&person, average_salary = compute_average_salary([“mike”, 40000, 50000, 60000])person # ‘mike’average_salary # 50000.0
这不是那么有趣,但是如果我告诉你也可以像下面这样呢:
def compute_average_salary(person_salary_age):
person, *salary, age = person_salary_age
return person, (sum(salary) / float(len(salary))), age
person, average_salary, age = compute_average_salary([“mike”, 4, 60000, 42])
def compute_average_salary(person_salary_age):&&&&person, *salary, age = person_salary_age&&&&return person, (sum(salary) / float(len(salary))), age&person, average_salary, age = compute_average_salary([“mike”, 40000, 50000, 60000, 42])age # 42
看起来很简洁嘛!
当你想到有一个字符串类型的key和一个list的value的字典,而不是遍历一个字典,然后顺序地处理value,你可以使用一个更扁平的展现(list中套list),像下面这样:
# Instead of doing this
for k, v in dictionary.items():
process(v)
# we are separating head and the rest, and process the values
# as a list similar to the above. head becomes the key value
for head, *rest in ls:
process(rest)
# if not very clear, consider the following example
aa = {k: list(range(k)) for k in range(5)} # range returns an iterator
aa # {0: [], 1: [0], 2: [0, 1], 3: [0, 1, 2], 4: [0, 1, 2, 3]}
for k, v in aa.items():
aa = [[ii] + list(range(jj)) for ii, jj in enumerate(range(5))]
for head, *rest in aa:
print(sum(rest))
12345678910111213141516171819202122232425262728293031
# Instead of doing thisfor k, v in dictionary.items():&&&&process(v)&# we are separating head and the rest, and process the values# as a list similar to the above. head becomes the key valuefor head, *rest in ls:&&&&process(rest)&# if not very clear, consider the following exampleaa = {k: list(range(k)) for k in range(5)} # range returns an iteratoraa # {0: [], 1: [0], 2: [0, 1], 3: [0, 1, 2], 4: [0, 1, 2, 3]}for k, v in aa.items():&&&&sum(v)&#0#0#1#3#6&# Insteadaa = [[ii] + list(range(jj)) for ii, jj in enumerate(range(5))]for head, *rest in aa:&&&&print(sum(rest))&#0#0#1#3#6
你可以把list解压成head,*rest,tail等等。
Collections用作计数器
Collections是我在python中最喜欢的库之一,在python中,除了原始的默认的,如果你还需要其他的数据结构,你就应该看看这个。
我日常基本工作的一部分就是计算大量而又不是很重要的词。可能有人会说,你可以把这些词作为一个字典的key,他们分别的值作为value,在我没有接触到collections中的Counter时,我可能会同意你的做法(是的,做这么多介绍就是因为Counter)。
假设你读的python语言的维基百科,转化为一个字符串,放到一个list中(标记好顺序):
word_list = list(map(lambda k: k.lower().strip(), re.split(r’[;,:(.s)]s*’, python_string)))
word_list[:10] # [‘python’, ‘is’, ‘a’, ‘widely’, ‘used’, ‘general-purpose’, ‘high-level’, ‘programming’, ‘language’, ‘[17][18][19]’]
import reword_list = list(map(lambda k: k.lower().strip(), re.split(r’[;,:(.s)]s*’, python_string)))word_list[:10] # [‘python’, ‘is’, ‘a’, ‘widely’, ‘used’, ‘general-purpose’, ‘high-level’, ‘programming’, ‘language’, ‘[17][18][19]’]
到目前为止看起来都不错,但是如果你想计算这个list中的单词:
from collections import defaultdict # again, collections!
dictionary = defaultdict(int)
for word in word_list:
dictionary[word] += 1
from collections import defaultdict # again, collections!dictionary = defaultdict(int)for word in word_list:&&&&dictionary[word] += 1
这个没有那么糟糕,但是如果你有了Counter,你将会节约下你的时间做更有意义的事情。
from collections import Counter
counter = Counter(word_list)
# Getting the most common 10 words
counter.most_common(10)
[(‘the’, 164), (‘and’, 161), (‘a’, 138), (‘python’, 138),
(‘of’, 131), (‘is’, 102), (‘to’, 91), (‘in’, 88), (‘’, 56)]
counter.keys()[:10] # just like a dictionary
[‘’, ‘limited’, ‘all’, ‘code’, ‘managed’, ‘multi-paradigm’,
‘exponentiation’, ‘fromosing’, ‘dynamic’]
from collections import Countercounter = Counter(word_list)# Getting the most common 10 wordscounter.most_common(10)[(‘the’, 164), (‘and’, 161), (‘a’, 138), (‘python’, 138), (‘of’, 131), (‘is’, 102), (‘to’, 91), (‘in’, 88), (‘’, 56)]counter.keys()[:10] # just like a dictionary[‘’, ‘limited’, ‘all’, ‘code’, ‘managed’, ‘multi-paradigm’, ‘exponentiation’, ‘fromosing’, ‘dynamic’]
很简洁吧,但是如果我们看看在Counter中包含的可用的方法:
dir(counter)
[‘__add__’, ‘__and__’, ‘__class__’, ‘__cmp__’, ‘__contains__’, ‘__delattr__’, ‘__delitem__’, ‘__dict__’,
‘__doc__’, ‘__eq__’, ‘__format__’, ‘__ge__’, ‘__getattribute__’, ‘__getitem__’, ‘__gt__’, ‘__hash__’,
‘__init__’, ‘__iter__’, ‘__le__’, ‘__len__’, ‘__lt__’, ‘__missing__’, ‘__module__’, ‘__ne__’, ‘__new__’,
‘__or__’, ‘__reduce__’, ‘__reduce_ex__’, ‘__repr__’, ‘__setattr__’, ‘__setitem__’, ‘__sizeof__’,
‘__str__’, ‘__sub__’, ‘__subclasshook__’, ‘__weakref__’, ‘clear’, ‘copy’, ‘elements’, ‘fromkeys’, ‘get’,
‘has_key’, ‘items’, ‘iteritems’, ‘iterkeys’, ‘itervalues’, ‘keys’, ‘most_common’, ‘pop’, ‘popitem’, ‘setdefault’,
‘subtract’, ‘update’, ‘values’, ‘viewitems’, ‘viewkeys’, ‘viewvalues’]
dir(counter)[‘__add__’, ‘__and__’, ‘__class__’, ‘__cmp__’, ‘__contains__’, ‘__delattr__’, ‘__delitem__’, ‘__dict__’, ‘__doc__’, ‘__eq__’, ‘__format__’, ‘__ge__’, ‘__getattribute__’, ‘__getitem__’, ‘__gt__’, ‘__hash__’, ‘__init__’, ‘__iter__’, ‘__le__’, ‘__len__’, ‘__lt__’, ‘__missing__’, ‘__module__’, ‘__ne__’, ‘__new__’, ‘__or__’, ‘__reduce__’, ‘__reduce_ex__’, ‘__repr__’, ‘__setattr__’, ‘__setitem__’, ‘__sizeof__’, ‘__str__’, ‘__sub__’, ‘__subclasshook__’, ‘__weakref__’, ‘clear’, ‘copy’, ‘elements’, ‘fromkeys’, ‘get’, ‘has_key’, ‘items’, ‘iteritems’, ‘iterkeys’, ‘itervalues’, ‘keys’, ‘most_common’, ‘pop’, ‘popitem’, ‘setdefault’, ‘subtract’, ‘update’, ‘values’, ‘viewitems’, ‘viewkeys’, ‘viewvalues’]
你看到__add__和__sub__方法了吗,是的,Counter支持加减运算。因此,如果你有很多文本想要去计算单词,你不必需要Hadoop,你可以运用Counter(作为map)然后把它们加起来(相当于reduce)。这样你就有构建在Counter上的mapreduce了,你可能以后还会感谢我。
扁平嵌套lists
Collections也有_chain函数,其可被用作扁平嵌套lists
from collections import chain
ls = [[kk] + list(range(kk)) for kk in range(5)]
flattened_list = list(collections._chain(*ls))
from collections import chainls = [[kk] + list(range(kk)) for kk in range(5)]flattened_list = list(collections._chain(*ls))
同时打开两个文件
如果你在处理一个文件(比如一行一行地),而且要把这些处理好的行写入到另一个文件中,你可能情不自禁地像下面这么去写:
with open(input_file_path) as inputfile:
with open(output_file_path, ‘w’) as outputfile:
for line in inputfile:
outputfile.write(process(line))
with open(input_file_path) as inputfile:&&&&with open(output_file_path, ‘w’) as outputfile:&&&&&&&&for line in inputfile:&&&&&&&&&&&&outputfile.write(process(line))
除此之外,你可以在相同的一行里打开多个文件,就像下面这样:
with open(input_file_path) as inputfile, open(output_file_path, ‘w’) as outputfile:
for line in inputfile:
outputfile.write(process(line))
with open(input_file_path) as inputfile, open(output_file_path, ‘w’) as outputfile:&&&&for line in inputfile:&&&&&&&&outputfile.write(process(line))
这样就更简洁啦!
从一堆数据中找到星期一
如果你有一个数据想去标准化(比如周一之前或是之后),你也许会像下面这样:
import datetime
previous_monday = some_date - datetime.timedelta(days=some_date.weekday())
# Similarly, you could map to next monday as well
next_monday = some_date + date_time.timedelta(days=-some_date.weekday(), weeks=1)
import datetimeprevious_monday = some_date - datetime.timedelta(days=some_date.weekday())# Similarly, you could map to next monday as wellnext_monday = some_date + date_time.timedelta(days=-some_date.weekday(), weeks=1)
这就是实现方式。
如果你出于兴趣或是利益要爬一个站点,你可能会一直面临着html标签。为了去解析各种各样的html标签,你可以运用html.parer:
from html.parser import HTMLParser
class HTMLStrip(HTMLParser):
def __init__(self):
self.reset()
self.ls = []
def handle_data(self, d):
self.ls.append(d)
def get_data(self):
return ‘’.join(self.ls)
@staticmethod
def strip(snippet):
html_strip = HTMLStrip()
html_strip.feed(snippet)
clean_text = html_strip.get_data()
return clean_text
snippet = HTMLStrip.strip(html_snippet)
12345678910111213141516171819202122
from html.parser import HTMLParser&class HTMLStrip(HTMLParser):&&&&&def __init__(self):&&&&&&&&self.reset()&&&&&&&&self.ls = []&&&&&def handle_data(self, d):&&&&&&&&self.ls.append(d)&&&&&def get_data(self):&&&&&&&&return ‘’.join(self.ls)&&&&&@staticmethod&&&&def strip(snippet):&&&&&&&&html_strip = HTMLStrip()&&&&&&&&html_strip.feed(snippet)&&&&&&&&clean_text = html_strip.get_data()&&&&&&&&return clean_text&snippet = HTMLStrip.strip(html_snippet)
如果你仅仅想避开html:
escaped_snippet = html.escape(html_snippet)
# Back to html snippets(this is new in Python 3.4)
html_snippet = html.unescape(escaped_snippet)
# and so forth ...
escaped_snippet = html.escape(html_snippet)&# Back to html snippets(this is new in Python 3.4)html_snippet = html.unescape(escaped_snippet)# and so forth ...
关于作者:
可能感兴趣的话题
o 215 回复
关于 Python 频道
Python频道分享 Python 开发技术、相关的行业动态。
新浪微博:
推荐微信号
(加好友请注明来意)
– 好的话题、有启发的回复、值得信赖的圈子
– 分享和发现有价值的内容与观点
– 为IT单身男女服务的征婚传播平台
– 优秀的工具资源导航
– 翻译传播优秀的外文文章
– 国内外的精选文章
– UI,网页,交互和用户体验
– 专注iOS技术分享
– 专注Android技术分享
– JavaScript, HTML5, CSS
– 专注Java技术分享
– 专注Python技术分享
& 2017 伯乐在线Python的基础性东西学习 - 简书
Python的基础性东西学习
我在想,四篇文章都没把这本书的前两章写完,是我写的太啰嗦了吗?这个进度是不是要快一点呢?还是就这样写吧!写下来主要是为了以后的自己看,还是得按照我这啰哩啰嗦的规矩来,哈哈。
Python的实用函数
这些函数在前几篇文章中都用过了,比如说帮助函数help(obj),把对象转为整数的int(obj),还有返回对象长度或元素个数的len(obj),还有打开文件用的open(fname,mode)函数,以及等待用户输入的raw_input(str)函数,其中str是用来展示的。还有三个是没有用过的函数,str(obj)这个是用来对象转字符串的,有时会把地址把对象的地址展示出来,这个和C#很像,还有就是type(obj)这个函数和C#的typeof()函数有一拼,另外还有一个就是dir([obj])这个函数返回的是对象的属性,这个函数好马婵呐!感觉应该不会常用吧,估计用不到吧!其实我不太明白它是干啥的!
被自己打脸是什么感觉
在上一段中我说dir([obj])函数没啥用,应该不常用,这个真是太打脸了。这个函数的用处和help()函数结合着用实在是太强大了,尤其是对新手来说更是如此。
如果不知道某个函数有哪些方法或者变量,就dir一下就知道这个函数的所有东西了,如果想知道这个函数的某个方法的作用的和用法,就help一下,就欧啦!突然感觉脸好疼啊!
Python好玩的语句和语法
注释用符号#,这个前面几篇文章已经用过了,不再赘述,突然想到上一篇文章中有一个问题没有解决,这个问题就是Python为啥是特意强调静态成员变量呢?它有没有动态成员变量呢?这个问题一会再说。
换行用符号\n,一般都是用这个符号进行换行,没啥说的。
继续上一行\,这个就有点意思了,继续上一行的意思就是,代码写的太长了,一行放不下,需要用两行来写,这个时候就要用到\来连接了。
两个语句显示在一行中用符号;,这个没啥说,因为C#就是这个样子。
冒号:需要说一下,C#里是{},而Python里是冒号进行分割代码的头和体。
代码缩进风格,这个Python对这一点是很严格的,也正因为如此,才使代码看着不乱,可以给人以美感。
模块化,这个和C#差不多吧!Python为何特意强调静态成员变量?
刚搜了一下,我有点消化不动了,因为我又看到了类静态方法,类方法,类实例方法,这三种方法先不说,先说为啥强调静态成员变量,对于这个问题,看一下代码就知道了。
class Person(object):
children = []
def setPersonChildren(self,childrenName):
self.children.append(childrenName)
def printPersonChildren(self):
print self.children
person1=Person()
person2=Person()
person3=Person()
person1.setPersonChildren('zhangSan')
person1.printPersonChildren()
person2.printPersonChildren()
person3.printPersonChildren()
输出结果如下:
['zhangSan']
['zhangSan']
['zhangSan']
这样的输出结果是不是很不合理?zhangsan明明是给person1了啊!为啥person2,person3也有zhangsan呢?这让zhangsan情何以堪?但这说明了一个问题就是children这个成员变量被当作静态变量使用了,这也是为什么Python强调静态变量的原因了吧!但问题是,Python有没有动态的成员变量呢?有,必须有!
在说动态成员变量之前,需要再把上面的代码中添加一句话。
person1.setPersonChildren('zhangSan')
就只是添加了下面这句话
person1.setPersonChildren('lisi')
person1.printPersonChildren()
person2.printPersonChildren()
person3.printPersonChildren()
输出结果如下:
['zhangSan', 'lisi']
['zhangSan', 'lisi']
['zhangSan', 'lisi']
看,这个是赤裸裸的静态成员变量的用法对不对?现在应该很清楚的就明白了,它为什么是静态吧!下面说说怎么才能使其成为动态成员变量,还是看代码!
class Person(object):
def __init__(self):
self.children=[]
def setPersonChildren(self,childrenName):
self.children.append(childrenName)
def printPersonChildren(self):
print self.children
person1=Person()
person2=Person()
person3=Person()
person1.setPersonChildren('zhangSan')
person2.setPersonChildren('lisi')
person1.printPersonChildren()
person2.printPersonChildren()
person3.printPersonChildren()
这样就好了,输出结果如下:
['zhangSan']
把成员变量放到init函数的self身上就变成动态成员变量了,是不是好简单呢?但是这对我来说确实是有点不适应啊!这个坑咱们是填完了,但填完一个坑,又来三个坑!下面看看这三个坑吧!
Python的类静态方法,类方法,类实例方法
类静态方法这个方法和类没啥关系,无法访问类的任何属性(类属性,类实例属性),没有默认的第一个参数,就相当于是普普通通的一个方法,只是它需要@staticmethod来标记其为类静态方法,这个也就只是个标记,没别的意思。
类方法第一个参数必须是类对象,可以通过这个类对象访问类属性,但是无法访问类实例对象,是不是有点绕口还不好记?其实啊,这个就相当于是说,可以访问类的静态成员,但是由于没有传实例对象,所以不能访问类的实例属性。需要说明的是,这个类方法需要用@classmethod标记。
类实例方法第一个参数是类实例对象,是self,可以通过这个类实例对象访问类实例属性,可以通过类实例对象的__clsss__访问类属性。可以通过类对象调用类方法,类实例方法,但是不可以调用类的实例方法,不过只有类实例对象可以调用这三个方法。三种方法的代码示例
class Person(object):
children='zhangSan'
def __init__(self,inst_name):
self.name=inst_name
def objMethod(self):
print 'My name is',self.name
@classmethod
def classMethod(cls):
print cls.children
@staticmethod
def staticMethod():
print 'I am is StaticMethod'
Person.staticMethod()
Person.classMethod()
print '-----------------------------'
person=Person('wangWu')
person.staticMethod()
person.classMethod()
person.objMethod()
这个代码应该是比较清楚的吧!下面来看看代码的执行结果:
I am is StaticMethod
-----------------------------
I am is StaticMethod
My name is wangWu
这种文章不宜过长,就写到这里,一天学一点,日积月累,今天的Python就学到这吧!明天再来学Python,哈哈。
不管路走了多远,错了就要重新返回。零基础学习Python的越来越多是因为在五大语言中排名第一吗?【python吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:137,801贴子:
零基础学习Python的越来越多是因为在五大语言中排名第一吗?收藏
对于开发者来说,掌握什么编程语言能更容易找到数据科学分析的工作?这是个许多人关心的问题,非常实际,也在许多论坛被翻来覆去地讨论过。大家都知道Java 在程序猿江湖的霸主地位已经很多年没有受到挑战了。 作为一门主流编程语言,在所有领域的普及率、职业选择、业界倾向榜单中,Java 即使不在榜首,也位于前列。但是,现在大家通过各论坛也都看到了。Python作为一个后期之秀。除了拥有Java的灵活多功能,以及处理复杂任务的能力。非常显著的是 “Python 是大趋势”这一论调,似乎它即将在机器学习领域一统天下。我们来看看 2016 年开发语言使用情况统计,到底哪门语言的使用人数上升最快?居前几位的都是哪些?数据科学领域各语言的雇主招聘指数对比如图所示,这是利用美国职位搜索引擎
得出的机器学习、数据科学招聘趋势:对这些领域内开发职位所列出的编程语言要求进行了统计。它展示出公司、雇主们都在寻找哪些语言技能。但注意:这并不能精确体现各公司开发人员正在使用哪些语言。这是美国的机器学习业界趋势,与中国、学界关系不是那么紧密。没有包涵在搜索结果内的语言,不代表它们的招聘职位比上述语言要少。我们可以清楚看出,美国雇主最需要的前四大语言排名是 Python,Java,R,C++。其中,Python 在 2015 年中超过 Java 跃升至第一。Python零基础初学者为什么要选择学习这门语言呢?1:Python 是市场的领先者,作为最受欢迎的机器学习语言当之无愧。另外,Python 与 Java 之间的差距正在被拉开。在机器学习和数据科学市场,Python, Java, 和 R 的招聘需求最大;在深度学习领域,Python, Java,C++ 以及 C 更被公司欢迎。2. 基于 Python 的顶级机器学习框架选择较多。3.学习完Python是做数据分析,是web开发,还是游戏开发。都有个好的选择。
[北通]阿修罗2王炸上市,分分钟秒爆对手!!
免费带新手学习Python啦+++++++++++++++++++
666666顶顶顶顶的顶顶顶顶顶顶顶顶顶顶顶顶
51CTO学院11年行业品牌,1400万用户选择,中国专业IT技能学习平台,python.通过在线学习的方式,帮助广大技术人员实现技能提升,高薪就业的职业梦想,python.
不是水贴哦带新手免费学习啦+++++++++++++++++++
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或

我要回帖

 

随机推荐