- 博客(110)
- 资源 (14)
- 收藏
- 关注
原创 python下DataFrame, Series, ndarray, list, dict, tuple的相互转换
import numpy as np import pandas as pdSeries <--> DataFrame *dataframe* = DataFrame({"XXX&a
2017-11-13 09:55:38
37232
1
原创 【ksh shell】利用脚本获取时间,ksh获取昨天日期、当月1号、当月最后一天、上月1号、上月最后一天
下面是取昨天的日期(伦敦时间) startdate=TZ=aaa24 date +%Y%m%d 下面是取昨天的日期(北京时间) startdate=TZ=aaa16 date +%Y%m%d\ %H:%M:%S startdate=TZ=aaa16 date +%Y%m%d 利用脚本获取时间 export startdate=sh thismonth.sh export starttime=sh thismonth.sh" 00:00:00" export startdate=sh lastmonth.sh
2021-11-25 17:52:34
1792
原创 【python】【leetcode】4. 寻找两个有序数组的中位数 4. Median of Two Sorted Arrays
给定两个大小为 m 和 n 的有序数组 nums1 和 nums2。 请你找出这两个有序数组的中位数,并且要求算法的时间复杂度为 O(log(m + n))。 你可以假设 nums1 和 nums2 不会同时为空。 #这里的思路是:每次比较两个数组的中位数, #中位数大的数组删除右半部分,中位数小的数组删除左半部分, #两个数组删除的长度相同,删除的长度为长度短的数组长度的一半; #此操作不会改变...
2019-04-09 15:59:03
332
原创 Pandas中拼接两个IntervalIndex
这里的思路是,首先把两个IntervalIndex转换成list,然后用pd.IntervalIndex(list)生成拼接IntervalIndex #Pandas中拼接两个IntervalIndex ii1 = pd.interval_range(start=min2, end=max2,freq=5) ii2 = pd.IntervalIndex.from_tuples([tuple(i) ...
2019-03-01 20:48:50
1694
原创 【PAT甲级】1080 Graduate Admission (30 分)
#include <iostream> #include <stdio.h> #include <vector> #include <algorithm> #include <stdlib.h> using namespace std; typedef struct Stu {
2019-01-16 11:13:52
318
原创 Python 时间格式转换
当前日期时间 from datetime import datetime import time dt=datetime.now()# 时间日期 ts=time.time()# 时间戳 st='2018-12-18 11:12:13'# 字符串 默认: 数值时间戳:时间戳是数值格式 时间字符串:字符串符合时间规范写法 时间日期:Python下的datetime.datetime类...
2018-12-18 11:30:54
2210
转载 简易解说拉格朗日对偶(Lagrange duality)
简易解说拉格朗日对偶(Lagrange duality) 引言:尝试用最简单易懂的描述解释清楚机器学习中会用到的拉格朗日对偶性知识,非科班出身,如有数学专业博友,望多提意见! 1.原始问题 假设是定义在上的连续可微函数(为什么要求连续可微呢,后面再说,这里不用多想),考虑约束最优化问题: 称为约束最优化问题的原始问题。 现在如果不考虑约束条件,原始问题就是: 因...
2018-12-12 10:33:25
339
原创 皮尔森Pearson相关系数 VS 斯皮尔曼Spearman相关系数
给定两个连续变量x和y,皮尔森相关系数被定义为:————————————————————————————————————————————————由于原则上无法准确定义顺序变量各类别之间的距离,导致计算出来的相关系数不是变量间的关联性的真实表示。因此,建议对顺序变量使用斯皮尔曼相关系数。斯皮尔曼相关系数的计算采用的是取值的等级,而不是取值本身。例如,给定三个值:33,21,44,它们的等级就分别是2...
2018-04-17 11:49:44
58317
1
原创 Win10中SAS软件安装失败的一些解决方法
1. 系统用户名改成英文名2. 杀毒防火都关3. 安装之前,把原来的SAS卸载干净(文件夹都删除,必要时用cclearner清除注册表)4. 如果sid过期,则需要更改系统时间(注意每次打开软件的时候都需要更改系统时间)...
2018-04-12 17:01:16
8463
1
原创 医学模型中的统计概念——笔记少许
supervised principal component (SPC) analysis We propose “supervised principal component analysis (supervised PCA)”, a generalization of PCA that is uniquely effective for regression and
2018-03-23 00:05:25
2802
1
原创 Pycharm下载三方工具包
PyCharm Community Edition-->Preference 在当前Project:XX下选择ProjectInterpreter,然后点左下角「+」,输入包名,查找后选择左下角「InstallPackage」 d
2017-12-14 10:30:02
4872
2
转载 正则表达式文档
表达式全集 字符 描述 \ 将下一个字符标记为一个特殊字符、或一个原义字符、或一个向后引用、或一个八进制转义符。例如,“n”匹配字符“n”。“\n”匹配一个换行符。串行“\\”匹配“\”而“\(”则匹配“(”。 ^ 匹配输入字符串的开始位置。如果设置了RegExp对象的Multiline属性,^也匹配“\n”或“\r”之后的位置。
2017-12-12 21:31:53
599
原创 Python文本处理笔记(readlines去掉回车+string list to int list)
readlines()去掉回车: f.read().splitlines()string list –> int list results = [int(i) for i in results]vim查找空行: /^s*$
2017-12-11 21:56:23
3294
原创 Stanford NLP lables 词性标记含义
CC Coordinating conjunction CD Cardinal number DT Determiner EX Existential there FW Foreign word IN Preposition or subordinating conjunction JJ Adjective JJR Adjective, comparative JJS Adject
2017-11-26 21:48:13
1586
转载 git常用命令备忘
http://robbinfan.com/blog/34/git-common-command Git配置 git config --global user.name "robbin" git config --global user.email "fankai@gmail.com" git config --global color.ui true git config --glo
2017-11-16 11:30:53
325
原创 Mac上使用Semafor语义解析器——我遇到的问题及解决方法
官方网址: https://github.com/Noahs-ARK/semafor要点: (1)正确配置JAVA_HOME(2)关于编译问题,官网上指导如下: Compilation Compilation is easiest using Maven version >= 3.0 (http://maven.apache.org/).mvn package由于这里要求maven版本3.0
2017-10-26 15:14:20
654
转载 Java中JDK为何要配Path和ClassPath?
1.首先说一下JDK运行原理。 一个x.java文件要想被运行,首先要被javac.exe编译生成字节码文件 ----> x.class文件 然后JDK中的Java命令运行此x.class文件,java代码就可以被执行。 2.为什么要配置Path? 平时使用cmd运行JDK中的命令时,只能在JDK的安装目录下运行如 javac和java命令。但是一旦脱离了当前安装目录,对于编写的java文
2017-10-26 12:53:04
1657
转载 Python语言下的机器学习库
Python语言下的机器学习库 本文由 伯乐在线 - douxingxiang 翻译,周进林 校稿。未经许可,禁止转载! 英文出处:www.cbinsights.com。欢迎加入翻译组。 Python是最好的编程语言之一,在科学计算中用途广泛:计算机视觉、人工智能、数学、天文等。它同样适用于机器学习也是意料之中的事。 当然,它也有些缺点;其中一个是工具和库过于分散。如果
2017-10-18 20:45:26
481
原创 Mac-eclipse中搭建python-opencv环境——我所遇到的问题及解决方法
如何安装python-opencv在这篇文章中有详述: http://blog.csdn.net/lambsnow/article/details/78033432(在Mac上安装python-opencv) 现在假定已安装好python-opencv,并可以在命令行运行import cv2 接下来配置eclipse下的环境: 新建一个python工程,并输入如下代码:
2017-09-21 15:22:02
1124
原创 在Mac上安装python-opencv
参考博文: http://blog.csdn.net/ramonyang/article/details/37603933 http://blog.csdn.net/nillei/article/details/62421724 1. 首先下载opencv for mac安装源文件,解压缩 2. 安装cmake程序。下载cmake的dmg文件安装即可。 3.
2017-09-19 19:03:42
2644
1
转载 【机试题】迷宫寻路--拼多多2018校招内推编程题
链接:https://www.nowcoder.com/questionTerminal/e3fc4f8094964a589735d640424b6a47 来源:牛客网 作者:超蓝の悟空时间限制:1秒 空间限制:131072K假设一个探险家被困在了地底的迷宫之中,要从当前位置开始找到一条通往迷宫出口的路径。迷宫可以用一个二维矩阵组成,有的部分是墙,有的部分是路。迷宫之中有的路上还有门,每扇门都
2017-08-25 15:33:43
2793
原创 【机试题】六一儿童节--拼多多2018校招内推编程题
[编程题] 六一儿童节 时间限制:1秒 空间限制:32768K 六一儿童节,老师带了很多好吃的巧克力到幼儿园。每块巧克力j的重量为w[j],对于每个小朋友i,当他分到的巧克力大小达到h[i] (即w[j]>=h[i]),他才会上去表演节目。老师的目标是将巧克力分发给孩子们,使得最多的小孩上台表演。可以保证每个w[i]> 0且不能将多块巧克力分给一个孩子或将一块分给多个孩子。 输入描述:
2017-08-13 23:07:24
1672
原创 【机试题】大整数相乘--拼多多2018校招内推编程题
//注意char和int之前的转换 #include <iostream> #include <stdio.h> #include <string> #include <string.h> using namespace std; int main() { char a[9999], b[9999]; int c[9999]; fill(c, c + 9999, 0);
2017-08-13 22:17:30
750
原创 【机试题】3个数的最大乘积--拼多多2018校招内推编程题
[编程题] 最大乘积 时间限制:1秒 空间限制:32768K 给定一个无序数组,包含正数、负数和0,要求从中找出3个数的乘积,使得乘积最大,要求时间复杂度:O(n),空间复杂度:O(1) 输入描述: 无序整数数组A[n]输出描述: 满足条件的最大乘积输入例子1: 4 3 4 1 2输出例子1: 24//思路是在输入过程中保存【最大的三个数】&【最小的二个数】 //判断下一个数是否
2017-08-13 13:46:49
4140
5
转载 STL的lower_bound和upper_bound源码
//这个算法中,first是最终要返回的位置 int lower_bound(int *array, int size, int key) { int first = 0, middle; int half, len; len = size; while(len > 0) { half = len >> 1; middle = first
2017-08-10 11:28:25
808
原创 【PAT甲级】1079. Total Sales of Supply Chain (25)
#include <stdio.h> #include <iostream> #include <vector> #include <stack> #include <math.h>using namespace std;int main() { int n; double p, r; cin >> n >> p >> r; vector<int> *v = new
2017-07-29 16:41:53
416
原创 【PAT甲级】1078. Hashing (25)
二次探测法:探查序列为d=h(key),d+1^2,d+2^2,……#include <iostream> using namespace std; bool isPrime(int a); int findPos(int *a, int s, int msize);int main() { int msize, n; cin >> msize >> n; if (!isPr
2017-07-07 09:44:14
355
原创 【PAT甲级】1077. Kuchiguse (20)
注意: 1. getline()可能get到空行,需要过滤一下 2. 头文件algorithm中的reverse可以对字符串进行反转#include <iostream> #include <string> #include <vector> #include <algorithm>using namespace std; int findMinLength(vector<string> v);in
2017-07-06 16:13:10
245
原创 【PAT甲级】1076. Forwards on Weibo (30)
#include <iostream> #include <vector> #include <stack> #include <stdlib.h> #include <string.h> using namespace std;int main() { int n, l; cin >> n >> l; vector<int> *v = new vector<int>[n +
2017-07-05 17:22:43
253
原创 【PAT甲级】1075. PAT Judge (25)
注意:如果一名同学提交代码未通过编译,则他这道题成绩打印为0; 如果他对某一题从未提交过代码,则他这道题成绩打印为‘-’; 如果他提交的所有代码均未通过编译,则不打印他的成绩单。#include <stdio.h> #include <vector> #include <stdlib.h> #include <string.h> #include <algorithm> using namespac
2017-07-04 16:18:41
252
原创 【PAT甲级】1074. Reversing Linked List (25)
#include <stdio.h> #include <iostream> using namespace std;struct Node { int e; int next; }; Node list[100000]; void swap(int *a, int i, int j);int main() { int start, len, k; cin >> sta
2017-06-22 16:53:02
341
原创 【PAT甲级】1073. Scientific Notation (20)
#include <stdio.h> #include <iostream> #include <stdlib.h> #include <string> using namespace std;int main() { string input; getline(cin, input); int t = input.find('E', 0); string numbe
2017-06-21 21:08:46
275
原创 【PAT甲级】1072. Gas Station (30)
此题用Dijkstra计算;如果用Floyd最后一个测试用例会超时#include <stdio.h> #include <iostream> #include <vector> #include <string> #include <algorithm> #include <stdlib.h> #define INF 1<<29 using namespace std; struct T {
2017-06-21 17:30:28
583
原创 【PAT甲级】1071. Speech Patterns (25)
#include <iostream> #include <string> #include <map> #include <cctype> using namespace std;int main() { string s, tmp; map<string, int> m; getline(cin, s); for (int i = 0; i < s.length(
2017-06-21 17:26:49
329
原创 【PAT甲级】1070. Mooncake (25)
#include <stdio.h> #include <algorithm> using namespace std; typedef struct Cake { double ton; double price; double up; } Cake; bool cmp(Cake a, Cake b) { return a.up > b.up; }int main(
2017-06-21 17:25:13
283
原创 【PAT甲级】1069. The Black Hole of Numbers (20)
#include <stdio.h> #include <algorithm> #include <math.h> using namespace std; bool cmp(int a, int b) { return a > b; } int getNum(int *a); int main(int argc, char *argv[]) { int in; int a[
2017-06-21 17:23:28
253
原创 【PAT甲级】1068. Find More Coins (30)
#include <stdio.h> #include <algorithm> #include <vector> using namespace std; #define MAX_N 10000 #define MAX_M 100 bool cmp(int a, int b) { return a > b; }int main(int argc, char *argv[]) { i
2017-06-21 17:18:36
296
原创 【PAT甲级】1067. Sort with Swap(0,*) (25)
注:第二个for循环中,始终从0开始查找会使测试用例1、2超时,因此作一个小优化,即记住上次开始查找的位置start,下次从此处开始进行查找。#include <stdio.h> void swap(int *a, int *pos, int x, int y) { int tmp = a[x]; a[x] = a[y]; pos[a[y]] = x; a[y] =
2016-11-14 15:09:34
442
原创 【PAT甲级】1066. Root of AVL Tree (25)
#include <stdio.h> #include <math.h> #include <stdlib.h>typedef struct Node { Node *left; Node *right; int key; } Node;void insert(Node* &r, int k); int height(Node *r); int max(int a, int
2016-11-11 17:29:53
416
Introduction to Scorecard for FICO Model Builder 英文
2018-04-16
Scikit-learn Cookbook.pdf 英文版 + 中文版
2018-05-14
【pdf kindle打包】Naked Statistics Stripping the Dread From the Data
2018-12-05
Pattern Recognition And Machine Learning英文+中文+完整答案 模式识别与机器学习
2018-05-07
动态规划:从新手到专家 Hawstein
2016-10-26
The Little SAS Book for Enterprise Guide 4.2 英文版
2018-04-11
Pattern Recognition and Machine Learning 模式识别与机器学习 中文版
2018-05-07
ESL英文版+中文版+答案 The Elements of Statistical Learning 统计学习基础
2018-05-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅