自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 收藏
  • 关注

原创 【无标题】

创建视图:逻辑上的虚拟表create view v_auther(编号,姓名)asselect * from autherwith check option;查询视图和查询表一样创建索引create index index_name on emp(emp_name); 在emp表的emp_name字段创建索引,索引名为index_name添加unique说明它的值不能重复单独创建唯一索引create unique index index_name on em...

2022-05-08 22:36:20 49

原创 爬虫:四种统计图

#方位图import numpy as npimport matplotlib.pyplot as plt#定义数据ypoints=np.array([1,3,9,25,12,32,5,1])#数据插入到图标# plt.plot(ypoints,'o:g')# plt.plot(ypoints,marker='o',linestyle=":",color='g')plt.plot(ypoints,marker='o',ls=":",c='g',linewidth='1.5')#设置x.

2022-05-08 21:57:38 79

原创 hadoop_统计文本单词

import org.apache.hadoop.io.IntWritable;import org.apache.hadoop.io.LongWritable;import org.apache.hadoop.io.Text;import org.apache.hadoop.mapreduce.Mapper;import java.io.IOException;/** * LongWritable 偏移量 long,表示该行在文件中的位置,而不是行号 * Text map阶段的输入数据 一.

2022-05-08 21:52:37 64

原创 操作pandas

#先下载pip install pandasSeriesimport pandas as pa;print(pa.__version__)#定义字典mydataset ={ 'size':["Goole","Runoob","wiki"], 'number':[1,2,3]}#将字典转换为DataFrame,才能处理mydf=pa.DataFrame(mydataset)print(mydf)a=[1,2,3]mysr=pa.Serie...

2022-05-01 23:12:25 53

原创 mysql查询优化和参数优化

#建表use test;create table if not exists t(id int,num int defalult 0,name varchar(20));create index ix_num on t(num);#避免查询null#未使用索引select id from t where num=null;#使用索引select id from t where num=0;#避免使用!=、<>(也是!=) 未使用索引select * fr.

2022-05-01 23:03:38 767

原创 numpy函数爬虫

下载numpy包from numpy import *print(eye(4)) 打印4行4列的数组,每个数后面都有小数点,第n行第n列的数都为一,其余为0(1<=n<=4)import numpy as npimport numpy as npa=np.array([1,2,3])创建一个ndarray对象 ndarray是多维数组 dimensional 维度print(a.dtype)打印数据类型 int32表示4字节的整形print(a.shape)打印数组的元素个.

2022-04-24 23:07:56 53

原创 sql数据库

select(select count(*) from city)-count(*) from city where id<=5count(*) from city where id<=5 sql语句中的这一部分语句查询了5行数据 select * from city where id>5;扫描了95次select count(*) from city;速度更快,但是加了where就不一样了#建表create table if not exists cnt(id i...

2022-04-24 23:05:58 84

原创 java操作sql

配置ssh免登陆生成ssh免登陆密钥cd ~,进入到我的home目录cd .ssh/ssh-keygen -t rsa (四个回车)执行完这个命令后,会生成两个文件id_rsa(私钥)、id_rsa.pub(公钥)将公钥拷贝到要免登陆的机器上cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys cat是查看或ssh-copy-id -i localhost关闭所有stop-all.sh开启所有start

2022-04-24 22:53:50 234

原创 爬虫xpath使用

先在控制台下载pip install lxml导入from lxml import etree使用date = """ <div> <ul> <li class="item-0"><a href="link1.html">first item</a></li> <li class="item-1"...

2022-04-10 22:45:41 62

原创 hadoop分布式搭建

1.准备Linux环境1.1 开启网络,ifconfig指令查看ip1.2 修改主机名为自己名字(hadoop)vim /etc/sysconfig/networkNETWORKING=yesHOSTNAME=hadoop1.3修改主机名和IP的映射关系vim /etc/hosts192.168.182.128 hadoop1.4关闭防火墙#查看防火墙状态service iptables status#关闭防火墙service ip...

2022-04-10 22:44:23 35

原创 爬虫本周xpath使用

先在控制台下载pip install lxml导入from lxml import etree使用date = """ <div> <ul> <li class="item-0"><a href="link1.html">first item</a></li> <li class="item-1"&gt...

2022-04-10 22:39:55 52

原创 mysql范式

第一范式(1NF)数据表的每一列都要保持他的原子特性,也就是列不能在被分割。简而言之,第一范式就是无重复的列。第二范式(2NF)属性必须完全依赖于主键,消除部分依赖。简而言之,第二范式就是非主属性完全依赖于主关键字。第三范式(3NF)消除传递依赖。简而言之,第三范式就是属性不依赖于其它非主属性。...

2022-04-10 22:33:33 489

原创 hadoop分布式搭建框架

1.准备Linux环境1.1 开启网络,ifconfig指令查看ip1.2 修改主机名为自己名字(hadoop)vim /etc/sysconfig/networkNETWORKING=yesHOSTNAME=hadoop1.3修改主机名和IP的映射关系vim /etc/hosts192.168.182.128 hadoop1.4关闭防火墙#查看防火墙状态service iptables status#关闭防火墙service ip...

2022-04-10 22:30:09 121

原创 网络爬虫scrapy

python -m pip install --upgrade pip 这条是更新pip install wheelpip install lxmlpip install twistedpip install pywin32pip install scrapy下一步创建项目cd desktop 切换工作目录到桌面,将文件保存到桌面scrapy startproject TXmovies 创建项目cd TXmoviesscrapy genspider txms v...

2022-04-03 21:23:39 51

原创 hadoop触发器,回滚,存储过程

触发器USE test;CREATE TABLE IF NOT EXISTS student(username VARCHAR(20),PASSWORD VARCHAR(20),stuid INT AUTO_INCREMENT PRIMARY KEY,birthday DATE);DROP TABLE student;SELECT * FROM student;#创建学生表INSERT INTO student(username,PASSWORD...

2022-04-03 21:19:50 2328

原创 shell指令__邝俊华

chmod +x test.sh #给test文件添加权限./test.sh #运行文件/home/test2.sh #运行指定目录下的文件首先输入指令vim test.sh编辑文件#!/bin/bashif truethen echo "hello world"fi#使用if判断输出dt=`date +'%d'`echo $dtif [ $dt = "02" ]then echo '123456'elseecho 'aaa'fi#使用for.

2022-03-20 21:13:23 798

原创 mysql——索引__邝俊华

1、单独创建索引create index 索引名 on 表名(要创建索引的列名);create index index_name on emp(emp_name);2、修改表结构创建索引alter table 表名 add index 索引名(要创建索引的名);alter table emp add index index_salary(salary);3、删除索引drop index 索引名 on 表名;drop index index_name on emp;4、单独

2022-03-20 21:05:39 47

原创 SQL数据库~邝俊华

CREATE DATABASE IF NOT EXISTS inof DEFAULT CHARSET utf8;USE inof;CREATE TABLE IF NOT EXISTS ad(sid INT PRIMARY KEY AUTO_INCREMENT, sname VARCHAR(20), gender VARCHAR(20), class_id INT);INSERT INTO ad(sname,gender,class_id)VALUES("张三","男",1)...

2022-03-13 21:53:07 621

原创 Linux指令~邝俊华

1.ls查看当前目录下的所有目录和文件ls -a 列出当前目录下所有文件如果不加任何选项的话,ls命令仅列出当前目录下的文件和目录名,想看目录下的内容可以使用 ls -(指定目录)2.pwd查看当前工作目录的完整路径3.cd切换当前目录cd ~ 跳转到自己home目录4.mkdir用于创建目录创建多级文件夹 : mkdir -p aaa/01/025.touch创建新的空文件创建多个文件 touch aaa.txt bbb.txt6.cp复

2022-03-13 21:38:40 1155

原创 网络爬虫~邝俊华

爬虫~~~~邝俊华from urllib import request# 构造一个请求req = request.Request("http://www.baidu.com")# 然后在打开网页resp = request.urlopen(req)# 读取网页内容print(resp.read())#打开网页reponse=request.urlopen("http://www.baidu.com")#read方法读取网页内容print(reponse.read())...

2022-03-13 20:54:42 59

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除