![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
整理python上的一些技巧,以及一些使用的工具
疯狂的大山鸡
腾讯高级工程
展开
-
sklearn下绕过graph.rende查看图片
问题背景原始代码file = pd.read_csv("train.csv")feature_names = ["is_login","view_duration","last_up","ofcl_count","other_count"]x = file[feature_names]y = file[["click"]]print(y.sum())x_train0, x_test0, y_train0, y_test0 = model_selection.train_test_split(原创 2020-07-15 20:39:17 · 1651 阅读 · 3 评论 -
python list指针中被的一些小技巧
python中的list如果没用好会出现莫名奇妙被修改的情况,所以单独试了一下什么时候是深拷贝,什么时候是浅拷贝#python中的重重指针需要定义清楚#test1-----------------------print ("-"* 20)a = [0] * 20b = ab[0] = 10b[3] = 20print(a)print(b)#output:#[10, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]#[原创 2020-05-23 15:22:13 · 629 阅读 · 0 评论 -
python装饰器
装饰器 如:def hello_decorator(func): def inner1(*args, **kwargs): print("before Execution") # getting the returned value returned_value = func(*args,...原创 2019-09-10 16:37:38 · 68 阅读 · 0 评论 -
如何处理pickle.dump 出现MemoryError
问题:我使用pickle写入大量数据到imdb中,出现MemoryError问题原因:pickle无法写入超过4.0GB以上的数据,overstackflow上写了一些解决办法:如分批存储python-3-can-pickle-handle-byte-objects-larger-than-4gb这些使用都比较麻烦,我在网上查到了joblib,这个支持存大文件pypi-joblib如:使...原创 2019-09-12 11:16:28 · 4397 阅读 · 0 评论