date

pandas从入门到上楼

折月煮酒 提交于 2020-04-08 12:01:20
数据对象 pandas主要有两种数据对象 Series DataFrame 注: 后面代码使用pandas版本0.20.1,通过import pandas as pd引入 Series Series是一种带有索引的序列对象 创建方式 简单创建如下 # 通过传入一个序列给pd.Series初始化一个Series对象, 比如list s1 = pd.Series(list("1234")) print(s1) 0 1 1 2 2 3 3 4 dtype: object DataFrame 类似与数据库table有行列的数据对象 创建方式如下 # 通过传入一个numpy的二维数组或者dict对象给pd.DataFrame初始化一个DataFrame对象 # 通过numpy二维数组 import numpy as np df1 = pd.DataFrame(np.random.randn(6,4)) print(df1) 0 1 2 3 0 -0.646340 -1.249943 0.393323 -1.561873 1 0.371630 0.069426 1.693097 0.907419 2 -0.328575 -0.256765 0.693798 -0.787343 3 1.875764 -0.416275 -1.028718 0.158259 4 1.644791 -1

牛客网数据库SQL实战剖析(1-10)

邮差的信 提交于 2020-04-07 22:36:52
1. 查找最晚入职员工的所有信息 CREATE TABLE `employees` ( `emp_no` int(11) NOT NULL, `birth_date` date NOT NULL, `first_name` varchar(14) NOT NULL, `last_name` varchar(16) NOT NULL, `gender` char(1) NOT NULL, `hire_date` date NOT NULL, PRIMARY KEY (`emp_no`)); 解题思路:根据入职时间倒序排序 order by ... DESC ,然后再取一条记录,就是最晚入职的员工。 select * from employees order by hire_date DESC limit 1; 这样做有一个问题, hire_date 是 date 类型,很有可能多条记录中是同一个时间入职的,所以说时间类型还是用时间戳比较精切。 针对这道题目可以使用 MAX() 函数,然后用一个子查询。 select * from employees where hire_date = (select MAX(hire_date) FROM employees); MAX() 先查询出最晚入职的时间,然后再查询出在最晚时间入职的所有员工。 2.

hibernate 02之helloworld

笑着哭i 提交于 2020-04-07 18:18:32
1、安装插件 安装方法说明(hibernatetools-4.1.1.Final): Help --> Install New Software... Click Add... In dialog Add Site dialog, click Archive... Navigate to hibernatetools-Update-4.1.1.Final_2013-12-08_01-06-33-B605.zip and click Open Clicking OK in the Add Site dialog will bring you back to the dialog 'Install' Select the Jboss Tools hibernatetools Nightly Build Update Site that has appeared Click Next and then Finish Approve the license Restart eclipse when that is asked 2、导入 Hibernate 必须的 jar 包: 加入数据库驱动的 jar 包: 3、Hibernate开发步骤 代码结构如下: 1、创建 Hibernate 配置文如下:hibernate.cfg.xml <?xml version="1.0" encoding=

【转】 mysql格式化日期

社会主义新天地 提交于 2020-04-07 17:52:34
原文地址: https://www.cnblogs.com/shuilangyizu/p/8036620.html mysql查询记录如果有时间戳字段时,查看结果不方便,不能即时看到时间戳代表的含义,现提供mysql格式换时间函数,可以方便的看到格式化后的时间。 1. DATE_FORMAT() 函数用于以不同的格式显示日期/时间数据。 DATE_FORMAT(date,format) format参数的格式有 %a 缩写星期名 %b 缩写月名 %c 月,数值 %D 带有英文前缀的月中的天 %d 月的天,数值(00-31) %e 月的天,数值(0-31) %f 微秒 %H 小时 (00-23) %h 小时 (01-12) %I 小时 (01-12) %i 分钟,数值(00-59) %j 年的天 (001-366) %k 小时 (0-23) %l 小时 (1-12) %M 月名 %m 月,数值(00-12) %p AM 或 PM %r 时间,12-小时(hh:mm:ss AM 或 PM) %S 秒(00-59) %s 秒(00-59) %T 时间, 24-小时 (hh:mm:ss) %U 周 (00-53) 星期日是一周的第一天 %u 周 (00-53) 星期一是一周的第一天 %V 周 (01-53) 星期日是一周的第一天,与 %X 使用 %v 周 (01-53)

Can I make node.js Date always be in UTC/GMT?

≯℡__Kan透↙ 提交于 2020-04-07 17:40:54
问题 My app runs on Linux servers, where the time (naturally) set to UTC/GMT. However the app is developed on Mac desktops where the time is typically set to a local timezone. I could change every new Date() in my code to run: var date = new Date().getTime(); And thus ensure dates on the server are always GMT, but that seems inelegant. I understand previous versions of node used to always return UTC/GMT. Is there any way to bring this behavior back? Edit: Removed adding timezone offset to getTime(

C语言入门

淺唱寂寞╮ 提交于 2020-04-07 16:43:48
文章转自 https://www.imooc.com/course/programdetail/pid/37 c语言入门 C语言一经出现就以其功能丰富、表达能力强、灵活方便、应用面广等特点迅速在全世界普及和推广。C语言不但执行效率高而且可移植性好,可以用来开发应用软件、驱动、操作系统等。C语言也是其它众多高级语言的鼻祖语言,所以说学习C语言是进入编程世界的必修课。 hello,world #include<stdio.h> int main() { /*在双引号中间输入Hello World*/ printf("Hello World"); return 0; } 注:在最新的C标准中,main函数前的类型为 int 而不是 void c语言的具体结构 简单来说,一个C程序就是由若干 头文件 和 函数 组成。 #include <stdio.h> 就是一条预处理命令, 它的作用是通知C语言编译系统在对C程序进行正式编译之前需做一些预处理工作。 函数 就是实现代码逻辑的一个小的 单元 。 必不可少之主函数 一个C程序有且只有一个主函数,即 main 函数。 C程序就是执行主函数里的代码,也可以说这个 主函数 就是C语言中的 唯一入口 。 而 main 前面的 int 就是主函数的类型. printf() 是 格式输出 函数,这里就记住它的功能就是在 屏幕上输出指定的信息 return

YTU 2911: 我想放假

守給你的承諾、 提交于 2020-04-07 16:19:24
2911: 我想放假 时间限制: 1 Sec 内存限制: 128 MB 提交: 124 解决: 46 题目描述 小明的弟弟上小学了,每次刚入学就想知道什么时候放假,但是每学期开学的日子和每学期的有效天数都不一样,请你编程帮他计算放假日期。 本题只需要提交填空部分 #include <iostream> using namespace std; class Date { public: void input(int y,int m,int d); friend Date operator+(Date &c,int &day); void display(); private: int year; int month; int day; }; void Date::input(int y,int m,int d) { year=y; month=m; day=d; } Date operator+(Date &c,int &day) { /*********************/ 填空部分 /*********************/ } void Date::display() { cout<<year<<"/"<<month<<"/"<<day<<endl; } int main() { Date date1,date2; int y,m,d; int day; cin>>y

[YTU]_2911(我想放假)

可紊 提交于 2020-04-07 16:15:55
题目描述 小明的弟弟上小学了,每次刚入学就想知道什么时候放假,但是每学期开学的日子和每学期的有效天数都不一样,请你编程帮他计算放假日期。 本题只需要提交填空部分 #include <iostream> using namespace std; class Date { public: void input(int y,int m,int d); friend Date operator+(Date &c,int &day); void display(); private: int year; int month; int day; }; void Date::input(int y,int m,int d) { year=y; month=m; day=d; } Date operator+(Date &c,int &day) { /*********************/ 填空部分 /*********************/ } void Date::display() { cout<<year<<"/"<<month<<"/"<<day<<endl; } int main() { Date date1,date2; int y,m,d; int day; cin>>y>>m>>d; date1.input(y,m,d); cin>>day; date2=date1

fullcalendar日历控件知识点集合

时光总嘲笑我的痴心妄想 提交于 2020-04-07 15:14:19
1、基本语法: 首先,fullcalendar和JQUERY一样,以面向对象的方式来组织代码。当然,这里的面向对象仅仅是指可以把整个fullcalendar理解为一个类,这个类里包括有很多的属性、方法、委托(函数回调)作为成员变量。通过为这些成员变量赋值,即可实例化出一个符合自己需求的fullcalendar实例出来,即最终在浏览器里渲染出的日历。换句话说,我们所做的绝大多数工作就是按照fullcalendar的语法约定去配置出一个符合我们需求的fullcalendar实例。除非对于极少的特殊需求,fullcalendar向我们提供的接口不足以满足,才会去修改fullcalendar本身的js文件。 作为一种JQUERY插件,可以把fullcalendar理解为向 jquery对象集里添加了一个日历相关的对象,这个对象里相关方法、属性、的调用方式,即为fullcalendar的基本语法。整个语法分为两种: 第一种和日历本身无关,仅仅是利用fullcalendar提供的方法来进行字符串和日期间的转换,形式如下: $.fullCalendar.formatDate(); 第二种则是与和配置fullcalendar实例相关的,这最终会影响到fullcalendar在浏览器里的渲染,形式如下$(‘#someId’) .fullCalendar(content); $(‘#someId’

常用日期处理方法工具类

安稳与你 提交于 2020-04-07 12:20:11
此文章是基于   搭建Jquery+SpringMVC+Spring+Hibernate+MySQL平台 功能:日期的获取与转换   DateUtil.java package com.ims.common; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.log4j.Logger; /** * 常用日期处理方法工具类 */ public class DateUtil { private static Logger logger = Logger.getLogger(DateUtil.class); /** * 取得当前日期字符串 * @return 格式