简体   繁体   English

如何使用 Python 检测数据集中的一行?

[英]How to detect one line in dataset with Python?

hi iam working on project for detecting heart failure by using supervised ML algorithms.嗨,我正在研究使用监督机器学习算法检测心力衰竭的项目。 know i have complete my work and got an accuracy but i need to add something else to my work which is how to detect only one line in the dataset to see if the patient will die or not?知道我已经完成了我的工作并获得了准确性,但我需要在我的工作中添加其他内容,即如何仅检测数据集中的一行以查看患者是否会死亡? so when i enter the line number will detect the final result.所以当我输入行号时会检测到最终结果。 Iam trying this code but its not working我正在尝试此代码,但它不起作用

  Rf0 = input('Enter No. of Patient?')
  Rf=int(Rf0)
  face = N1.iloc[Rf]
  poly_pred1 = knn2.predict(face)
  print('The person is {}'.format(poly_pred2))

also i have tried this one我也试过这个

  Rf = input('Enter No. of Patient')
  poly_pred2 = regressor2.predict(N11[Rf-1:Rf,:])
  print('The person is {}'.format(poly_pred2))

please any one can help?请问有人可以帮忙吗?

Rf = input('Enter No. of Patient')   
poly_pred2 = regressor2.predict(N11[Rf-1:Rf,:])   
print('The person is {}'.format(poly_pred2))  

can you please give the type of你能告诉我的类型吗

poly_pred2 variable. poly_pred2 变量。

Ex: print(type(poly_pred2))例如:打印(类型(poly_pred2))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM