数据分析知识
日常遇到的数据分析相关的问题记录
miðlari
努力的人很多,用心的人很少。
展开
-
python-Matplotlib绘图库学习笔记
文章目录常用绘图操作中文乱码问题常用图形绘制散点图条形图直方图饼图学习方式:(点击这里TP)[官网examples入门学习] https://matplotlib.org/examples/index.htmlhttps://matplotlib.org/galler.html安装方式pip install matplotlib导入方式import matplotlib.pyplot as plt基础操作plot(x,y,color='red',linestyle='原创 2020-07-26 00:22:26 · 439 阅读 · 0 评论 -
python-pandas读取CSV文件问题
# index_col = 0 表示以第一列数据作为索引pd.read_csv('UC_Martix.csv', index_col=0)读取效果:原来的读取效果:原创 2020-06-26 22:58:55 · 254 阅读 · 0 评论 -
python-数据取整方法
参考:https://www.jianshu.com/p/75c00c91f6c5参考:https://www.cnblogs.com/mainstream/p/11383136.htmlPython取整的一些方法向下取整:int() , math.floor()>>> a = 12.66>>> int(a)12>>> math.floor(3.14)3>>> math.floor(3.54)3向上取整.原创 2020-06-21 23:55:22 · 464 阅读 · 0 评论 -
python-数据操作—series 类型转换
不能直接float()而是用 .astype(float)原创 2020-06-08 21:25:51 · 9327 阅读 · 0 评论 -
python-数据操作—找出两列数据中相同和不同的元素
这个问题是在我做毕业论文期间,由于需要计算评估指标,要用到两个列表或dataframe中的两列的“你有而我没有”的数据来进行计算,所以参考了这个方法来实现。举个例子,上代码recall_True = [x for x in range(10)] # 观看列表recall_CF = [x for x in range(5,15)] # 预测列表测试数据:recall_True[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]recall_CF[5, 6, 7, 8, 9,原创 2020-06-08 00:45:52 · 11440 阅读 · 3 评论 -
python数据操作—创建空dataframe
在平常为了避免datafram赋值时出现警告或报错,可以尝试创建空的dataframe来“过渡”,代码如下:""" 创建一个空的Dataframe 例子如下"""df = pd.DataFrame(columns=(['colone','coltwo', 'colthree']))结果:原创 2020-06-07 12:41:05 · 6364 阅读 · 0 评论