Python Forum
Getting false even when data exists
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting false even when data exists
#8
Hmm.... 'Is not working'....

Quote:"… There's no more work. We're destitute. I'm afraid I have no choice but to sell you all for scientific experiments."

–The Meaning of Life

One should be specific while looking for help. I for example don't understand the problem/question. I have no idea how data from csv is read into dataframe etc. Therefore I repeat my earlier answer with some additional lines:

>>> df = pd.DataFrame(range(1, 4))
>>> df
   0
0  1
1  2
2  3
>>> from_user = input('Enter integer: ')
Enter integer: 1
>>> from_user in df[0]
False
>>> from_user = int(input('Enter integer: '))
Enter integer: 1
>>> from_user in df[0]
True
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
Getting false even when data exists - by sriniyum - May-17-2021, 04:14 AM
RE: Getting false even when data exists - by csr - May-17-2021, 08:17 AM
RE: Getting false even when data exists - by perfringo - May-18-2021, 01:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  p]Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same rajeev1729 1 2,175 May-27-2020, 08:34 AM
Last Post: DeaD_EyE
  difference between «1 in [2] == False» and «(1 in [2]) == False» fbaldit 2 2,245 Apr-20-2020, 05:39 PM
Last Post: fbaldit
  How to insert data if not exists in mysql? farah97 0 2,833 Dec-29-2019, 08:32 AM
Last Post: farah97

Forum Jump:

User Panel Messages

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