y='Value', hue='Variable', data=pob_bar, ax=ax1, alpha=0.8, palette='husl') ax1.legend...
value in dftest[4].items(): dfoutput['Critical Value (%s)'%key] = value return df...
defCumsum_cdf(DATA):denominator=len(DATA['VALS'])Data1=pd.Series(DATA['VALS'])# #利用value_counts方法进行分组频数计算 Fre=Data1.value_counts()# #对获得的表格整体按照索引自小到大进行排序 Fre_sort=Fre.sort_index(axis=0,ascending=True)# # 每个数据出现频数除以数据总数才能获得该数据的概率 #...
Gdegree =dict(Gdegree) Gdegree = pd.DataFrame({'name':list(Gdegree.keys()),'degree':list(Gdegree.values())})# 第一张图,所有人物#Gdegree.sort_values(by='degree', ascending=False).plot(x='name', y='degree', kind='bar', color=(136/255, 43/255, 48/255), figsize=(12, 6),...
process_list.append(p)foriinprocess_list: i.join()print('主进程获取Queue数据')print(q.get())#主进程对que进行get操作获取que队列中的数据print(q.get())print(q.get())print('结束测试') 执行结果 I'm process 0, my id: [32900], I put my name to queI'm process 1, my id: [31432]...
value=(df['sepal_length']>6)&(df['sepal_width']>3)# 构造特殊的点 df['color']=np.where(value==True,"#9b59b6","#3498db")# 颜色区分 ax_sub=sns.regplot(data=df,x=df["sepal_length"],y=df["sepal_width"],fit_reg=False,scatter_kws={'facecolors':df['color']},ax=ax[1][1...
df2 = df.fillna(value=0) print(df2) a b c d 2022-04-01 0.400813 0.057102 -0.183773 0.0 2022-04-02 1.652287 -0.487013 0.513329 1.0 2022-04-03 1.124814 0.184821 0.509904 2.0 2022-04-04 0.915201 -0.392358 1.952551 3.0 2022-04-05 1.037104 -0.740828 0.595205 4.0 2022-04-06 0.733508 1.425204...
= 0 for row in sheet.iter_rows(): if(count == 0): count = 1 continue print(row[0].value) short = row[0].value short_type = row[1].value if (word_type == 1): if (int(short_type)<40): continue elif(word_type == 2): ...
missing=df_t.isnull().sum()missing=missing[missing>0]missing.sort_values(inplace=True)missing_label=missing.indexmissing_values=missing.valuesper_value=["{:.2%}".format(i/30000)foriinmissing_values]missing_dic={k: [v,z]fork,v,zinzip(list(missing_label),missing_values,per_value)}print(...
dates= wb.sheets[0].range('B1:C22').value #创建横纵坐标列表 days=[] years=[] for d in dates: delta=datetime.strptime(d[1],'%Y年%m月%d日')-datetime.strptime(d[0],'%Y年%m月%d日') days.append(delta.days) years.append(format((delta.days/365),'0.2f')) ...