首页 文章 精选 留言 我的

精选列表

搜索[图形化操作],共10000篇文章
优秀的个人博客,低调大师

Python 操作 Excel表格

目录导读 Excel 表格的基本认识(重点) 撸起键盘就可干 Excel 表格的认识 在 Python excel 库中,把单个的 excel 文档叫做 workbook 。 一个 workbook 里有许多的 sheet 。 而 sheet 是由 cell 组织的,也就是单个的格子。 在这里可以把每一个 cell 看成一个对象,它有很多属性,如: value, font, type 等,这也就解释了在 office excel 软件中打开,能够看到每一行每一行有各种不同的表现,颜色、字体、边框 等等。 从源头解释了这些概念之后,读取 excel 表格就显得更轻松了。 撸起键盘干 要用到的 Python 库 xlrd,pip 安装 xlrd 库 pip install xlrd #!/usr/bin/python # -*- coding: utf-8 -*- import xlrd filename = u'./XXX.xlsx' excel = xlrd.open_workbook(filename) sheet = excel.sheet_by_name(u'sheet1') # 通过 sheet.row(index)可以访问到每一行 # 获取 sheet 的行数 nrows = sheet.nrows # 获取 sheet 的列数 ncols = sheet.ncols for index in range(0, nrows): sheet.row(index) # 返回 index 行 cell 组成的 list sheet.row(index)[0].value # 获取 index 行,第一个 cell 的值 版权协议参见这里

优秀的个人博客,低调大师

HDFS基本shell操作

在客户端输入Hadoop fs,可以查看所有的,hadoop shell # -help [cmd] //显示命令的帮助信息,如: hadoop fs -help ls # -ls(r) <path> //显示当前目录下所有文件,path是hadoop下的路径,如:/shikun/file # -du(s) <path> //显示目录中所有文件大小 # -count[-q] <path> //显示目录中文件数量 # -mv <src> <dst> //移动多个文件到目标目录 # -cp <src> <dst> //复制多个文件到目标目录 # -rm(r) //删除文件(夹) # -put <localsrc> <dst> //本地文件复制到hdfs # -copyFromLocal //同put # -moveFromLocal //从本地文件移动到hdfs # -get [-ignoreCrc] <src> <localdst> //复制文件到本地,可以忽略crc校验 # -getmerge <src> <localdst> //将源目录中的所有文件排序合并到一个文件中 # -cat <src> //在终端显示文件内容 # -text <src> //在终端显示文件内容 # -copyToLocal [-ignoreCrc] <src> <localdst> //复制到本地 # -moveToLocal <src> <localdst> # -mkdir <path> //创建文件夹 # -touchz <path> //创建一个空文件 HDFS 的shell练习 # hadoop fs -ls / 查看HDFS根目录 # hadoop fs -mkdir /test 在根目录创建一个目录test # hadoop fs -mkdir /test1 在根目录创建一个目录test1 # echo -e 'hadoop second lesson' >test.txt # hadoop fs -put ./test.txt /test 或 # hadoop fs -copyFromLocal ./test.txt /test # cd .. # hadoop fs -get /test/test.txt . 或#hadoop fs -getToLocal /test/test.txt . # hadoop fs -cp /test/test.txt /test1 # hadoop fs -rm /test1/test.txt # hadoop fs -mv /test/test.txt /test1 # hadoop fs -rmr /test1

优秀的个人博客,低调大师

Git仓库操作命令

创建仓库 git init 在当前目录执行,会生成.git目录文件,这个和SVN一致。 提交到仓库 git commit -m "first commit" -m:表示提交描述,必须要填。 添加到远端仓库 git remote add origin git@github.com:test/test.git 推送到远端仓库 git push -u origin master 克隆仓库 直接从远端把代码克隆下来。 git clone git@github.com:test/test.git 仓库状态 git status $ git status On branch master Initial commit Untracked files: (use "git add <file>..." to include in what will be committed) README.md nothing added to commit but untracked files present (use "git add" to track) 仓库更新 git pull 就等同下面。 git fetch git merge 推荐阅读 去BAT面试完的Mysql面试题总结(55道,带完整答案) 阿里高级Java面试题(首发,70道,带详细答案) 2017派卧底去阿里、京东、美团、滴滴带回来的面试题及答案 Spring面试题(70道,史上最全) 通往大神之路,百度Java面试题前200页。 分享Java干货,高并发编程,热门技术教程,微服务及分布式技术,架构设计,区块链技术,人工智能,大数据,Java面试题,以及前沿热门资讯等。

优秀的个人博客,低调大师

Elasticsearch常用操作API

1. 查询所有的索引 1 2 3 4 [root@Server01cx] #curl'10.0.0.5:9200/_cat/indices?v' healthstatusindexprirepdocs.countdocs.deletedstore.sizepri.store.size yellow open customer51206.6kb6.6kb yellow open bank5110000442.1kb442.1kb 2. 查询bank表中的所有数据 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 [root@Server01cx] #curl'10.0.0.5:9200/bank/_search?q=*&pretty' { "took" :41, "timed_out" : false , "_shards" :{ "total" :5, "successful" :5, "failed" :0 }, "hits" :{ "total" :1000, "max_score" :1.0, "hits" :[{ "_index" : "bank" , "_type" : "account" , "_id" : "25" , "_score" :1.0, "_source" :{ "account_number" :25, "balance" :40540, "firstname" : "Virginia" , "lastname" : "Ayala" , "age" :39, "gender" : "F" , "address" : "171PutnamAvenue" , "employer" : "Filodyne" , "email" : "virginiaayala@filodyne.com" , "city" : "Nicholson" , "state" : "PA" } },{ "_index" : "bank" , "_type" : "account" , "_id" : "44" , "_score" :1.0, "_source" :{ "account_number" :44, "balance" :34487, "firstname" : "Aurelia" , "lastname" : "Harding" , "age" :37, "gender" : "M" , "address" : "502BaycliffTerrace" , "employer" : "Orbalix" , "email" : "aureliaharding@orbalix.com" , "city" : "Yardville" , "state" : "DE" } },{ "_index" : "bank" , "_type" : "account" , "_id" : "99" , "_score" :1.0, "_source" :{ "account_number" :99, "balance" :47159, "firstname" : "Ratliff" , "lastname" : "Heath" , "age" :39, "gender" : "F" , "address" : "806RockwellPlace" , "employer" : "Zappix" , "email" : "ratliffheath@zappix.com" , "city" : "Shaft" , "state" : "ND" } },{ "_index" : "bank" , "_type" : "account" , "_id" : "119" , "_score" :1.0, "_source" :{ "account_number" :119, "balance" :49222, "firstname" : "Laverne" , "lastname" : "Johnson" , "age" :28, "gender" : "F" , "address" : "302HowardPlace" , "employer" : "Senmei" , "email" : "lavernejohnson@senmei.com" , "city" : "Herlong" , "state" : "DC" } },{ "_index" : "bank" , "_type" : "account" , "_id" : "126" , "_score" :1.0, "_source" :{ "account_number" :126, "balance" :3607, "firstname" : "Effie" , "lastname" : "Gates" , "age" :39, "gender" : "F" , "address" : "620NationalDrive" , "employer" : "Digitalus" , "email" : "effiegates@digitalus.com" , "city" : "Blodgett" , "state" : "MD" } },{ "_index" : "bank" , "_type" : "account" , "_id" : "145" , "_score" :1.0, "_source" :{ "account_number" :145, "balance" :47406, "firstname" : "Rowena" , "lastname" : "Wilkinson" , "age" :32, "gender" : "M" , "address" : "891EltonStreet" , "employer" : "Asimiline" , "email" : "rowenawilkinson@asimiline.com" , "city" : "Ripley" , "state" : "NH" } },{ "_index" : "bank" , "_type" : "account" , "_id" : "183" , "_score" :1.0, "_source" :{ "account_number" :183, "balance" :14223, "firstname" : "Hudson" , "lastname" : "English" , "age" :26, "gender" : "F" , "address" : "823HerkimerPlace" , "employer" : "Xinware" , "email" : "hudsonenglish@xinware.com" , "city" : "Robbins" , "state" : "ND" } },{ "_index" : "bank" , "_type" : "account" , "_id" : "190" , "_score" :1.0, "_source" :{ "account_number" :190, "balance" :3150, "firstname" : "Blake" , "lastname" : "Davidson" , "age" :30, "gender" : "F" , "address" : "636DiamondStreet" , "employer" : "Quantasis" , "email" : "blakedavidson@quantasis.com" , "city" : "Crumpler" , "state" : "KY" } },{ "_index" : "bank" , "_type" : "account" , "_id" : "208" , "_score" :1.0, "_source" :{ "account_number" :208, "balance" :40760, "firstname" : "Garcia" , "lastname" : "Hess" , "age" :26, "gender" : "F" , "address" : "810NostrandAvenue" , "employer" : "Quiltigen" , "email" : "garciahess@quiltigen.com" , "city" : "Brooktrails" , "state" : "GA" } },{ "_index" : "bank" , "_type" : "account" , "_id" : "222" , "_score" :1.0, "_source" :{ "account_number" :222, "balance" :14764, "firstname" : "Rachelle" , "lastname" : "Rice" , "age" :36, "gender" : "M" , "address" : "333NarrowsAvenue" , "employer" : "Enaut" , "email" : "rachellerice@enaut.com" , "city" : "Wright" , "state" : "AZ" } }] } } took– Elasticsearch执行查询的毫秒响应时间 timed_out– 是否超时 _shards– 查询过的分片,包含成功的分片和失败的分片 hits– 搜索结果 hits.total– 符合搜索结果的记录数 hits.hits– 默认显示前10条搜索结果 _scoreandmax_score- ignore these fields for now 3. 另外一种查询全部结果的方法 1 2 3 4 curl-XPOST '10.0.0.5:9200/bank/_search?pretty' -d' { "query" :{ "match_all" :{}} }' 4. 分页排序的检索例子 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 [root@Server01cx] #curl-XPOST'10.0.0.5:9200/bank/_search?pretty'-d' { "query" :{ "match_all" :{}}, "from" :10, "size" :3, "sort" :{ "balance" :{ "order" : "desc" }} }' { "took" :8, "timed_out" : false , "_shards" :{ "total" :5, "successful" :5, "failed" :0 }, "hits" :{ "total" :1000, "max_score" :null, "hits" :[{ "_index" : "bank" , "_type" : "account" , "_id" : "255" , "_score" :null, "_source" :{ "account_number" :255, "balance" :49339, "firstname" : "Iva" , "lastname" : "Rivers" , "age" :38, "gender" : "M" , "address" : "470RostPlace" , "employer" : "Mantrix" , "email" : "ivarivers@mantrix.com" , "city" : "Disautel" , "state" : "MD" }, "sort" :[49339] },{ "_index" : "bank" , "_type" : "account" , "_id" : "524" , "_score" :null, "_source" :{ "account_number" :524, "balance" :49334, "firstname" : "Salas" , "lastname" : "Farley" , "age" :30, "gender" : "F" , "address" : "499TrucklemansLane" , "employer" : "Xumonk" , "email" : "salasfarley@xumonk.com" , "city" : "Noxen" , "state" : "AL" }, "sort" :[49334] },{ "_index" : "bank" , "_type" : "account" , "_id" : "751" , "_score" :null, "_source" :{ "account_number" :751, "balance" :49252, "firstname" : "Patrick" , "lastname" : "Osborne" , "age" :23, "gender" : "M" , "address" : "915ProspectAvenue" , "employer" : "Gynko" , "email" : "patrickosborne@gynko.com" , "city" : "Takilma" , "state" : "MO" }, "sort" :[49252] }] } } 5. 添加文档,如果id存在则更新文档 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [root@Server01data] #curl-XPUT'10.0.0.5:9200/customer/external/1?pretty'-d' >{ "name" : "JohnDoe" }' { "_index" : "customer" , "_type" : "external" , "_id" : "1" , "_version" :1, "_shards" :{ "total" :2, "successful" :1, "failed" :0 }, "created" : true } [root@Server01data] #curl-XPUT'10.0.0.5:9200/customer/external/1?pretty'-d' { "name" : "JaneDoe" }' { "_index" : "customer" , "_type" : "external" , "_id" : "1" , "_version" :2, "_shards" :{ "total" :2, "successful" :1, "failed" :0 }, "created" : false } 6. 不指定Id时创建文档,可以发现自动生成一个随机Id 1 2 3 4 5 6 7 8 9 10 11 12 13 [root@Server01data] #curl-XPOST'10.0.0.5:9200/customer/external?pretty'-d'{"name":"JaneDoe"}' { "_index" : "customer" , "_type" : "external" , "_id" : "AVTh53KZ4Pj5B2ZQ2voK" , "_version" :1, "_shards" :{ "total" :2, "successful" :1, "failed" :0 }, "created" : true } 7. 修改文档 1 2 3 4 5 6 7 8 9 10 11 12 [root@Server01data] #curl-XPOST'10.0.0.5:9200/customer/external/2/_update?pretty'-d'{"doc":{"name":"favouriteboy","age":18}}' { "_index" : "customer" , "_type" : "external" , "_id" : "2" , "_version" :3, "_shards" :{ "total" :2, "successful" :1, "failed" :0 } } 8. 在开启javascript后,可以使用JS脚本更新文档 1 [root@Server01data] #curl-XPOST'10.0.0.5:9200/customer/external/2/_update?pretty'-d'{"script":"ctx._source.age+=5"}' 9. 删除文档 1 2 3 4 5 6 7 8 9 10 11 12 13 [root@Server01data] #curl-XDELETE'10.0.0.5:9200/customer/external/1?pretty' { "found" : true , "_index" : "customer" , "_type" : "external" , "_id" : "1" , "_version" :4, "_shards" :{ "total" :2, "successful" :1, "failed" :0 } } 10. 批量更新文档 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 [root@Server01data] #curl-XPOST'10.0.0.5:9200/customer/external/_bulk?pretty'-d' { "index" :{ "_id" : "1" }} { "name" : "JohnDoe" } { "index" :{ "_id" : "2" }} { "name" : "JaneDoe" }' { "took" :33, "errors" : false , "items" :[{ "index" :{ "_index" : "customer" , "_type" : "external" , "_id" : "1" , "_version" :3, "_shards" :{ "total" :2, "successful" :1, "failed" :0 }, "status" :200 } }] } [root@Server01data] #curl-XPOST'10.0.0.5:9200/customer/external/_bulk?pretty'-d' >{ "update" :{ "_id" : "1" }} >{ "doc" :{ "name" : "JohnDoebecomesJaneDoe" }} >{ "delete" :{ "_id" : "2" }} >' { "took" :34, "errors" : false , "items" :[{ "update" :{ "_index" : "customer" , "_type" : "external" , "_id" : "1" , "_version" :4, "_shards" :{ "total" :2, "successful" :1, "failed" :0 }, "status" :200 } },{ "delete" :{ "_index" : "customer" , "_type" : "external" , "_id" : "2" , "_version" :5, "_shards" :{ "total" :2, "successful" :1, "failed" :0 }, "status" :200, "found" : true } }] } 本文转自 genuinecx 51CTO博客,原文链接:http://blog.51cto.com/favccxx/1793613,如需转载请自行联系原作者

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册