Merge pull request #90 from madefu/master
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -102,3 +102,5 @@ venv.bak/
|
|||||||
|
|
||||||
# mypy
|
# mypy
|
||||||
.mypy_cache/
|
.mypy_cache/
|
||||||
|
/.idea
|
||||||
|
/datasets/*.bak
|
||||||
|
|||||||
@ -31,4 +31,4 @@ y_pred = regressor.predict(X_test)
|
|||||||
|
|
||||||
# regression evaluation
|
# regression evaluation
|
||||||
from sklearn.metrics import r2_score
|
from sklearn.metrics import r2_score
|
||||||
print(r2_score(Y_test,y_pred))
|
print(r2_score(Y_test, y_pred))
|
||||||
|
|||||||
13
Code/KafkaProducer.py
Normal file
13
Code/KafkaProducer.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
from kafka import KafkaProducer
|
||||||
|
|
||||||
|
kafkaHosts=["kafka01.paas.longfor.sit:9092"
|
||||||
|
,"kafka02.paas.longfor.sit:9092"
|
||||||
|
,"kafka03.paas.longfor.sit:9092"]
|
||||||
|
|
||||||
|
producer = KafkaProducer(bootstrap_servers=kafkaHosts);
|
||||||
|
|
||||||
|
for _ in range(20):
|
||||||
|
producer.send("testapplog_plm-prototype",b"Hello....")
|
||||||
|
producer.flush();
|
||||||
24
Code/TestKafka.py
Normal file
24
Code/TestKafka.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
from kafka import KafkaConsumer;
|
||||||
|
|
||||||
|
|
||||||
|
kafkaHosts=["kafka01.paas.longfor.sit:9092"
|
||||||
|
,"kafka02.paas.longfor.sit:9092"
|
||||||
|
,"kafka03.paas.longfor.sit:9092"]
|
||||||
|
|
||||||
|
'''
|
||||||
|
earliest
|
||||||
|
当各分区下有已提交的offset时,从提交的offset开始消费;无提交的offset时,从头开始消费
|
||||||
|
latest
|
||||||
|
当各分区下有已提交的offset时,从提交的offset开始消费;无提交的offset时,消费新产生的该分区下的数据
|
||||||
|
none
|
||||||
|
topic各分区都存在已提交的offset时,从offset后开始消费;只要有一个分区不存在已提交的offset,则抛出异常
|
||||||
|
'''
|
||||||
|
consumer = KafkaConsumer(
|
||||||
|
bootstrap_servers=kafkaHosts,group_id='mdf_group',auto_offset_reset='latest');
|
||||||
|
|
||||||
|
consumer.subscribe("testapplog_plm-prototype");
|
||||||
|
|
||||||
|
for msg in consumer:
|
||||||
|
print(msg.value)
|
||||||
11
Code/my/Data_age_salary.csv
Normal file
11
Code/my/Data_age_salary.csv
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Age,Salary
|
||||||
|
44,72000
|
||||||
|
27,48000
|
||||||
|
30,54000
|
||||||
|
38,61000
|
||||||
|
40,78000
|
||||||
|
35,58000
|
||||||
|
35,52000
|
||||||
|
48,79000
|
||||||
|
50,83000
|
||||||
|
37,67000
|
||||||
|
6
Code/my/LinerTest.py
Normal file
6
Code/my/LinerTest.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import pandas as pd
|
||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
dataset = pd.read_csv('Data_age_salary.csv');
|
||||||
|
dataset.iloc[:1]
|
||||||
BIN
Other Docs/速查手册/2018年数据科学家报告.pdf
Normal file
BIN
Other Docs/速查手册/2018年数据科学家报告.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Bokeh.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Bokeh.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Jupyter Notebook.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Jupyter Notebook.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Keras.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Keras.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Matplotlib 绘图.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Matplotlib 绘图.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Numpy 基础.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Numpy 基础.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Pandas 基础.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Pandas 基础.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Pandas 进阶.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Pandas 进阶.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Python 基础.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Python 基础.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - SciPy.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - SciPy.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Scikit-Learn.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Scikit-Learn.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Seaborn.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Seaborn.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Spark RDD 基础.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Spark RDD 基础.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - Spark SQL 基础.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - Spark SQL 基础.pdf
Normal file
Binary file not shown.
BIN
Other Docs/速查手册/Python数据科学速查表 - 导入数据.pdf
Normal file
BIN
Other Docs/速查手册/Python数据科学速查表 - 导入数据.pdf
Normal file
Binary file not shown.
64
Other Docs/速查手册/README.md
Normal file
64
Other Docs/速查手册/README.md
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# 14张速查表,带你玩转 Python 数据科学
|
||||||
|
译自 DataCamp 的速查表,有兴趣的朋友可以在这里查看[英文原版](https://www.datacamp.com/community/data-science-cheatsheets)。
|
||||||
|
|
||||||
|
欢迎扫描二维码关注我的 **呆鸟的Python数据分析** 公众号,虽然现在内容还比较少,但我会不断增加的。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
一、[Python 基础系列](https://www.jianshu.com/p/4574d95755db)
|
||||||
|
|
||||||
|
* [Python数据科学速查表 - Python 基础](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Python%20基础.pdf)
|
||||||
|

|
||||||
|
|
||||||
|
* [Python数据科学速查表 - 导入数据](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20导入数据.pdf)
|
||||||
|

|
||||||
|
|
||||||
|
* [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)
|
||||||
|

|
||||||
|
|
||||||
|
二、[数据处理系列(Numpy、Pandas 及 SciPy)](https://www.jianshu.com/p/8d51642dfa26)
|
||||||
|
|
||||||
|
* [Python数据科学速查表 - Numpy 基础](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Numpy%20基础.pdf)
|
||||||
|

|
||||||
|
|
||||||
|
* [Python数据科学速查表 - Pandas 基础](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Pandas%20基础.pdf)
|
||||||
|

|
||||||
|
|
||||||
|
* [Python数据科学速查表 - Pandas 进阶](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Pandas%20进阶.pdf)
|
||||||
|

|
||||||
|
|
||||||
|
* [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)
|
||||||
|

|
||||||
|
|
||||||
|
三、[可视化系列(Matplotlib、Bokeh、Seaborn)](https://www.jianshu.com/p/7e186d43d7f1)
|
||||||
|
|
||||||
|
* [Python数据科学速查表 - Matplotlib](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Matplotlib%20绘图.pdf)
|
||||||
|

|
||||||
|
|
||||||
|
* [Python数据科学速查表 - Bokeh](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Bokeh.pdf)
|
||||||
|

|
||||||
|
|
||||||
|
* [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)
|
||||||
|

|
||||||
|
|
||||||
|
四、[机器学习系列(Keras、Scikit-learn)](https://www.jianshu.com/p/cba49ff5fc97)
|
||||||
|
|
||||||
|
* [Python数据科学速查表 - Keras](https://github.com/jaystone776/python-data-science-cheatsheet/blob/master/Python数据科学速查表%20-%20Keras.pdf)
|
||||||
|

|
||||||
|
|
||||||
|
* [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)
|
||||||
|

|
||||||
|
|
||||||
|
五、[PySpark系列(SQL与RDD)](https://www.jianshu.com/p/7dea578c56d8)
|
||||||
|
|
||||||
|
* [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)
|
||||||
|

|
||||||
|
|
||||||
|
* [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)
|
||||||
|

|
||||||
|
|
||||||
|
如果喜欢本文,敬请关注我的简书专题 **[呆鸟的Python数据分析](https://www.jianshu.com/c/38980843c0f2)**
|
||||||
|
|
||||||
|
感谢**天善智能**的**Python爱好者社区**公众号一直以来对我的支持,这里也大力推荐,是我学习入门 Python 数据分析入门的引路者,欢迎关注!
|
||||||
|
|
||||||
|

|
||||||
@ -24,3 +24,6 @@ Hours,Scores
|
|||||||
3.8,35
|
3.8,35
|
||||||
6.9,76
|
6.9,76
|
||||||
7.8,86
|
7.8,86
|
||||||
|
2.1,93
|
||||||
|
2.2,93
|
||||||
|
2.5,93
|
||||||
|
Reference in New Issue
Block a user