aaa
Dijkstra 算法实现原理
https://www.jianshu.com/p/ff6db00ad866
gtest
https://blog.csdn.net/pbe_sedm/article/details/42240885
# -*- coding:utf-8 -*- import calendar import pandas as pd from datetime import datetime import warnings import matplotlib.pyplot as plt import seaborn as sn #pd.options.mode.chained_assignment = None warnings.filterwarnings("ignore", category=DeprecationWarning) #设置选项,防止head()出现省略号 pd.set_option('display.width',None) dailyData = pd.read_csv("d:/train.csv", encoding='gbk') print(dailyData.shape) print(dailyData.head()) print(dailyData.columns.tolist()) #2011-01-01 00:00:00 1 0 0 1 9.84 14.395 81 0.0 3 13 16 dailyData["date"] = dailyData.datetime.apply(lambda x : x.split()[0]) dailyData["hour"] = dailyData.datetime.apply(lambda x : x.split()[1].split(":")[0]) dailyData["weekday"] = dailyData.date.apply(lambda dateString : calendar.day_name[datetime.strptime(dateString,"%Y-%m-%d").weekday()]) dailyData["month"] = dailyData.date.apply(lambda dateString : calendar.month_name[datetime.strptime(dateString,"%Y-%m-%d").month]) dailyData["season"] = dailyData.season.map({1: "Spring", 2 : "Summer", 3 : "Fall", 4 :"Winter" }) dailyData["weather"] = dailyData.weather.map({1: " Clear + Few clouds + Partly cloudy + Partly cloudy",\ 2 : " Mist + Cloudy, Mist + Broken clouds, Mist + Few clouds, Mist ", \ 3 : " Light Snow, Light Rain + Thunderstorm + Scattered clouds, Light Rain + Scattered clouds", \ 4 :" Heavy Rain + Ice Pallets + Thunderstorm + Mist, Snow + Fog " }) categoryVariableList = ["hour","weekday","month","season","weather","holiday","workingday"] for var in categoryVariableList: dailyData[var] = dailyData[var].astype("category") dailyData = dailyData.drop(["datetime"],axis=1) dailyData.head() dataTypeDf = pd.DataFrame(dailyData.dtypes.value_counts()).reset_index().rename(columns={"index":"variableType",0:"count"}) print(dataTypeDf) #------------------------------------------------------------------ new_dic = {} for i in range(dataTypeDf.shape[0]): temp = dataTypeDf.loc[i, "variableType"] tempType = temp.name if tempType in new_dic: new_dic[tempType] = new_dic[tempType] + dataTypeDf.loc[i, "count"] else: new_dic[tempType] = dataTypeDf.loc[i, "count"] print(new_dic) mylist = list() for key in new_dic.keys(): mylist.append([key, new_dic[key]]) print(mylist) dataTypeDf = pd.DataFrame(mylist, columns=list(dataTypeDf)) #-------------------------------------------------------------------------- print(dataTypeDf) fig,ax = plt.subplots() fig.set_size_inches(12,5) sn.barplot(data=dataTypeDf,x="variableType",y="count",ax=ax)#### ax.set(xlabel='variableType', ylabel='Count',title="Variables DataType Count") plt.show()
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架