這次開始之前,我自己有必要先分析一下思路在旱,再開始研讀摇零,到目前為止,我研讀這些東西桶蝎,都沒有跟實(shí)際工作生活像結(jié)合起來驻仅,還是有一種為了學(xué)東西,而學(xué)東西登渣。
我學(xué)這個(gè)有什么用呢噪服?
這是沒能想清楚的問題. 學(xué)了python的這點(diǎn)課,真的可能成為我未來轉(zhuǎn)行大數(shù)據(jù)行業(yè)的技能儲備嗎胜茧?
有時(shí)候會覺得自己很幼稚粘优。
但也一直覺得仇味,能接觸到這項(xiàng)技能真的很有意義。
是不是我把學(xué)習(xí)Python技能雹顺,強(qiáng)制附加了“成為未來轉(zhuǎn)行的必備技能”的期望丹墨,而失去了學(xué)習(xí)東西的那份快樂呢?
好吧嬉愧,廢話幾句贩挣。 不知道,接下來關(guān)于大數(shù)據(jù)的學(xué)習(xí)没酣,該何去何從王财,接著研讀吧婴梧。
import pandas as pd
import numpy as np
import scipy.stats
import matplotlib.pyplot as plt
import matplotlib # ?? 只引用matplotlib 和.pyplot 之間的區(qū)別是什么呢贮预?
matplotlib.style.use('ggplot')
%matplotlib inline
#%config BackendInline.forture_commat('retina')
#%config InlineBackend.fortune_format = 'retina'
#
%config InlineBackend.figure_format = 'retina'
#錯(cuò)誤記錄: 配置圖形格式為retina這段代碼奶浦,總是寫錯(cuò)歼冰。 1. figure_format 誊薄,拼寫錯(cuò)誤明顯羡滑。 2. 不是用括號弹澎,而是直接等于绞铃。
# 新增知識點(diǎn): ggplot哎垦,是一個(gè)r語言的圖形繪制包囱嫩,可以像圖層一樣繪制,很好用漏设。
ls data
驅(qū)動器 C 中的卷是 WIN7
卷的序列號是 CCED-57EE
C:\Users\Administrator.USER-20170623BT\Desktop\第七課材料\第七課材料\codes\data 的目錄
2017/08/31 12:13 <DIR> .
2017/08/31 12:13 <DIR> ..
2017/08/14 17:39 6,148 .DS_Store
2017/08/14 12:37 14,142 data_75_12.csv
2017/08/14 17:50 3,930 evolution.csv
2017/08/14 13:15 8,568 fortis_heritability.csv
4 個(gè)文件 32,788 字節(jié)
2 個(gè)目錄 40,510,488,576 可用字節(jié)
我不能在自己電腦上直接使用帶感嘆號的方式運(yùn)行l(wèi)inux命令墨闲。 但是去掉感嘆號后,卻出現(xiàn)了比較多的文件夾信息郑口。
數(shù)據(jù)導(dǎo)入和清洗
這部分主要是把粗糙的數(shù)據(jù)進(jìn)行清洗
evolution = pd.read_csv(r'data/evolution.csv')
# 錯(cuò)誤記錄:1. 代碼和文件沒有在同一層文件夾中鸳碧,所以應(yīng)該加入文件夾地址“data/”,我天真地以為可以直接導(dǎo)入 2. csv犬性,被我搞成了scv
evolution.head()
evolution.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 83 entries, 0 to 82
Data columns (total 8 columns):
Year 82 non-null object
Species 81 non-null object
Beak length 81 non-null object
Beak depth 80 non-null float64
Beak width 80 non-null float64
CI Beak length 80 non-null object
CI Beak depth 80 non-null object
CI Beak width 80 non-null object
dtypes: float64(2), object(6)
memory usage: 5.3+ KB
只有兩個(gè)數(shù)字是float類型瞻离,還有絕大部分?jǐn)?shù)據(jù)都不是82個(gè)。
evolution = evolution.dropna()
evolution.info()
# 新增知識點(diǎn):data.dropna() 是刪除缺失值的方法乒裆,把數(shù)值不齊全的列給刪除掉套利。
<class 'pandas.core.frame.DataFrame'>
Int64Index: 80 entries, 0 to 82
Data columns (total 8 columns):
Year 80 non-null object
Species 80 non-null object
Beak length 80 non-null object
Beak depth 80 non-null float64
Beak width 80 non-null float64
CI Beak length 80 non-null object
CI Beak depth 80 non-null object
CI Beak width 80 non-null object
dtypes: float64(2), object(6)
memory usage: 5.6+ KB
#evolution['Beak length']= pd.numeric['Beak length']
#錯(cuò)誤記錄: 1轉(zhuǎn)換為數(shù)值類型需要有對象啊。 對象一半都在括號中鹤耍。 我現(xiàn)在感覺python很像是一個(gè)超大的工具包肉迫,我說我要A工具,它流把掏出來稿黄,不過工具太多喊衫,我得說明白
# 所以我要說,我需要用A工具去操作對象a.
#2. 轉(zhuǎn)換為什么的話杆怕,是需要加to的族购,我并沒有加鼻听,也就是基本的拼寫錯(cuò)誤。
evolution['Beak length'] = pd.to_numeric(evolution['Beak length'])
evolution['Beak length'].head()
0 10.76
1 10.72
2 10.57
3 10.64
4 10.73
Name: Beak length, dtype: float64
evolution['CI Beak length'] = pd.to_numeric(evolution['CI Beak length'],errors='coerce')
#新增知識點(diǎn):強(qiáng)制轉(zhuǎn)化為數(shù)據(jù)類型联四,但遇到不能轉(zhuǎn)化的額撑碴,就用null代替
evolution['CI Beak depth'] = pd.to_numeric(evolution['CI Beak depth'],errors='coerce')
evolution['CI Beak width'] = pd.to_numeric(evolution['CI Beak width'],errors='coerce')
evolution.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 80 entries, 0 to 82
Data columns (total 8 columns):
Year 80 non-null object
Species 80 non-null object
Beak length 80 non-null float64
Beak depth 80 non-null float64
Beak width 80 non-null float64
CI Beak length 79 non-null float64
CI Beak depth 79 non-null float64
CI Beak width 79 non-null float64
dtypes: float64(6), object(2)
memory usage: 5.6+ KB
初步的數(shù)據(jù)清洗,就完成了朝墩,若是要?jiǎng)h除某些列呢醉拓? 該咋辦呀?
數(shù)據(jù)探索
evolution.head()
evolution.tail()
<div>
<style>
.dataframe thead tr:only-child th {
text-align: right;
}
.dataframe thead th {
text-align: left;
}
.dataframe tbody tr th {
vertical-align: top;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Year</th>
<th>Species</th>
<th>Beak length</th>
<th>Beak depth</th>
<th>Beak width</th>
<th>CI Beak length</th>
<th>CI Beak depth</th>
<th>CI Beak width</th>
</tr>
</thead>
<tbody>
<tr>
<th>78</th>
<td>2008</td>
<td>scandens</td>
<td>13.31</td>
<td>9.08</td>
<td>8.72</td>
<td>0.109</td>
<td>0.087</td>
<td>0.084</td>
</tr>
<tr>
<th>79</th>
<td>2009</td>
<td>scandens</td>
<td>13.33</td>
<td>9.08</td>
<td>8.73</td>
<td>0.099</td>
<td>0.085</td>
<td>0.081</td>
</tr>
<tr>
<th>80</th>
<td>2010</td>
<td>scandens</td>
<td>13.30</td>
<td>9.07</td>
<td>8.71</td>
<td>0.102</td>
<td>0.081</td>
<td>0.076</td>
</tr>
<tr>
<th>81</th>
<td>2011</td>
<td>scandens</td>
<td>13.35</td>
<td>9.10</td>
<td>8.75</td>
<td>0.106</td>
<td>0.085</td>
<td>0.078</td>
</tr>
<tr>
<th>82</th>
<td>2012</td>
<td>scandens</td>
<td>13.41</td>
<td>9.19</td>
<td>8.82</td>
<td>0.131</td>
<td>0.120</td>
<td>0.109</td>
</tr>
</tbody>
</table>
</div>
evolution.Species.value_counts()
#錯(cuò)誤記錄: value——count可是只針對一列的匯總統(tǒng)計(jì)收苏,我輸入的是evolution.value_counts()對象是整個(gè)數(shù)據(jù)啊亿卤,而我只是想要其中的一列
fortis 40
scandens 40
Name: Species, dtype: int64
#對了,怎么修改列名稱來著鹿霸?
evolution.rename(columns = {'Species':'species'},inplace=True)
#錯(cuò)誤記錄排吴,未加引號
evolution.head()
#@@自行百度的哦
<div>
<style>
.dataframe thead tr:only-child th {
text-align: right;
}
.dataframe thead th {
text-align: left;
}
.dataframe tbody tr th {
vertical-align: top;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Year</th>
<th>species</th>
<th>Beak length</th>
<th>Beak depth</th>
<th>Beak width</th>
<th>CI Beak length</th>
<th>CI Beak depth</th>
<th>CI Beak width</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>1973</td>
<td>fortis</td>
<td>10.76</td>
<td>9.48</td>
<td>8.69</td>
<td>0.097</td>
<td>0.130</td>
<td>0.081</td>
</tr>
<tr>
<th>1</th>
<td>1974</td>
<td>fortis</td>
<td>10.72</td>
<td>9.42</td>
<td>8.66</td>
<td>0.144</td>
<td>0.170</td>
<td>0.112</td>
</tr>
<tr>
<th>2</th>
<td>1975</td>
<td>fortis</td>
<td>10.57</td>
<td>9.19</td>
<td>8.55</td>
<td>0.075</td>
<td>0.084</td>
<td>0.057</td>
</tr>
<tr>
<th>3</th>
<td>1976</td>
<td>fortis</td>
<td>10.64</td>
<td>9.23</td>
<td>8.58</td>
<td>0.048</td>
<td>0.053</td>
<td>0.039</td>
</tr>
<tr>
<th>4</th>
<td>1977</td>
<td>fortis</td>
<td>10.73</td>
<td>9.35</td>
<td>8.63</td>
<td>0.085</td>
<td>0.092</td>
<td>0.066</td>
</tr>
</tbody>
</table>
</div>
fortis = evolution[evolution.species=='fortis']
fortis.tail()
<div>
<style>
.dataframe thead tr:only-child th {
text-align: right;
}
.dataframe thead th {
text-align: left;
}
.dataframe tbody tr th {
vertical-align: top;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Year</th>
<th>species</th>
<th>Beak length</th>
<th>Beak depth</th>
<th>Beak width</th>
<th>CI Beak length</th>
<th>CI Beak depth</th>
<th>CI Beak width</th>
</tr>
</thead>
<tbody>
<tr>
<th>35</th>
<td>2008</td>
<td>fortis</td>
<td>10.28</td>
<td>8.57</td>
<td>8.29</td>
<td>0.099</td>
<td>0.094</td>
<td>0.076</td>
</tr>
<tr>
<th>36</th>
<td>2009</td>
<td>fortis</td>
<td>10.28</td>
<td>8.51</td>
<td>8.27</td>
<td>0.095</td>
<td>0.087</td>
<td>0.070</td>
</tr>
<tr>
<th>37</th>
<td>2010</td>
<td>fortis</td>
<td>10.42</td>
<td>8.52</td>
<td>8.33</td>
<td>0.097</td>
<td>0.086</td>
<td>0.071</td>
</tr>
<tr>
<th>38</th>
<td>2011</td>
<td>fortis</td>
<td>10.46</td>
<td>8.57</td>
<td>8.34</td>
<td>0.103</td>
<td>0.096</td>
<td>0.076</td>
</tr>
<tr>
<th>39</th>
<td>2012</td>
<td>fortis</td>
<td>10.51</td>
<td>8.65</td>
<td>8.38</td>
<td>0.150</td>
<td>0.146</td>
<td>0.117</td>
</tr>
</tbody>
</table>
</div>
scandens = evolution[evolution.species=='scandens']
scandens.tail()
#所有方括號的外的數(shù)據(jù),給定了范圍懦鼠,方括號內(nèi)钻哩,就是篩選數(shù)據(jù)范圍。
#evolution.species[evolution.species=='scandens']vsevolution[evolution.species=='scandens'] 是截然不同的結(jié)果
<div>
<style>
.dataframe thead tr:only-child th {
text-align: right;
}
.dataframe thead th {
text-align: left;
}
.dataframe tbody tr th {
vertical-align: top;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>Year</th>
<th>species</th>
<th>Beak length</th>
<th>Beak depth</th>
<th>Beak width</th>
<th>CI Beak length</th>
<th>CI Beak depth</th>
<th>CI Beak width</th>
</tr>
</thead>
<tbody>
<tr>
<th>78</th>
<td>2008</td>
<td>scandens</td>
<td>13.31</td>
<td>9.08</td>
<td>8.72</td>
<td>0.109</td>
<td>0.087</td>
<td>0.084</td>
</tr>
<tr>
<th>79</th>
<td>2009</td>
<td>scandens</td>
<td>13.33</td>
<td>9.08</td>
<td>8.73</td>
<td>0.099</td>
<td>0.085</td>
<td>0.081</td>
</tr>
<tr>
<th>80</th>
<td>2010</td>
<td>scandens</td>
<td>13.30</td>
<td>9.07</td>
<td>8.71</td>
<td>0.102</td>
<td>0.081</td>
<td>0.076</td>
</tr>
<tr>
<th>81</th>
<td>2011</td>
<td>scandens</td>
<td>13.35</td>
<td>9.10</td>
<td>8.75</td>
<td>0.106</td>
<td>0.085</td>
<td>0.078</td>
</tr>
<tr>
<th>82</th>
<td>2012</td>
<td>scandens</td>
<td>13.41</td>
<td>9.19</td>
<td>8.82</td>
<td>0.131</td>
<td>0.120</td>
<td>0.109</td>
</tr>
</tbody>
</table>
</div>
fortis.plot(x='Year',y=['Beak length','Beak depth','Beak width'])
#錯(cuò)誤記錄:1. y= 后面只能有一個(gè)對象肛冶,我的逗號街氢,就反映了有多個(gè)對象,應(yīng)該把多個(gè)對象用方括號連起來睦袖。
#2. 我竟然直接開始畫圖珊肃,用plt.plot開頭,連data都沒有馅笙。 應(yīng)該是fortis.plot伦乔,笨!董习!
<matplotlib.axes._subplots.AxesSubplot at 0xa4d6128>
scandens.plot(x='Year',y=['Beak length','Beak depth','Beak width'])
<matplotlib.axes._subplots.AxesSubplot at 0xa9006d8>
scandens.plot(x='Year',y=['Beak length','Beak depth','Beak width'],subplots = True,figsize=(10,6))
#新增知識點(diǎn):1.subplots烈和,意思應(yīng)該是在多幅圖上作圖,而非在一張圖上顯示
array([<matplotlib.axes._subplots.AxesSubplot object at 0x000000000BA26898>,
<matplotlib.axes._subplots.AxesSubplot object at 0x000000000BB0FC88>,
<matplotlib.axes._subplots.AxesSubplot object at 0x000000000BB5F240>], dtype=object)
fortis.plot(x='Year',y='Beak depth',yerr='CI Beak depth',color='Red',marker='o',figsize=(10,5))
#新增知識點(diǎn):yerr阱飘,marker
<matplotlib.axes._subplots.AxesSubplot at 0xd339b00>
scandens.plot(x='Year',y='Beak depth',yerr='CI Beak depth',color='Orange',marker='o',figsize=(11,4))
<matplotlib.axes._subplots.AxesSubplot at 0xe03fc88>
75年和12年的數(shù)據(jù)比較
ls data
驅(qū)動器 C 中的卷是 WIN7
卷的序列號是 CCED-57EE
C:\Users\Administrator.USER-20170623BT\Desktop\第七課材料\第七課材料\codes\data 的目錄
2017/08/31 12:13 <DIR> .
2017/08/31 12:13 <DIR> ..
2017/08/14 17:39 6,148 .DS_Store
2017/08/14 12:37 14,142 data_75_12.csv
2017/08/14 17:50 3,930 evolution.csv
2017/08/14 13:15 8,568 fortis_heritability.csv
4 個(gè)文件 32,788 字節(jié)
2 個(gè)目錄 40,499,621,888 可用字節(jié)
data = pd.read_csv('data/data_75_12.csv')
data.head()
這組數(shù)據(jù)中只包含有75年和12年的所有樣本斥杜,而剛才的是每年的數(shù)據(jù)一個(gè)均值虱颗。
data.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 651 entries, 0 to 650
Data columns (total 4 columns):
species 651 non-null object
length 651 non-null float64
depth 651 non-null float64
year 651 non-null int64
dtypes: float64(2), int64(1), object(1)
memory usage: 20.4+ KB
data.year.value_counts()
1975 403
2012 248
Name: year, dtype: int64
data.species.value_counts()
fortis 437
scandens 214
Name: species, dtype: int64
data.groupby(['species','year']).count()
#錯(cuò)誤記錄: 1. groupby后面的對象應(yīng)該是括號啊沥匈,用方括號,往往都是為了把多個(gè)數(shù)據(jù)忘渔,合并為一個(gè)對象高帖。 2. groupby的計(jì)數(shù),是不加s的畦粮。
data.groupby(['species','year']).mean()
.dataframe thead tr:only-child th {
text-align: right;
}
.dataframe thead th {
text-align: left;
}
.dataframe tbody tr th {
vertical-align: top;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th></th>
<th>length</th>
<th>depth</th>
</tr>
<tr>
<th>species</th>
<th>year</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="2" valign="top">fortis</th>
<th>1975</th>
<td>10.565190</td>
<td>9.171646</td>
</tr>
<tr>
<th>2012</th>
<td>10.517355</td>
<td>8.605372</td>
</tr>
<tr>
<th rowspan="2" valign="top">scandens</th>
<th>1975</th>
<td>14.120920</td>
<td>8.960000</td>
</tr>
<tr>
<th>2012</th>
<td>13.421024</td>
<td>9.186220</td>
</tr>
</tbody>
</table>
</div>
fortis2 = data[data.species=='fortis']
fortis2.head()
<div>
<style>
.dataframe thead tr:only-child th {
text-align: right;
}
.dataframe thead th {
text-align: left;
}
.dataframe tbody tr th {
vertical-align: top;
}
fortis2.boxplot(by='year',figsize=(10,5))
array([<matplotlib.axes._subplots.AxesSubplot object at 0x000000000F518898>,
<matplotlib.axes._subplots.AxesSubplot object at 0x000000000F02D320>], dtype=object)
scandens2 = data[data.species=='scandens']
scandens2.head()
scandens2.boxplot(by='year',figsize=(10,5))
array([<matplotlib.axes._subplots.AxesSubplot object at 0x000000000D009908>,
<matplotlib.axes._subplots.AxesSubplot object at 0x000000000F6F94E0>], dtype=object)
中地雀鳥喙深度和長度的變化
##按時(shí)間給中地雀的樣本分組
fortis75 = fortis2[fortis2.year==1975]
# 為什么對時(shí)間的切片散址,不用加引號呢乖阵? 引號只是對str類型有效嗎?
fortis12 = fortis2[fortis2.year==2012]
fortis75.hist()
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x00000000121EF518>,
<matplotlib.axes._subplots.AxesSubplot object at 0x0000000011EFFD68>],
[<matplotlib.axes._subplots.AxesSubplot object at 0x0000000011F3ACC0>,
<matplotlib.axes._subplots.AxesSubplot object at 0x0000000011F79080>]], dtype=object)
Traceback (most recent call last):
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\util\connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "d:\ProgramData\Anaconda3\lib\socket.py", line 743, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 844, in _validate_conn
conn.connect()
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\connection.py", line 284, in connect
conn = self._new_conn()
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x0000000011CBFF28>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py", line 438, in send
timeout=timeout
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\util\retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='webpush.wx.qq.com', port=443): Max retries exceeded with url: /cgi-bin/mmwebwx-bin/synccheck?r=1509079787533&skey=%40crypt_36e69409_f98db12a80ac4d61526912f12b9546ae&sid=jynkiOEPmg7Iqxcv&uin=277207840&deviceid=e579034563178671&synckey=1_700988587%7C2_700988643%7C3_700988607%7C11_700988609%7C13_700760080%7C201_1509095461%7C203_1509093320%7C1000_1509095141%7C1001_1509063733&_=1509079787533 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x0000000011CBFF28>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\ProgramData\Anaconda3\lib\site-packages\itchat\components\login.py", line 300, in sync_check
r = self.s.get(url, params=params, headers=headers, timeout=config.TIMEOUT)
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 531, in get
return self.request('GET', url, **kwargs)
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 518, in request
resp = self.send(prep, **send_kwargs)
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 639, in send
r = adapter.send(request, **kwargs)
File "d:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py", line 502, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='webpush.wx.qq.com', port=443): Max retries exceeded with url: /cgi-bin/mmwebwx-bin/synccheck?r=1509079787533&skey=%40crypt_36e69409_f98db12a80ac4d61526912f12b9546ae&sid=jynkiOEPmg7Iqxcv&uin=277207840&deviceid=e579034563178671&synckey=1_700988587%7C2_700988643%7C3_700988607%7C11_700988609%7C13_700760080%7C201_1509095461%7C203_1509093320%7C1000_1509095141%7C1001_1509063733&_=1509079787533 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x0000000011CBFF28>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\ProgramData\Anaconda3\lib\site-packages\itchat\components\login.py", line 244, in maintain_loop
i = sync_check(self)
File "d:\ProgramData\Anaconda3\lib\site-packages\itchat\components\login.py", line 303, in sync_check
if not isinstance(e.args[0].args[1], BadStatusLine):
IndexError: tuple index out of range
LOG OUT!