question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `unique_counts()`?

See original GitHub issue

This is a follow-up of #275. I’ve found numpy.unique(x, return_counts=True) quite useful. It allows us to build a histogram for the input array x. I’d suggest us to add the following function:

def unique_counts(x, /):
   """
   return a tuple of two arrays (unique values and counts)
   """

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
rgommerscommented, Nov 4, 2021

Seems very reasonable, and if we add it we should indeed add it to the v2021 milestone. Better to do all four new unique_* functions in one go.

0reactions
kgrytecommented, Nov 4, 2021

Thanks @leofang!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Count unique values among duplicates - Microsoft Support
Add the total by using the SUM function. Count the number of unique values by using the FREQUENCY function. The FREQUENCY function ignores...
Read more >
Excel Pivot Tables Count Unique Items - Contextures
How to count unique items (count distinct) in Excel pivot table. Three methods, for different versions of Excel. Get free workbook to follow ......
Read more >
How to Count Unique and Distinct Values in Excel | Excelchat
Count Distinct Values in Excel · Select cells A1:B11. Go to Insert > Pivot Table. · In the dialog box that pops up,...
Read more >
Count unique and distinct values in Excel with formula or pivot ...
See how to count unique values in Excel with a formula and get an automatic count of all different values in a pivot...
Read more >
SQL COUNT() with DISTINCT - w3resource
SQL COUNT() function with DISTINCT clause eliminates the repetitive appearance of the same data. The DISTINCT can come only once in a given ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found