About 50 results
Open links in new tab
  1. python - Count the number of occurrences of a character in a string ...

    How do I count the number of occurrences of a character in a string? e.g. 'a' appears in 'Mary had a little lamb' 4 times.

  2. How do I count the occurrences of a list item? - Stack Overflow

    Apr 8, 2010 · 2226 Given a single item, how do I count occurrences of it in a list, in Python? A related but different problem is counting occurrences of each different element in a collection, getting a …

  3. What is a good way to do countif in Python - Stack Overflow

    0 I know the question above is very well taken care of already, but if you are new in the python world and happen to be here because you searched for the simple keyword "Countif python" (and google …

  4. python - Get loop count inside a for-loop - Stack Overflow

    Get loop count inside a for-loop [duplicate] Asked 15 years, 9 months ago Modified 3 years, 11 months ago Viewed 655k times

  5. Find count of characters within the string in Python, using dictionary ...

    Find count of characters within the string in Python, using dictionary comprehension (not Counter) Ask Question Asked 9 years, 3 months ago Modified 2 years ago

  6. How to use count () with text file in python - Stack Overflow

    Jun 26, 2021 · How to use count () with text file in python Ask Question Asked 4 years, 9 months ago Modified 4 years, 9 months ago

  7. python - How do I get the row count of a Pandas DataFrame ... - Stack ...

    Apr 11, 2013 · 173 How do I get the row count of a Pandas DataFrame? This table summarises the different situations in which you'd want to count something in a DataFrame (or Series, for …

  8. python - When should I use list.count (0), and how do I to discount the ...

    Sep 9, 2016 · a.count(0) always returns 11, so what should I do to discount the False and return 10?

  9. python - How can I use .count function correctly? - Stack Overflow

    Nov 28, 2021 · When you call a method/function without (), python don't call the actual method but it returns a function reference in line number 8 & 9 you missed to call the method lower() but you …

  10. python - Best way to count tokens for Anthropic Claude Models using …

    Jul 19, 2024 · I'm working with Anthropic's Claude models and need to accurately count the number of tokens in my prompts and responses. I'm using the anthropic_bedrock Python client but recently …