- 博客(22)
- 收藏
- 关注
原创 Basic data management for R
1. Creating new variable for existing data frame mydata<-data.frame(x1 = c(2, 2, 6, 4), x2 = c(3, 4, 2, 8)) 1.mydata$sumx <- mydata$x1 + mydata$x2 mydata$meanx <- (mydata$x1 + mydata$x2)/2 2.attach(mydata) mydata$sumx <- x1 + x2 mydata
2022-01-12 12:32:42
217
原创 2021-10-26
数据排序 (1).sort_index()在指定轴上根据索引进行排序,默认升序 .sort_index(axis=0,ascending=True) 默认对0轴进行操作 (2).sort_values()在指定轴上根据数值进行排序,默认升序 Series.sort_values(axis=0,ascending=True) DataFrame.sort_values(by,axis=0,ascending=True) by:axis轴上某个索引或索引列表 ...
2021-10-26 16:24:45
134
原创 Pandas库(2)
pandas库的数据类型操作 1.重新索引 reindex 能够改变或重排Series和DataFrame的索引 重排行:index= [] 重排列:columns=[] (2)表格之间操作 (3)删除指定索引对象 drop能删除Series和DataFrame指定行或列索引 算数运算 比较运算 ...
2021-10-25 20:54:09
129
原创 Pandas库
pandas基于numpy,常与matplotlib共同使用 pd.Series(range(20)) Out[15]: 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 dtype: int64
2021-10-25 15:50:21
135
原创 matplotlib基础绘图实例
explode 距离 autopct 显示百分数方式 shadow 是否有阴影 startangle 起始角度 import matplotlib.pyplot as plt labels = 'frog','dog','log','block' sizes = [41,80,56,46] explode= [0,0.2,0,0] plt.pie(sizes,explode=explode,labels=labels,autopct='%1.1f%%',shadow=(Fal...
2021-10-22 18:25:54
251
原创 数据分析之展示
matplotlib库 matplotlib是数据可视化第三方库 matplotlib库由各种可视化类构成。matplotlib.pyplot是绘制各种可视化图形的命令子库,相当于快捷方式。 import matplotlib.plot as plt plt.plot([1,2,6,3]) plt.tlabel("grade") plt.savefig('test',dpi=600) #默认PNG文件 dpi修改文件质量 plt.show() pyplot绘图区域 plt.sub..
2021-10-22 10:07:19
145
原创 python处理图像
from PIL import Image import numpy as np a= np.array(Image.open("C:/Users/Jaryn Yang/Pictures/1.jpg")) b = [255,255 ,255] -a im = Image.fromarray(b.astype('uint8')) im.save("C:/Users/Jaryn Yang/Pictures/2.jpg") convert('L')将彩色图片变为灰度值图片; ...
2021-10-20 17:28:25
1185
原创 数据分析的表示
数据类型:一维 二维 多维 数据维度的Python表示: 一维数据:列表和集合类型: [3 5 6]有序 {3 5 6}无序 二维数据: 列表类型: [ [1 2 3], [4 5 6] ] 高维数据: 字典类型或数据表示格式 numpy 开源的python科学计算基础库 1.强大的n维数组对象ndarray 2.广播功能函数(用于数组间计算) 3.线性代数、傅里叶变换、随机数生成等功能 numpy是scipy、pandas等数据处理或科学计算库的基础 数组下标从0...
2021-09-28 15:59:14
208
原创 回归与内插
线性回归: 是否线性相关: 非线性方程: regression:cftool interpolation内插 当函数值缺少时,可用内插补回来
2021-08-31 21:22:08
168
原创 MATLAB绘图(2)
yyaxis left(x,y1); set(plot(x,y1),'Linestyle','--'); ylable('Left axis';) yysxis right(x,y2); .... 统计图标:hist bar charts: hist看整体情况 bar charts 看个体情况
2021-08-23 17:54:56
91
原创 基本操作与矩阵
who whos函数: whos Name Size Bytes Class Attributes ans 1x1 8 double b 1x1 8 double cos = 'This string'; cos(8) ans = 'r' (matlab starts from 1)...
2021-08-18 11:31:34
71
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人