楼主: mipbuilder
4673 35

Mastering Python for Data Science [推广有奖]

  • 0关注
  • 9粉丝

博士生

35%

还不是VIP/贵宾

-

威望
0
论坛币
7340 个
通用积分
3.0200
学术水平
77 点
热心指数
71 点
信用等级
67 点
经验
14641 点
帖子
69
精华
2
在线时间
150 小时
注册时间
2015-8-1
最后登录
2016-1-5

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
Mastering Python for Data Science_001.jpg Mastering Python for Data Science1_003.jpg

本帖隐藏的内容

Mastering Python for Data Science_PACKT_2015.pdf (6.03 MB)



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Data Science Mastering Science python Master

已有 1 人评分经验 收起 理由
Lisrelchen + 100 精彩帖子

总评分: 经验 + 100   查看全部评分

本帖被以下文库推荐

沙发
zhuafeng2008 发表于 2015-10-2 00:54:42 |只看作者 |坛友微信交流群
  1. Creating multiple plots

  2. One very useful feature of matplotlib is that it makes it easy to plot multiple plots, which can be compared to each other:

  3. >>> p1 = np.arange(0.0, 30.0, 0.1)

  4. >>> plt.subplot(211)
  5. >>> plt.plot(p1, np.sin(p1)/p1, 'b--')

  6. >>> plt.subplot(212)
  7. >>> plt.plot(p1, np.cos(p1), 'r--')
  8. >>> plt.show()
复制代码

使用道具

藤椅
fengyg 企业认证  发表于 2015-10-2 08:33:28 |只看作者 |坛友微信交流群
  1. Playing with text

  2. Adding text to your chart can be done by using a simple matplotlib function. You only have to use the text() command to add it to the chart:

  3. >>> # Playing with text
  4. >>> n = np.random.random_sample((5,))

  5. >>> plt.bar(np.arange(len(n)), n)
  6. >>> plt.xlabel('Indices')
  7. >>> plt.ylabel('Value')
  8. >>> plt.text(1, .7, r'$\mu=' + str(np.round(np.mean(n), 2)) + '
  9. )

  10. >>> plt.show()
  11. In the preceding code, the text() com
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

使用道具

板凳
墨移 发表于 2015-10-2 08:54:46 |只看作者 |坛友微信交流群
  1. Styling your plots

  2. The style package within the matplotlib library makes it easier to change the style of the plots that are being plotted. It is very easy to change to the famous ggplot style of the R language or use the Nate Silver's website http://fivethirtyeight.com/ for fivethirtyeight style. The following example shows the plotting of a simple line chart with the ggplot style:

  3. >>> plt.style.use('ggplot')
  4. >>> plt.plot([1, 2, 3, 4], [1, 4, 9, 16])
  5. >>> plt.show()
复制代码

使用道具

报纸
墨移 发表于 2015-10-2 08:54:46 |只看作者 |坛友微信交流群
  1. Area plots

  2. An area plot is useful for comparing the values of different factors across a range. The area plot can be stacked in nature, where the areas of the different factors are stacked on top of each other. The following code gives an example of a stacked area plot:

  3. >>> df = pd.DataFrame(np.random.rand(10, 4), columns=['p', 'q', 'r', 's'])

  4. >>> df.plot(kind='area');
复制代码

使用道具

地板
墨移 发表于 2015-10-2 08:54:48 |只看作者 |坛友微信交流群
  1. Heatmaps

  2. A heatmap is a graphical representation where individual values of a matrix are represented as colors. A heatmap is very useful in visualizing the concentration of values between two dimensions of a matrix. This helps in finding patterns and gives a perspective of depth.

  3. Let's start off by creating a basic heatmap between two dimensions. We'll create a 10 x 6 matrix of random values and visualize it as a heatmap:

  4. >>> # Generate Data
  5. >>> data = np.random.rand(10,6)
  6. >>> rows = list('ZYXWVUTSRQ')  #Ylabel
  7. >>> columns = list('ABCDEF')  #Xlabel

  8. >>> #Basic Heat Map plot
  9. >>> plt.pcolor(data)
  10. >>> plt.show()
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

使用道具

7
rrjj101022 发表于 2015-10-2 09:34:49 |只看作者 |坛友微信交流群
  1. Scatter plots with histograms

  2. We can combine a simple scatter plot with histograms for each axis. These kinds of plots help us see the distribution of the values of each axis.

  3. Let's generate some randomly distributed data for the two axes:

  4. >>> from matplotlib.ticker import NullFormatter
  5. >>> # the random data
  6. >>> x = np.random.randn(1000)
  7. >>> y = np.random.randn(1000)
  8. A NullFormatter object is created, which will be used for eliminating the x and y labels of the histograms:

  9. >>> nullfmt   = NullFormatter()         # no labels
  10. The following code defines the size, height, and width of the scatter and histogram plots:

  11. >>> # definitions for the axes
  12. >>> left, width = 0.1, 0.65
  13. >>> bottom, height = 0.1, 0.65
  14. >>> bottom_h = left_h = left+width+0.02
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

使用道具

8
qw789789 发表于 2015-10-2 11:02:53 |只看作者 |坛友微信交流群
  1. A scatter plot matrix

  2. A scatter plot matrix can be formed for a collection of variables where each of the variables will be plotted against each other. The following code generates a DataFrame df, which consists of four columns with normally distributed random values and column names named from a to d:

  3. >>> df = pd.DataFrame(np.random.randn(1000, 4), columns=['a', 'b', 'c', 'd'])

  4. >>> spm = pd.tools.plotting.scatter_matrix(df, alpha=0.2, figsize=(6, 6), diagonal='hist')
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

使用道具

9
jianboxue 发表于 2015-10-4 00:13:36 |只看作者 |坛友微信交流群
xiexie dada

使用道具

10
abewang 发表于 2015-10-4 19:57:15 |只看作者 |坛友微信交流群
  1. Bubble charts

  2. A bubble chart is basically a scatter plot with an additional dimension. The additional dimension helps in setting the size of the bubble, which means that the greater the size of the bubble, the larger the value that represents the bubble. This kind of a chart helps in analyzing the data of three dimensions.

  3. The following code creates a sample data of three variables and this data is then fed to the plot() method where its kind is mentioned as a scatter and s is the size of the bubble:

  4. >>> plt.style.use('ggplot')
  5. >>> df = pd.DataFrame(np.random.rand(50, 3), columns=['a', 'b', 'c'])
  6. >>> df.plot(kind='scatter', x='a', y='b', s=df['c']*400);
  7. After the preceding code is executed we'll get the following output:
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-1 05:47