![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据分析
LLLLLunaaaa
这个作者很懒,什么都没留下…
展开
-
分组随机采样 事例:随机抽取扑克牌
# -*- coding: utf-8 -*-"""Created on Wed Jul 4 17:14:41 2018@author: Administrator"""'''随机采样''''''21点计数H 红桃S 黑桃C 梅花D 方片'''import pandas as pdimport numpy as np# 扑克得分矩阵card_soccer = ...原创 2018-07-05 10:53:26 · 1400 阅读 · 0 评论 -
ndarray 花式索引与take函数比较
In [117]: arr4 = np.random.randn(2000,5)In [118]: inds = np.random.permutation(2000)[:500] #随机取500个indexIn [120]: %timeit arr4[inds] #使用花式索引16.8 µs ± 38.9 ns per loop (mean ± std. dev. of 7 runs,...原创 2018-07-06 14:13:41 · 329 阅读 · 0 评论 -
DataFrame多条件筛选
两种方法:1.使用query()方法,也是自己最常用的方法,数据量大的时候较快,语法较为简单;2.使用df[(df.c1==1) & (df.c2==1)]的格式,注意这里的()不能省略 ,虽然在Python条件判断中 >、<、== 的优先级要高于 and 和 or ,但是在DataFrame多条件运算中并不是这样。在这栽了两次了。...原创 2019-05-16 14:06:39 · 27175 阅读 · 0 评论 -
使用vba进行excel超链接设置(链接到当前文档某一单元格)
最前面直接说怎么做,使用 sheet.Hyperlinks.Add 添加link,目的位置 anchor ,address 如果是本文件就空着,subaddress写sheet名称和位置,TextDisplay 显示的文字。For c = 3 To .Cells(4, 3).End(xlToRight).Column city_text = .Cells(4, c).Value ...原创 2019-07-09 20:13:54 · 11928 阅读 · 0 评论