Python Forum
Problem with If statement and dataframe
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with If statement and dataframe
#2
This is the printout I get when I remove the if statement. I am trying to match user input (racenumber0 with the 2nd column in the dataframe, with the code in above post.

[['AP ' 1 'D' ... 42 3.0 'EYE ON THE FINISH']
['AP ' 1 'D' ... 46 10.0 'GODSGIFT']
['AP ' 1 'D' ... 82 8.0 'LILLET']
...
['AP ' 8 'D' ... 35 6.0 'WILDCAT LITE']
['AP ' 8 'D' ... 46 15.0 'GREELEYS ICE']
['AP ' 8 'D' ... 29 12.0 'JIVE DADDY']]

This was the code I changed and it worked. I am amazed...LOl.
for i in range(0,len(xx)):
			if int(xx[hcount][1])== int(race_number):
			 
				print(xx[hcount][18])					
				hcount+=1
Reply


Messages In This Thread
RE: Problem with If statement and dataframe - by Milfredo - Sep-16-2020, 05:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  2-dataframe, datetime lookup problem Mark17 0 1,260 Jan-27-2022, 01:02 AM
Last Post: Mark17
  problem with while statement. BobSmoss 3 1,713 Jan-08-2022, 03:22 PM
Last Post: BobSmoss
  problem writing dataframe to oracle aliyesami 4 2,705 Sep-25-2021, 11:20 PM
Last Post: SamHobbs
  Problem in saving .xlsm (excel) file using pandas dataframe in python shantanu97 2 4,400 Aug-29-2021, 12:39 PM
Last Post: snippsat
  Problem in if-else statement shantanu97 2 2,466 Apr-09-2021, 06:37 AM
Last Post: shantanu97
  Dataframe problem stylingpat 3 2,870 Mar-22-2021, 10:36 AM
Last Post: stylingpat
  multiple condition if statement problem FelixReiter 3 2,649 Jan-11-2021, 08:07 AM
Last Post: FelixReiter
  optimization problem for dataframe manipulation fimmu 0 1,493 Aug-31-2020, 06:02 PM
Last Post: fimmu
  Problem with If else statement Milfredo 5 2,627 Aug-30-2020, 06:32 PM
Last Post: Milfredo
  Dataframe mean calculation problem: do we have to loop? sparkt 1 2,199 Aug-28-2020, 02:41 PM
Last Post: sparkt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020