摘要:
问题描述:list列表中有一个值小于0就返回小于,全部大于0则返回大于 import pandas as pd a=[2,-4,5,5,6,6] b = pd.DataFrame({"测试":a}) //将list转为dataframe c = b.loc[b["测试"]<0] if c.empty 阅读全文
摘要:
# 获取list中指定元素的索引 a = [2,4,3,5,6,8] c = [] for i in a: c.append(a.index(i)) print(c) 运行结果为: 获取指定元素的下标 a = [2,4,3,5,6,8] print(a.index(3)) 运行结果为: 阅读全文
摘要:
import os import re def print_all_file_path(init_file_path, keyword): for cur_dir, sub_dir, included_file in os.walk(init_file_path): if included_file 阅读全文