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 day04笔记总结
2019.4.1 S21 day04笔记总结 昨日内容补充 1.解释器/编译器 1.解释型语言.编译型语言 2.解释型:写完代码后提交给解释器,解释器将代码一行行执行.(边接收边解释/实时解释) 常用 ...
- (1234队)NABCD分析
1.N(需求) 我们通过平常上自习时发现的问题和在校调查发现人们在寻找空教室上自习时会遇到诸多问题,其中 问题一:找不到空教室:5% 问题二:非上课教室学生太多:70% 问题三:有占座情况:20% 问 ...
- mysql 开启root外部链接权限
mysql给root开启远程访问权限,修改root密码 1.MySql-Server 出于安全方面考虑只允许本机(localhost, 127.0.0.1)来连接访问. 这对于 Web-Server ...
- Python 解决命令行删除、退格乱码问题
安装了python 在命令行界面无法进行删除.退格 1 安装readline模块 两种方式:yum install -y readline-devel readline 或者 下载文件https:/ ...
- 《AlwaysRun!》第一次作业:团队亮相
项目 内容 这个作业属于哪个课程 2016级软件工程(西北师范大学) 这个作业的要求在哪里 实验五 团队作业1:软件研发团队组建 团队名称 Always Run! 作业学习目标 熟悉软件的开发流程与 ...
- mysql关闭groupby模式
Mysql5.7 出现 SELECT list is not in GROUP BY clause and contains nonaggregated column ‘sss.month_id’ w ...
- 【CSS】Sticky Footer 布局
什么是 Sticky Footer 布局? Sticky Footer 布局是一种将 footer 吸附在底部的CSS布局. footer 可以是任意的元素,该布局会形成一种当内容不足,footer ...
- python抓取网页数据处理后可视化
抓取文章的链接,访问量保存到本地 #coding=utf-8 import requests as req import re import urllib from bs4 import Beauti ...
- 一篇文章搞定百度OCR图片文字识别API
一篇文章搞定百度OCR图片文字识别API https://www.jianshu.com/p/7905d3b12104
- svn如何根据提交日志信息回退版本
问题场景: 1 记得提交的日志信息中包含openssl,但是不记得这次提交的版本号revesion,是svn初始化后中间的某次提交: 2 svn环境的操作系统平台为Fedora, 即命令行下:而且sv ...