Python Forum
check how many times an item appears in list
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
check how many times an item appears in list
#9
After Googling around since my last post I finally came up with this solution:
import pandas as pd
df = pd.read_csv("Lottery-numbers-only.csv")
print(pd.value_counts(df.values.flatten()))
Reply


Messages In This Thread
RE: check how many times an item appears in list - by davidm - Dec-29-2018, 07:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with to check an Input list data with a data read from an external source sacharyya 3 466 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  [solved] list content check paul18fr 6 768 Jan-04-2024, 11:32 AM
Last Post: deanhystad
  error handler appears to be turned off. How do I turn it back on? jpotter0 0 607 Nov-26-2022, 11:44 AM
Last Post: jpotter0
Question Finding string in list item jesse68 8 1,931 Jun-30-2022, 08:27 AM
Last Post: Gribouillis
  check if element is in a list in a dictionary value ambrozote 4 2,027 May-11-2022, 06:05 PM
Last Post: deanhystad
  Can I check multi condition for 1 item in a easy way? korenron 4 1,605 May-01-2022, 12:43 PM
Last Post: deanhystad
  How to check if a list is in another list finndude 4 1,872 Jan-17-2022, 05:04 PM
Last Post: bowlofred
  how to easily create a list of already existing item CompleteNewb 15 3,660 Jan-06-2022, 12:48 AM
Last Post: CompleteNewb
  Remove an item from a list contained in another item in python CompleteNewb 19 5,891 Nov-11-2021, 06:43 AM
Last Post: Gribouillis
  count item in list korenron 8 3,544 Aug-18-2021, 06:40 AM
Last Post: naughtyCat

Forum Jump:

User Panel Messages

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