当前位置: 首页 > news >正文

建一千个网站做长尾词有效果吗手机访问另一部手机访问文件

建一千个网站做长尾词有效果吗,手机访问另一部手机访问文件,大兴区制作网站的公司,写作网站哪个比较赚钱pytorch笔记篇:pandas之数据预处理 pytorch笔记篇:pandas之数据预处理(更新中)测试例代码相关的算子 pytorch笔记篇:pandas之数据预处理(更新中) 测试例代码 print(train_data.iloc[0:4, [0, 1, 2, 3, -3, -2, -1]]) # (※1) 为什么test_da…

pytorch笔记篇:pandas之数据预处理

  • pytorch笔记篇:pandas之数据预处理(更新中)
    • 测试例代码
    • 相关的算子

pytorch笔记篇:pandas之数据预处理(更新中)

测试例代码

print(train_data.iloc[0:4, [0, 1, 2, 3, -3, -2, -1]])
# (1) 为什么test_data的列最后不是-1,是因为test_data没有价格这个列项
all_features = pd.concat((train_data.iloc[:, 1:-1], test_data.iloc[:, 1:]))
print('-----------------------------------------------')
print(all_features.iloc[0:4, [0, 1, 2, 3, -3, -2, -1]])# (2) 获取到不是数值的列index]
numeric_features = all_features.dtypes[all_features.dtypes != 'object'].index# print('++++++++++++++++++++++++')
# (3) print(all_features[numeric_features].iloc[0:3, [0,1,2,3,-3,-2,-1]])
# print('----------------------')
all_features[numeric_features] = all_features[numeric_features].apply(lambda x: (x - x.mean()) / (x.std()))
# print(all_features[numeric_features].iloc[0:3, [0,1,2,3,-3,-2,-1]])
# input()# (4) 在标准化数据之后,所有均值消失,因此我们可以将缺失值设置为0
all_features[numeric_features] = all_features[numeric_features].fillna(0)# (5) dummies & pd to tensor
print('++++++++++  demo test dummies  +++++++++++')
test = pd.DataFrame({'“x”':[1,2,3,4,5, 6], "seasion":['here', 'over', '', 'next', '', 'here']})
print(test)
print('-------------------------------')
test = pd.get_dummies(test, dummy_na=True)
print(test)
test = test*1
print(test)
print('++++++++++  test trans to tensor  +++++++++++')
# test1 = torch.tensor(test)
# 全部转化
test1 = torch.tensor(test.values, dtype=torch.float32)
print(test1.shape)
print(test1)
print('-------------------------------')
# 不用iloc的话就是光是行处理
test2 = torch.tensor(test[:3].values, dtype=torch.float32)
print(test2.shape)
print(test2)
print('-------------------------------')
# 特定行列转化需要熟练运动iloc
test3 = torch.tensor(test.iloc[:2, :-1].values, dtype=torch.float32)
print(test3.shape)
print(test3)
input()output-begin:
(1460, 81)
(1459, 80)Id  MSSubClass MSZoning  LotFrontage SaleType SaleCondition  SalePrice
0   1          60       RL         65.0       WD        Normal     208500
1   2          20       RL         80.0       WD        Normal     181500
2   3          60       RL         68.0       WD        Normal     223500
3   4          70       RL         60.0       WD       Abnorml     140000
-----------------------------------------------MSSubClass MSZoning  LotFrontage  LotArea  YrSold SaleType SaleCondition
0          60       RL         65.0     8450    2008       WD        Normal
1          20       RL         80.0     9600    2007       WD        Normal
2          60       RL         68.0    11250    2008       WD        Normal
3          70       RL         60.0     9550    2006       WD       Abnorml
++++++++++  demo test dummies  +++++++++++“x” seasion
0    1    here
1    2    over
2    3        
3    4    next
4    5        
5    6    here
-------------------------------“x”  seasion_  seasion_here  seasion_next  seasion_over  seasion_nan
0    1     False          True         False         False        False
1    2     False         False         False          True        False
2    3      True         False         False         False        False
3    4     False         False          True         False        False
4    5      True         False         False         False        False
5    6     False          True         False         False        False“x”  seasion_  seasion_here  seasion_next  seasion_over  seasion_nan
0    1         0             1             0             0            0
1    2         0             0             0             1            0
2    3         1             0             0             0            0
3    4         0             0             1             0            0
4    5         1             0             0             0            0
5    6         0             1             0             0            0
++++++++++  test trans to tensor  +++++++++++
torch.Size([6, 6])
tensor([[1., 0., 1., 0., 0., 0.],[2., 0., 0., 0., 1., 0.],[3., 1., 0., 0., 0., 0.],[4., 0., 0., 1., 0., 0.],[5., 1., 0., 0., 0., 0.],[6., 0., 1., 0., 0., 0.]])
-------------------------------
torch.Size([3, 6])
tensor([[1., 0., 1., 0., 0., 0.],[2., 0., 0., 0., 1., 0.],[3., 1., 0., 0., 0., 0.]])
-------------------------------
torch.Size([2, 5])
tensor([[1., 0., 1., 0., 0.],[2., 0., 0., 0., 1.]])
output-end

相关的算子

concat — 合并.
iloc — 筛选行列.
apply — 处理列数据.
fillna — 填补数值空缺.
get_dummies — 独热编码(自行测试显示)

PS: 略。

http://www.dinnco.com/news/70334.html

相关文章:

  • 长春建设网站公司郴州网站seo外包
  • 公司做网站有问题怎么维权郑州手机网站建设
  • 怎么做网站的后台seo接单一个月能赚多少钱
  • 兰州百度网站建设网上推广赚钱方法
  • wordpress分类目录多级菜单金华seo全网营销
  • 课程网站开发开题报告百度网盘网页登录入口
  • 深圳 旅游 网站建设短视频seo优化排名
  • 专业做外挂的网站最近一周的时政热点新闻
  • 台州做网站电话优质外链
  • 如何规划企业网站朝阳seo搜索引擎
  • 天津市城市建设学校官方网站搜索引擎营销有哪些
  • 网站动画用什么做的seo排名赚能赚钱吗
  • IIS 网站 消失关键词优化软件有哪些
  • 中山建设信息网站seo整站优化
  • 网站建设白痴软件软文代发布
  • 乐清建网站公司哪家好国际新闻大事
  • 网站设计排行榜百度指数属于行业趋势及人群
  • x wordpress 视差 主题优化大师电脑版官方免费下载
  • 手机端网站建设的费用清单优化网站的方法
  • 如何查询到某网站开发商seo资源
  • 网络公司网站建设彩铃样本网络营销八大职能
  • 一个虚拟主机做2个网站吗自媒体平台注册下载
  • 做微信网站公司网销平台排名
  • 兴仁县城乡建设局网站网站推广专家
  • 西安千度网站建设全网营销是什么意思
  • 网站开发界面图标设计周口网站seo
  • 海尔公司的网站建设沧州seo推广
  • 用flask做的网站有哪些推广优化网站排名教程
  • 文化传媒公司网站模板中国国家人事人才培训网证书查询
  • 南部县人民医院地址优化设计七年级上册数学答案