import numpy as np
import matplotlib.pyplot as plt
import seaborn; seaborn.set() rand = np.random.RandomState(42)
x = rand.rand(10,2) #数组
plt.scatter(x[:,0],x[:,1],s=100) #数组第一列为横坐标,第二列为纵坐标 s=100:散点大小
plt.show()

any list of dictionaries can be made into a DataFrame

import numpy as np
pd.DataFrame(np.random.rand(3,2),
columns=['foo','bar'],
index=['a','b','c'])
import pandas as pd
import numpy as np
class display(object):
"""Display HTML representation of multiple objects"""
template = """<div style="float: left; padding: 10px;">
<p style='font-family:"Courier New", Courier, monospace'>{0}</p>{1}
</div>"""
def __init__(self, *args):
self.args = args def _repr_html_(self):
return '\n'.join(self.template.format(a, eval(a)._repr_html_())
for a in self.args) def __repr__(self):
return '\n\n'.join(a + '\n' + repr(eval(a))
for a in self.args)
df1 = pd.DataFrame({'employee': ['Bob', 'Jake', 'Lisa', 'Sue'],
'group': ['Accounting', 'Engineering', 'Engineering', 'HR']})
df3 = pd.DataFrame({'name': ['Bob', 'Jake', 'Lisa', 'Sue'],
'salary': [70000, 80000, 120000, 90000]})
display('df1', 'df3', 'pd.merge(df1, df3, left_on="employee", right_on="name")') #display 允许显示多个结果

python data science handbook1的更多相关文章

  1. Python Data Science Toolbox Part 1 Learning 1 - User-defined functions

    User-defined functions from:https://campus.datacamp.com/courses/python-data-science-toolbox-part-1/w ...

  2. Comprehensive learning path – Data Science in Python深入学习路径-使用python数据中学习

    http://blog.csdn.net/pipisorry/article/details/44245575 关于怎么学习python,并将python用于数据科学.数据分析.机器学习中的一篇非常好 ...

  3. 学习笔记之Intermediate Python for Data Science | DataCamp

    Intermediate Python for Data Science | DataCamp https://www.datacamp.com/courses/intermediate-python ...

  4. Intermediate Python for Data Science learning 2 - Histograms

    Histograms from:https://campus.datacamp.com/courses/intermediate-python-for-data-science/matplotlib? ...

  5. A Complete Tutorial to Learn Data Science with Python from Scratch

    A Complete Tutorial to Learn Data Science with Python from Scratch Introduction It happened few year ...

  6. 40 Questions to test your skill in Python for Data Science

    Comes from: https://www.analyticsvidhya.com/blog/2017/05/questions-python-for-data-science/ Python i ...

  7. 【转】Comprehensive learning path – Data Science in Python

    Journey from a Python noob to a Kaggler on Python So, you want to become a data scientist or may be ...

  8. 学习Data Science/Deep Learning的一些材料

    原文发布于我的微信公众号: GeekArtT. 从CFA到如今的Data Science/Deep Learning的学习已经有一年的时间了.期间经历了自我的兴趣.擅长事务的探索和试验,有放弃了的项目 ...

  9. 【Repost】A Practical Intro to Data Science

    Are you a interested in taking a course with us? Learn about our programs or contact us at hello@zip ...

随机推荐

  1. wkhtmltopdf 转pdf时元素被页面切割开

    1. <style> * { page-break-inside: avoid; page-break-after: avoid; page-break-before: avoid; } ...

  2. TOMCAT程序的层级目录

    web | |---------js,jsp,html,css(资源文件在web根目录下面 可以被浏览器直接访问) |---------WEB-INF(配置文件web.xml   lib---jar ...

  3. esxi虚拟机克隆后的主机网卡设置

    windows 在虚拟机配置页面右击属性,编辑虚拟机设置,删除掉原来的网卡,重新添加新的网卡 进入系统以后,进入 windows/system32 找到sysprep,运行等待电脑重启 重启过程会稍微 ...

  4. FormsAuthentication 票据前后台登录导致掉线

    一.前后台的用户信息都是采用.NET自带的FormsAuthentication 的ticket存取用户信息, 但是如果前后台用相同的用户使用票据这个会导致一方登陆后另一方会掉线,需要重新登陆. 二. ...

  5. IDEA中添加javap反编译

  6. command not found解决方案

    如果新装的系统,运行一些很正常的诸如:shutdown,fdisk的命令时,悍然提示:bash:command not found.那么 首先就要考虑root 的$PATH里是否已经包含了这些环境变量 ...

  7. jquery取出checkbox多选的值(带全选功能)

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...

  8. lets encrypt与openssl结合实现双认证

    lets encrypt,是一个免费的证书认证机构,不需要导入根证书.但是这个认证机构只能认证服务端的,如果想要实现双认证,lets encrypt就不行了. openssl可以自签发,可以进行双认证 ...

  9. 48-设置tomcat虚拟路径的两种方法(Eclipse、tomcat、IDEA)

    设置tomcat虚拟路径的两种方法(Eclipse.tomcat.IDEA) 三种方式设置虚拟服务器路径如果我们要实现一个上传文件的功能,但是又想要上传的文件不会随着自己web服务器的重启而不能访问了 ...

  10. 推荐几个可以从google play(谷歌应用商店)直接下载原版APP的网站

    http://apk-dl.com/ https://apkpure.com/ http://apk-downloaders.com