随笔分类 -  python

python学习
摘要:map() fution:map(func, *iterables) --> map object reduce() filter() 阅读全文
posted @ 2024-07-11 17:58 ivyJ 阅读(12) 评论(0) 推荐(0)
摘要:收藏网站 : https://python-course.eu/advanced-python/lambda-filter-reduce-map.php 阅读全文
posted @ 2023-11-24 18:05 ivyJ 阅读(18) 评论(0) 推荐(0)
摘要:在pycharm终端输入pip install pandas 可以直接安装整个txt文件的组件,pip install 文件 阅读全文
posted @ 2022-11-08 10:53 ivyJ 阅读(636) 评论(0) 推荐(0)
摘要:在请求的时候加上 verify=False 即可 if method == METHOD_GET: res = requests.get(url=url, headers=headers, verify=False)elif method == METHOD_POST: res = requests 阅读全文
posted @ 2022-06-06 15:21 ivyJ 阅读(473) 评论(0) 推荐(0)
摘要:http://c.biancheng.net/view/2256.html 阅读全文
posted @ 2022-03-01 16:44 ivyJ 阅读(15) 评论(0) 推荐(0)
摘要:https://www.linuxidc.com/Linux/2019-01/156137.htm 阅读全文
posted @ 2022-02-28 15:58 ivyJ 阅读(407) 评论(0) 推荐(0)
摘要:dfs_duplicated = dfs.duplicated(subset=sub_set, keep=False) 阅读全文
posted @ 2022-02-23 18:25 ivyJ 阅读(227) 评论(0) 推荐(0)
摘要:https://www.runoob.com/python/att-string-format.html >>>"{} {}".format("hello", "world") # 不设置指定位置,按默认顺序 'hello world' >>> "{0} {1}".format("hello", " 阅读全文
posted @ 2022-02-23 18:09 ivyJ 阅读(144) 评论(0) 推荐(0)
摘要:validations = { "not_blank": CustomElementValidation( lambda x: x is not np.nan and len(str(x).strip()) > 0, 'cannot be blank'), "not_empty_array": Cu 阅读全文
posted @ 2022-02-23 16:52 ivyJ 阅读(48) 评论(0) 推荐(0)
摘要:获取当前文件的全路径:path = os.path.abspath(__file__)获取全路径中的路径,就是不要文件名 filepath = os.path.join(os.path.split(path)[0], 'files') 阅读全文
posted @ 2022-02-21 17:09 ivyJ 阅读(317) 评论(0) 推荐(0)
摘要:df = pd.read_csv(file, sep=sep, compression=compression, dtype=object, encoding='cp1252')其中 compression='|'如果输入csv文件里一列长这样:111|2222|333444|555|666那读取的 阅读全文
posted @ 2022-02-15 10:44 ivyJ 阅读(364) 评论(0) 推荐(0)
摘要:抽取dataFrame的2列出来做dictcloud_approved_map = {item['EntityId']: item['IsCloudApproved'] for item in entity_value_map.to_dict('records')} errors_index_row 阅读全文
posted @ 2022-02-14 15:39 ivyJ 阅读(284) 评论(0) 推荐(0)
摘要:for index, row in sourceDataframe.iterrows(): if splitBy in row: split_index = row[splitBy] if split_index in remEntitys: remDFList.append(row) elif s 阅读全文
posted @ 2022-02-14 14:57 ivyJ 阅读(247) 评论(0) 推荐(0)
摘要:with open(output, 'w') as f: json.dump(exit_message, f)其中output 是json文件的具体路径把内容写入json文件里 with open("../config/record.json",'r') as load_f: load_dict = 阅读全文
posted @ 2022-02-14 14:36 ivyJ 阅读(1386) 评论(0) 推荐(0)
摘要:for df in dfs: print(df.result()) 阅读全文
posted @ 2022-02-09 18:23 ivyJ 阅读(23) 评论(0) 推荐(0)
摘要:result = mergeresult[mergeresult.columns] 阅读全文
posted @ 2022-01-27 18:33 ivyJ 阅读(29) 评论(0) 推荐(0)
摘要:http://t.zoukankan.com/traditional-p-13090698.html 阅读全文
posted @ 2022-01-11 18:31 ivyJ 阅读(12) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/erinapple/article/details/80838359 三目运算符: tmp = data.assign(**{'ws^2': data.apply(lambda row: sum(row['ws'] * np.where( row['fac 阅读全文
posted @ 2022-01-10 16:23 ivyJ 阅读(76) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/qq_27825451/article/details/82698929 阅读全文
posted @ 2022-01-10 15:50 ivyJ 阅读(17) 评论(0) 推荐(0)
摘要:用numpy.float64,在做groupby的时候,其他str字段不会连到一起,组合成一大串 agg = sensis.groupby(by=['bu'], as_index=False).sum()用float来groupby 的话,其他列的字段多个合并成一连串 阅读全文
posted @ 2022-01-06 11:35 ivyJ 阅读(626) 评论(0) 推荐(0)