Skip to content

Commit a293223

Browse files
authored
Merge pull request MLEveryday#90 from madefu/master
2 parents 8b4ad6b + e73a69e commit a293223

23 files changed

+124
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,5 @@ venv.bak/
102102

103103
# mypy
104104
.mypy_cache/
105+
/.idea
106+
/datasets/*.bak

Code/Day 3_Multiple_Linear_Regression.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131

3232
# regression evaluation
3333
from sklearn.metrics import r2_score
34-
print(r2_score(Y_test,y_pred))
34+
print(r2_score(Y_test, y_pred))

Code/KafkaProducer.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/python
2+
3+
from kafka import KafkaProducer
4+
5+
kafkaHosts=["kafka01.paas.longfor.sit:9092"
6+
,"kafka02.paas.longfor.sit:9092"
7+
,"kafka03.paas.longfor.sit:9092"]
8+
9+
producer = KafkaProducer(bootstrap_servers=kafkaHosts);
10+
11+
for _ in range(20):
12+
producer.send("testapplog_plm-prototype",b"Hello....")
13+
producer.flush();

Code/TestKafka.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/python
2+
3+
from kafka import KafkaConsumer;
4+
5+
6+
kafkaHosts=["kafka01.paas.longfor.sit:9092"
7+
,"kafka02.paas.longfor.sit:9092"
8+
,"kafka03.paas.longfor.sit:9092"]
9+
10+
'''
11+
earliest
12+
当各分区下有已提交的offset时,从提交的offset开始消费;无提交的offset时,从头开始消费
13+
latest
14+
当各分区下有已提交的offset时,从提交的offset开始消费;无提交的offset时,消费新产生的该分区下的数据
15+
none
16+
topic各分区都存在已提交的offset时,从offset后开始消费;只要有一个分区不存在已提交的offset,则抛出异常
17+
'''
18+
consumer = KafkaConsumer(
19+
bootstrap_servers=kafkaHosts,group_id='mdf_group',auto_offset_reset='latest');
20+
21+
consumer.subscribe("testapplog_plm-prototype");
22+
23+
for msg in consumer:
24+
print(msg.value)

Code/my/Data_age_salary.csv

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Age,Salary
2+
44,72000
3+
27,48000
4+
30,54000
5+
38,61000
6+
40,78000
7+
35,58000
8+
35,52000
9+
48,79000
10+
50,83000
11+
37,67000

Code/my/LinerTest.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import pandas as pd
2+
import numpy as np
3+
import matplotlib.pyplot as plt
4+
5+
dataset = pd.read_csv('Data_age_salary.csv');
6+
dataset.iloc[:1]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Other Docs/速查手册/README.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# 14张速查表,带你玩转 Python 数据科学
2+
译自 DataCamp 的速查表,有兴趣的朋友可以在这里查看[英文原版](https://www.datacamp.com/community/data-science-cheatsheets)
3+
4+
欢迎扫描二维码关注我的 **呆鸟的Python数据分析** 公众号,虽然现在内容还比较少,但我会不断增加的。
5+
6+
![呆鸟的Python数据分析](https://upload-images.jianshu.io/upload_images/3240514-6a4349fff3b8b019.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
7+
8+
一、[Python 基础系列](https://www.jianshu.com/p/4574d95755db)
9+
10+
* [Python数据科学速查表 - Python 基础](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Python%20基础.pdf)
11+
![Python数据科学速查表 - Python 基础](https://upload-images.jianshu.io/upload_images/3240514-a4268e27432411b0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
12+
13+
* [Python数据科学速查表 - 导入数据](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20导入数据.pdf)
14+
![Python数据科学速查表 - 导入数据](https://upload-images.jianshu.io/upload_images/3240514-d2b38f138e127333.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
15+
16+
* [Python数据科学速查表 - Jupyter Notebook](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E9%80%9F%E6%9F%A5%E8%A1%A8%20-%20Jupyter%20Notebook.pdf)
17+
![Python数据科学速查表 - Jupyter Notebook](https://upload-images.jianshu.io/upload_images/3240514-111052b862105515.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
18+
19+
二、[数据处理系列(Numpy、Pandas 及 SciPy)](https://www.jianshu.com/p/8d51642dfa26)
20+
21+
* [Python数据科学速查表 - Numpy 基础](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Numpy%20基础.pdf)
22+
![Python数据科学速查表 - Numpy 基础](https://upload-images.jianshu.io/upload_images/3240514-811ca5b168b84a75.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
23+
24+
* [Python数据科学速查表 - Pandas 基础](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Pandas%20基础.pdf)
25+
![Python数据科学速查表 - Pandas 基础](https://upload-images.jianshu.io/upload_images/3240514-0711ea1cb1d1fcee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
26+
27+
* [Python数据科学速查表 - Pandas 进阶](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Pandas%20进阶.pdf)
28+
![Python数据科学速查表 - Pandas 进阶](https://upload-images.jianshu.io/upload_images/3240514-475cfa9174303f60.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
29+
30+
* [Python数据科学速查表 - SciPy](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E9%80%9F%E6%9F%A5%E8%A1%A8%20-%20SciPy.pdf)
31+
![Python数据科学速查表 - SciPy](https://upload-images.jianshu.io/upload_images/3240514-fc9fa2b69a820041.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
32+
33+
三、[可视化系列(Matplotlib、Bokeh、Seaborn)](https://www.jianshu.com/p/7e186d43d7f1)
34+
35+
* [Python数据科学速查表 - Matplotlib](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Matplotlib%20绘图.pdf)
36+
![Python数据科学速查表 - Matplotlib](https://upload-images.jianshu.io/upload_images/3240514-9c57bcf33113cf98.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
37+
38+
* [Python数据科学速查表 - Bokeh](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Bokeh.pdf)
39+
![Python数据科学速查表 - Bokeh](https://upload-images.jianshu.io/upload_images/3240514-d87990f4a3f7f0ae.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
40+
41+
* [Python数据科学速查表 - Seaborn](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E9%80%9F%E6%9F%A5%E8%A1%A8%20-%20Seaborn.pdf)
42+
![Python数据科学速查表 - Seaborn](https://upload-images.jianshu.io/upload_images/3240514-1c2f56b96f841421.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
43+
44+
四、[机器学习系列(Keras、Scikit-learn)](https://www.jianshu.com/p/cba49ff5fc97)
45+
46+
* [Python数据科学速查表 - Keras](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Keras.pdf)
47+
![Python数据科学速查表 - Keras](https://upload-images.jianshu.io/upload_images/3240514-ea9657c97b5e0d19.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
48+
49+
* [Python数据科学速查表 - Scikit-learn](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E9%80%9F%E6%9F%A5%E8%A1%A8%20-%20Scikit-Learn.pdf)
50+
![Python数据科学速查表 - Scikit-learn](https://upload-images.jianshu.io/upload_images/3240514-b8cbecb3a9194b71.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
51+
52+
五、[PySpark系列(SQL与RDD)](https://www.jianshu.com/p/7dea578c56d8)
53+
54+
* [Python数据科学速查表 - Spark SQL 基础](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E9%80%9F%E6%9F%A5%E8%A1%A8%20-%20Spark%20SQL%20%E5%9F%BA%E7%A1%80.pdf)
55+
![pyspark.png](https://upload-images.jianshu.io/upload_images/3240514-32909e63b67c0837.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
56+
57+
* [Python数据科学速查表 - Spark RDD 基础](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python%E6%95%B0%E6%8D%AE%E7%A7%91%E5%AD%A6%E9%80%9F%E6%9F%A5%E8%A1%A8%20-%20Spark%20RDD%20%E5%9F%BA%E7%A1%80.pdf)
58+
![RDD.png](https://upload-images.jianshu.io/upload_images/3240514-43308e4ca89d8699.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
59+
60+
如果喜欢本文,敬请关注我的简书专题 **[呆鸟的Python数据分析](https://www.jianshu.com/c/38980843c0f2)**
61+
62+
感谢**天善智能****Python爱好者社区**公众号一直以来对我的支持,这里也大力推荐,是我学习入门 Python 数据分析入门的引路者,欢迎关注!
63+
64+
![Python爱好者社区](https://upload-images.jianshu.io/upload_images/3240514-29c87337342b0904.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

datasets/studentscores.csv

+3
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ Hours,Scores
2424
3.8,35
2525
6.9,76
2626
7.8,86
27+
2.1,93
28+
2.2,93
29+
2.5,93

0 commit comments

Comments
 (0)