Finology 大数据金融

通过大数据以量化金融

很少在Vmware上安装Windows系统,不过还是会遇到一些特殊情况,只能在Windows操作系统上使用某些软件。

在网上下载了一些安装光盘iso镜像,但却不能正常安装。这些iso文件,都是不能正常引动安装启动的。

后来在 https://next.itellyou.cn/ 这个网站上找到系统安装的iso镜像文件,最后成功安装。

如果设置系统激活的问题,可以从链接 https://dnmjun.lanzoui.com/b0e7m2fof 下载 HEU_KMS_Activator_v41.1.0.rar 激活工具。

在使用前需要把杀毒程序关闭,不然系统会把这个工具做为病毒而删除。

过滤复杂的Map,map的value是一个List,把这个List中不满足要求的元素过滤掉。

使用java8 stream api应该这样写:

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
public static void main(String[] args) {

Map<String, List<String>> map = new HashMap<>();
List<String> g1 = new ArrayList<>();
g1.add("M");
g1.add("F");
g1.add("M");

map.put("1", g1);
map.put("2", null);

List<String> g2 = new ArrayList<>();
g2.add("M");
g2.add("M");
g2.add("X");
g2.add("F");
g2.add("Y");

map.put("3", g2);

System.out.println(map);

Map<String, List<String>> newMap = map.entrySet().stream()
.filter(e -> CollectionUtils.isNotEmpty(e.getValue()))
.collect(Collectors.toMap(
Map.Entry::getKey,
e -> e.getValue().stream()
.filter(i -> "M".equals(i))
.collect(Collectors.toList())
));

System.out.println(newMap);
}

结果:

1
2
3
{1=[M, F, M], 2=null, 3=[M, M, X, F, Y]}

{1=[M, M], 3=[M, M]}

Windows使用sklearn,需要安装Numpy+MKL或者Numpy+Vanilla。

下载地址:

1
https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

查看安装的版本。

1
2
3
4
5
6
7
8
9
10
pip debug --verbose

...
Compatible tags: 36
cp310-cp310-win_amd64
cp310-abi3-win_amd64
cp310-none-win_amd64
cp39-abi3-win_amd64
cp38-abi3-win_amd64
cp37-abi3-win_amd64

所以下载版本numpy‑1.22.4+vanilla‑cp310‑cp310‑win_amd64.whl

安装numpy+vanilla

1
pip install "numpy-1.22.4+vanilla-cp310-cp310-win_amd64.whl" --user

最后安装scikit-learn

1
pip install scikit-learn --user
0%