Travis build: 320
This commit is contained in:
@ -482,14 +482,14 @@
|
|||||||
"type": "snippetListing",
|
"type": "snippetListing",
|
||||||
"title": "filter_non_unique",
|
"title": "filter_non_unique",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"text": "Filters out the non-unique values in a list.\n\nUse a `Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the unique values.\n\n",
|
"text": "Filters out the non-unique values in a list.\n\nUse a `collections.Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the unique values.\n\n",
|
||||||
"tags": [
|
"tags": [
|
||||||
"list",
|
"list",
|
||||||
"beginner"
|
"beginner"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "cc048906b1a368428244af8202aeb3a60b1b7b7bf52ad744e92d3e21f6be95f2"
|
"hash": "fc7c8b72dd9c4f53cd5d8ffe4c2befd0f1a6807caf58c0a2ddced195c6fa6c4f"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -497,14 +497,30 @@
|
|||||||
"type": "snippetListing",
|
"type": "snippetListing",
|
||||||
"title": "filter_unique",
|
"title": "filter_unique",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"text": "Filters out the unique values in a list.\n\nUse a `Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the non-unique values.\n\n",
|
"text": "Filters out the unique values in a list.\n\nUse a `collections.Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the non-unique values.\n\n",
|
||||||
"tags": [
|
"tags": [
|
||||||
"list",
|
"list",
|
||||||
"beginner"
|
"beginner"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "f3e5cada914ae863ca9cf8fd8780b1634ea526d78f1f542c5c7577f6dd685cfc"
|
"hash": "d5680d2e4f63df60dbf4cef97de86a6e0aee70284aa2729ae69427e8231521e0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "find_parity_outliers",
|
||||||
|
"type": "snippetListing",
|
||||||
|
"title": "find_parity_outliers",
|
||||||
|
"attributes": {
|
||||||
|
"text": "Given a list, returns the items that are parity outliers.\n\nUse `collections.Counter` with a list comprehension to count even and odd values in the list, use `collections.Counter.most_common()` to get the most common parity.\nUse a list comprehension to find all elements that do not match the most common parity.\n\n",
|
||||||
|
"tags": [
|
||||||
|
"list",
|
||||||
|
"math",
|
||||||
|
"intermediate"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"hash": "87bee9709b95c43c36718bc31f6f3c381c05159b7d33e0016ede29d4168d3843"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -762,7 +762,7 @@
|
|||||||
"type": "snippet",
|
"type": "snippet",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"fileName": "filter_non_unique.md",
|
"fileName": "filter_non_unique.md",
|
||||||
"text": "Filters out the non-unique values in a list.\n\nUse a `Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the unique values.\n\n",
|
"text": "Filters out the non-unique values in a list.\n\nUse a `collections.Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the unique values.\n\n",
|
||||||
"codeBlocks": {
|
"codeBlocks": {
|
||||||
"code": "from collections import Counter\n\ndef filter_non_unique(lst):\n return [item for item, count in counter = Counter(lst).items() if count == 1]",
|
"code": "from collections import Counter\n\ndef filter_non_unique(lst):\n return [item for item, count in counter = Counter(lst).items() if count == 1]",
|
||||||
"example": "filter_non_unique([1, 2, 2, 3, 4, 4, 5]) # [1, 3, 5]"
|
"example": "filter_non_unique([1, 2, 2, 3, 4, 4, 5]) # [1, 3, 5]"
|
||||||
@ -773,11 +773,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "cc048906b1a368428244af8202aeb3a60b1b7b7bf52ad744e92d3e21f6be95f2",
|
"hash": "fc7c8b72dd9c4f53cd5d8ffe4c2befd0f1a6807caf58c0a2ddced195c6fa6c4f",
|
||||||
"firstSeen": "1566296031",
|
"firstSeen": "1566296031",
|
||||||
"lastUpdated": "1578227946",
|
"lastUpdated": "1578502657",
|
||||||
"updateCount": 4,
|
"updateCount": 5,
|
||||||
"authorCount": 3
|
"authorCount": 4
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -786,7 +786,7 @@
|
|||||||
"type": "snippet",
|
"type": "snippet",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"fileName": "filter_unique.md",
|
"fileName": "filter_unique.md",
|
||||||
"text": "Filters out the unique values in a list.\n\nUse a `Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the non-unique values.\n\n",
|
"text": "Filters out the unique values in a list.\n\nUse a `collections.Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the non-unique values.\n\n",
|
||||||
"codeBlocks": {
|
"codeBlocks": {
|
||||||
"code": "from collections import Counter\n\ndef filter_unique(lst):\n return [item for item, count in Counter(lst).items() if count > 1]",
|
"code": "from collections import Counter\n\ndef filter_unique(lst):\n return [item for item, count in Counter(lst).items() if count > 1]",
|
||||||
"example": "filter_unique([1, 2, 2, 3, 4, 4, 5]) # [2, 4]"
|
"example": "filter_unique([1, 2, 2, 3, 4, 4, 5]) # [2, 4]"
|
||||||
@ -797,11 +797,36 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "f3e5cada914ae863ca9cf8fd8780b1634ea526d78f1f542c5c7577f6dd685cfc",
|
"hash": "d5680d2e4f63df60dbf4cef97de86a6e0aee70284aa2729ae69427e8231521e0",
|
||||||
"firstSeen": "1570035984",
|
"firstSeen": "1570035984",
|
||||||
"lastUpdated": "1578227961",
|
"lastUpdated": "1578502673",
|
||||||
"updateCount": 7,
|
"updateCount": 8,
|
||||||
"authorCount": 4
|
"authorCount": 5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "find_parity_outliers",
|
||||||
|
"title": "find_parity_outliers",
|
||||||
|
"type": "snippet",
|
||||||
|
"attributes": {
|
||||||
|
"fileName": "find_parity_outliers.md",
|
||||||
|
"text": "Given a list, returns the items that are parity outliers.\n\nUse `collections.Counter` with a list comprehension to count even and odd values in the list, use `collections.Counter.most_common()` to get the most common parity.\nUse a list comprehension to find all elements that do not match the most common parity.\n\n",
|
||||||
|
"codeBlocks": {
|
||||||
|
"code": "from collections import Counter\n\ndef find_parity_outliers(nums):\n return [\n x for x in nums\n if x % 2 != Counter([n % 2 for n in nums]).most_common()[0][0]\n ]",
|
||||||
|
"example": "find_parity_outliers([1, 2, 3, 4, 6]) # [1, 3]"
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"list",
|
||||||
|
"math",
|
||||||
|
"intermediate"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"hash": "87bee9709b95c43c36718bc31f6f3c381c05159b7d33e0016ede29d4168d3843",
|
||||||
|
"firstSeen": "1578502475",
|
||||||
|
"lastUpdated": "1578502475",
|
||||||
|
"updateCount": 2,
|
||||||
|
"authorCount": 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user