python-3.x - 获取矩阵python中每列大于阈值用户的元素的行名
问题描述
我是python新手,请你帮帮我。
我已读入一个 xlsx 文件并向其中添加了标题
header = ['S.No', 'Name', 'Science', 'english','History','art','Maths']
df = pd.read_excel('matrix.xlsx', header=None, names=header)
我想提取达到85及以上的学生,我希望它看起来像这样:
roy[history,art,maths]
john[art,maths]
dave[art,math]
这是excel文件看起来如何帮助的代码
p = pd.DataFrame.from_items([('Roy', [80, 75, 85, 90, 95]), ('John', [75, 80, 75, 85, 100]), ('Dave', [80, 80, 80, 90, 95, ])],
orient='index', columns=['Science', 'English', 'History', 'Arts', 'Maths'])
谢谢
解决方案
推荐阅读
- android - NavController 混淆后不重命名
- oop - 请求数据时立即或延迟修复不一致的状态
- import - 从 PCE-VDL 数据记录器设备导入 OCTAVE 数据并将小数彗差转换为小数点
- python - 使用shutil将空文件放置在多个位置
- scala - 如何更改默认的 sbt 临时目录?
- azure-active-directory - 如何从 Azure AD B2C 用户配置文件编辑过程中获取对象 ID 值
- amazon-kinesis - ValidationException - 成员的长度必须小于或等于 500
- r - 正确使用 PROTECT 和 UNPROTECT 在 C 函数之间传递 SEXP 对象
- tensorflow - 无法使用 pip 安装张量流?
- python - python的不确定性和相关性