python data science handbook1
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的更多相关文章
- 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 ...
- Comprehensive learning path – Data Science in Python深入学习路径-使用python数据中学习
http://blog.csdn.net/pipisorry/article/details/44245575 关于怎么学习python,并将python用于数据科学.数据分析.机器学习中的一篇非常好 ...
- 学习笔记之Intermediate Python for Data Science | DataCamp
Intermediate Python for Data Science | DataCamp https://www.datacamp.com/courses/intermediate-python ...
- Intermediate Python for Data Science learning 2 - Histograms
Histograms from:https://campus.datacamp.com/courses/intermediate-python-for-data-science/matplotlib? ...
- 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 ...
- 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 ...
- 【转】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 ...
- 学习Data Science/Deep Learning的一些材料
原文发布于我的微信公众号: GeekArtT. 从CFA到如今的Data Science/Deep Learning的学习已经有一年的时间了.期间经历了自我的兴趣.擅长事务的探索和试验,有放弃了的项目 ...
- 【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 ...
随机推荐
- python入门(十七)python连接mysql数据库
mysql 数据库:关系型数据库mysql:互联网公司 sqllite:小型数据库,占用资源少,手机里面使用oracle:银行.保险.以前外企.sybase:银行+通信 互联网公司key:valuem ...
- Win10 远程桌面连接出现“要求的函数不受支持”的解决办法之修改注册表
问题起因 笔者自己在阿里云上搞服务器,有一台 Windows Server 必须通过远程桌面连接来管理,由于没能完全关掉 Win10 自带的烦人的系统更新,导致昨天安装完更新后出现了连接远程桌面时“要 ...
- 云笔记项目-MyBatis返回自增类型&堆栈对象补充理解
在云笔记项目中,讲到了MySql的自增,MyBatis查询到自增类型数据后可以设置返回到参数属性,其中学习了MySql的自增写法,堆栈对象等知识. MySql数据类型自增 建立一张Person表,其中 ...
- tcp,Socket,三次握手和四次挥手的图示
tcp的图示: Socket的图示: Socket原理图示: “三次握手”图示介绍: 客户端向服务器发送一个SYN J 服务器向客户端响应一个SYN K,并对SYN J进行确认ACK J+1 客户端再 ...
- win7安装oracle 10g问题总结。
1.安装oracle10g的时候,出现此问题,如图: 右键安装程序(setup.exe) -> 属性 -> 兼容性 -> 以兼容模式运行这个程序 windows xp( servi ...
- linux上遇到tomcat报Out of Memory错误,导致jenkins崩溃的问题
今天遇到一个问题,就是JENKINS在同时部署两个前端应用时会出现崩溃的现象. 排查过程如下 查看tomcat-jenkins/bin/hs_err_pid27127.log发现: Out of Me ...
- SSH Config 那些你所知道和不知道的事 (转)
原文地址:https://deepzz.com/post/how-to-setup-ssh-config.html SSH(Secure Shell)是什么?是一项创建在应用层和传输层基础上的安全协议 ...
- 微信支付遇到的坑---缺少参数total_fee
今天在做微信砍价成功后支付,出现了这个报错 看到报错后,去找total_fee这个参数,调试了半天,total_fee是确定有值的 微信支付的步骤 ① 预支付 商户号,商户秘钥,appid,appse ...
- Echart遇到的问题:tooltip提示框大小异常
将Echart图表放到项目中,发现当鼠标放到柱状图上时,提示框显示大小超出了div的大小. 官方的文档对于tooltip的说明也没有指出:如何修改大小. 那么tooltip是什么呢? fn+f12打开 ...
- Node.js前端程序通过Nginx部署后刷新出现404问题的解决办法
方案一 (这种方式容易被第三方劫持) location / { root /data/nginx/html; index index.html index.htm; error_page 404 /i ...