Dataset Viewer
Auto-converted to Parquet Duplicate
body
stringlengths
603
27.3k
question_id
stringlengths
4
6
label
stringclasses
5 values
meta_data
dict
answer
dict
<p>I just started playing with Python and was hoping to get some feedback regarding the quality of the following snippet. Does this look like proper Python? What would you change? Is this small script well structured?</p> <p>Quick description of functional goal: reorder list such that each element is followed by the v...
5548
GOOD_ANSWER
{ "AcceptedAnswerId": "5554", "CommentCount": "0", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2011-10-18T05:02:50.907", "Id": "5548", "Score": "10", "Tags": [ "python" ], "Title": "Reorder list such that each element is followed by the value closest to it" }
{ "body": "<pre><code>while len(fcfs_working) &gt; 0:\n</code></pre>\n\n<p>is the same as</p>\n\n<pre><code>while fcfs_working:\n</code></pre>\n", "comments": [ { "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2012-11-20T14:58:03.417", "Id": "30048", "Score": "0", "body": "@Gar...
<p>I just started playing with Python and was hoping to get some feedback regarding the quality of the following snippet. Does this look like proper Python? What would you change? Is this small script well structured?</p> <p>Quick description of functional goal: reorder list such that each element is followed by the v...
5548
WEIRD
{ "AcceptedAnswerId": "5554", "CommentCount": "0", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2011-10-18T05:02:50.907", "Id": "5548", "Score": "10", "Tags": [ "python" ], "Title": "Reorder list such that each element is followed by the value closest to it" }
{ "body": "<p>I'm not familiar with the shortest-seek-first algorithm. However, it may work to calculate the distances of each number in the list from the current position, sort that and then output the results. Consequently:</p>\n\n<pre><code>working = [15, 24, 12, 13, 48, 56, 2]\nposition = 20\ndistances = [(abs(po...
<p>I just started playing with Python and was hoping to get some feedback regarding the quality of the following snippet. Does this look like proper Python? What would you change? Is this small script well structured?</p> <p>Quick description of functional goal: reorder list such that each element is followed by the v...
5548
GOOD_ANSWER
{ "AcceptedAnswerId": "5554", "CommentCount": "0", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2011-10-18T05:02:50.907", "Id": "5548", "Score": "10", "Tags": [ "python" ], "Title": "Reorder list such that each element is followed by the value closest to it" }
{ "body": "<p>From the algorithmic perspective, I'd like to suggest another solution (regardless to Python as a language).</p>\n\n<p>Here goes:</p>\n\n<p>let's assume that all items in the given array are different. the other case has a similar solution, so let's focus on the algorithm itself.</p>\n\n<ol>\n<li>Find t...
<p>I'm working on a feature for the <a href="http://github.com/jessemiller/HamlPy" rel="nofollow">HamlPy (Haml for Django)</a> project:</p> <h2>About Haml</h2> <p>For those who don't know, Haml is an indentation-based markup language which compiles to HTML:</p> <pre><code>%ul#atheletes - for athelete in athelete...
15395
GOOD_ANSWER
{ "AcceptedAnswerId": "15450", "CommentCount": "0", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2012-09-06T22:45:31.233", "Id": "15395", "Score": "5", "Tags": [ "python", "parsing", "django", "haml" ], "Title": "Python parser for attributes in a HAML template" }
{ "body": "<h3>1. Answers to your questions</h3>\n<ol>\n<li><p>If the goal of the project is to be able to include Haml in attribute values, then you've got no choice but to switch to your own parser. I haven't looked at the set of test cases, but it does seem plausible that you are going to introduce incompatibiliti...
<p>I'm trying to learn how to write functional code with Python and have found some tutorials online. Please note that I know Python is not a promoter for functional programming. I just want to try it out. <a href="http://anandology.com/python-practice-book/functional-programming.html">One tutorial</a> in particular gi...
21033
null
{ "AcceptedAnswerId": "21035", "CommentCount": "0", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2013-01-29T16:08:41.920", "Id": "21033", "Score": "14", "Tags": [ "python", "functional-programming" ], "Title": "Flatten dictionary in Python (functional style)" }
{ "body": "<p>Your solution really isn't at all functional. You should return a flattened dict and then merge that into your current dictionary. You should also not modify the dictionary, instead create it with all the values it should have. Here is my approach:</p>\n\n<pre><code>def flatten_dict(d):\n def items()...
<p>I'm trying to learn how to write functional code with Python and have found some tutorials online. Please note that I know Python is not a promoter for functional programming. I just want to try it out. <a href="http://anandology.com/python-practice-book/functional-programming.html">One tutorial</a> in particular gi...
21033
GOOD_ANSWER
{ "AcceptedAnswerId": "21035", "CommentCount": "0", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2013-01-29T16:08:41.920", "Id": "21033", "Score": "14", "Tags": [ "python", "functional-programming" ], "Title": "Flatten dictionary in Python (functional style)" }
{ "body": "<p>Beside avoiding mutations, functional mindset demands to split into elementary functions, along two axes:</p>\n\n<ol>\n<li>Decouple responsibilities.</li>\n<li>By case analysis (eg pattern matching). Here scalar vs dict. </li>\n</ol>\n\n<p>Regarding 1, nested dict traversal has nothing to do with the re...
<p>I have a grid as </p> <pre><code>&gt;&gt;&gt; data = np.zeros((3, 5)) &gt;&gt;&gt; data array([[ 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0.]] </code></pre> <p>i wrote a function in order to get the ID of each tile.</p> <pre><code>array([[(0,0), (0,1), (0,2), (0,3), ...
22968
GOOD_ANSWER
{ "AcceptedAnswerId": "22973", "CommentCount": "1", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2013-02-21T16:33:57.390", "Id": "22968", "Score": "1", "Tags": [ "python", "optimization", "performance" ], "Title": "python Improve a function in a elegant way" }
{ "body": "<p>Numpy has built in functions for most simple tasks like this one. In your case, <a href=\"http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndindex.html\" rel=\"nofollow\"><code>numpy.ndindex</code></a> should do the trick:</p>\n\n<pre><code>&gt;&gt;&gt; import numpy as np\n&gt;&gt;&gt; [j for j...
<p>I have been working on a project where I needed to analyze multiple, large datasets contained inside many CSV files at the same time. I am not a programmer but an engineer, so I did a lot of searching and reading. Python's stock CSV module provides the basic functionality, but I had a lot of trouble getting the meth...
24836
GOOD_ANSWER
{ "AcceptedAnswerId": null, "CommentCount": "4", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2013-04-07T20:15:44.593", "Id": "24836", "Score": "5", "Tags": [ "python", "parsing", "csv", "numpy", "portability" ], "Title": "Portable Python CSV class" }
{ "body": "<p>Some observations:</p>\n\n<ul>\n<li>You expect <code>read</code> to be called exactly once (otherwise it reads the same files again, right?). You might as well call it from <code>__init__</code> directly. Alternatively, <code>read</code> could take <code>location</code> as parameter, so one could read m...
<p>I have been working on a project where I needed to analyze multiple, large datasets contained inside many CSV files at the same time. I am not a programmer but an engineer, so I did a lot of searching and reading. Python's stock CSV module provides the basic functionality, but I had a lot of trouble getting the meth...
24836
GOOD_ANSWER
{ "AcceptedAnswerId": null, "CommentCount": "4", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2013-04-07T20:15:44.593", "Id": "24836", "Score": "5", "Tags": [ "python", "parsing", "csv", "numpy", "portability" ], "Title": "Portable Python CSV class" }
{ "body": "<p><a href=\"https://codereview.stackexchange.com/a/24852/11728\">Janne's points</a> are good. In addition:</p>\n\n<ol>\n<li><p>When I try running this code, it fails:</p>\n\n<pre><code>&gt;&gt;&gt; e = EasyCSV('.')\nTraceback (most recent call last):\n File \"&lt;stdin&gt;\", line 1, in &lt;module&gt;\n ...
<p>As a follow-up to my previous <a href="https://codereview.stackexchange.com/questions/26071/computation-of-prefix-free-codes-with-many-repeated-weight-values-in-reduced-spa">question</a> about prefix free code, I learned about the module unittest and wrote the following set of functions, to be used in order to semi-...
27821
GOOD_ANSWER
{ "AcceptedAnswerId": null, "CommentCount": "0", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2013-06-26T21:45:48.927", "Id": "27821", "Score": "1", "Tags": [ "python" ], "Title": "Code to check for the optimality of a minimal prefix free code" }
{ "body": "<p>Most Python I read these days prefers list comprehensions over <code>map</code> or <code>filter</code>. For example, I'd change</p>\n\n<pre><code>terms = map( lambda x: x[1] * math.pow(2,-x[0]), L)\nreturn sum(terms)\n</code></pre>\n\n<p>to</p>\n\n<pre><code>return sum(x[1] * math.pow(2, -x[0]) for x in...
<p>I have a file with just 3500 lines like these:</p> <pre><code>filecontent= "13P397;Fotostuff;t;IBM;IBM lalala 123|IBM lalala 1234;28.000 things;;IBMlalala123|IBMlalala1234" </code></pre> <p>Then I want to grab every line from the <code>filecontent</code> that matches a certain string (with python 2.7):</p> <pre><...
32449
GOOD_ANSWER
{ "AcceptedAnswerId": "32450", "CommentCount": "5", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2013-10-09T07:47:42.643", "Id": "32449", "Score": "22", "Tags": [ "python", "performance", "regex", "csv", "python-2.x" ], "Title": "Regex to parse semicolon-delimited fields is t...
{ "body": "<p><code>.*?;.*?</code> will cause <a href=\"http://www.regular-expressions.info/catastrophic.html\" rel=\"nofollow noreferrer\">catastrophic backtracking</a>.</p>\n<p>To resolve the performance issues, remove <code>.*?;</code> and replace it with <code>[^;]*;</code>, that should be much faster.</p>\n", ...
<p>I have a file with just 3500 lines like these:</p> <pre><code>filecontent= "13P397;Fotostuff;t;IBM;IBM lalala 123|IBM lalala 1234;28.000 things;;IBMlalala123|IBMlalala1234" </code></pre> <p>Then I want to grab every line from the <code>filecontent</code> that matches a certain string (with python 2.7):</p> <pre><...
32449
BAD_ANSWER
{ "AcceptedAnswerId": "32450", "CommentCount": "5", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2013-10-09T07:47:42.643", "Id": "32449", "Score": "22", "Tags": [ "python", "performance", "regex", "csv", "python-2.x" ], "Title": "Regex to parse semicolon-delimited fields is t...
{ "body": "<blockquote>\n <p>Some people, when confronted with a problem, think \"I know, I'll use regular expressions.\" Now they have two problems. -- Jamie Zawinski</p>\n</blockquote>\n\n<p>A few things to be commented :</p>\n\n<ol>\n<li><p>Regular expressions might not be the right tool for this.</p></li>\n<li>...
<p>I have a file with just 3500 lines like these:</p> <pre><code>filecontent= "13P397;Fotostuff;t;IBM;IBM lalala 123|IBM lalala 1234;28.000 things;;IBMlalala123|IBMlalala1234" </code></pre> <p>Then I want to grab every line from the <code>filecontent</code> that matches a certain string (with python 2.7):</p> <pre><...
32449
GOOD_ANSWER
{ "AcceptedAnswerId": "32450", "CommentCount": "5", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2013-10-09T07:47:42.643", "Id": "32449", "Score": "22", "Tags": [ "python", "performance", "regex", "csv", "python-2.x" ], "Title": "Regex to parse semicolon-delimited fields is t...
{ "body": "<p>Some thoughts:</p>\n\n<p>Do you need a regex? You want a line that contains the string so why not use 'in'?</p>\n\n<p>If you are using the regex to validate the line format, you can do that after the less expensive 'in' finds a candidate line reducing the number of times the regex is used.</p>\n\n<p>If...
<p>I have a file with just 3500 lines like these:</p> <pre><code>filecontent= "13P397;Fotostuff;t;IBM;IBM lalala 123|IBM lalala 1234;28.000 things;;IBMlalala123|IBMlalala1234" </code></pre> <p>Then I want to grab every line from the <code>filecontent</code> that matches a certain string (with python 2.7):</p> <pre><...
32449
GOOD_ANSWER
{ "AcceptedAnswerId": "32450", "CommentCount": "5", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2013-10-09T07:47:42.643", "Id": "32449", "Score": "22", "Tags": [ "python", "performance", "regex", "csv", "python-2.x" ], "Title": "Regex to parse semicolon-delimited fields is t...
{ "body": "<p>Use split, like so:</p>\n\n<pre><code>&gt;&gt;&gt; filecontent = \"13P397;Fotostuff;t;IBM;IBM lalala 123|IBM lalala 1234;28.000 things;;IBMlalala123|IBMlalala1234\";\n&gt;&gt;&gt; items = filecontent.split(\";\");\n&gt;&gt;&gt; items;\n['13P397', 'Fotostuff', 't', 'IBM', 'IBM lalala 123|IBM lalala 1234'...
<p>This is a similar question to <a href="https://stackoverflow.com/questions/492716/reversing-a-regular-expression-in-python">this</a>, but I am looking for the set of <strong>all possible values</strong> that will match a regular expression pattern.</p> <p>To avoid an infinite set of possible values, I am willing to...
43981
GOOD_ANSWER
{ "AcceptedAnswerId": null, "CommentCount": "8", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2014-03-10T17:32:16.360", "Id": "43981", "Score": "3", "Tags": [ "python", "performance", "regex" ], "Title": "All possible values that will match a regular expression" }
{ "body": "<p>A major inefficiency in your solution is that you try every <code>fill_in</code> character as a replacement for any character class in the pattern. Instead, you could use the character class to select matching characters from <code>fill_in</code> and only loop over those. </p>\n\n<pre><code>&gt;&gt;&gt;...
<p>I am trying create an algorithm for finding the zero crossing (check that the signs of all the entries around the entry of interest are not the same) in a two dimensional matrix, as part of implementing the Laplacian of Gaussian edge detection filter for a class, but I feel like I'm fighting against Numpy instead of...
45458
GOOD_ANSWER
{ "AcceptedAnswerId": "67662", "CommentCount": "7", "ContentLicense": "CC BY-SA 4.0", "CreationDate": "2014-03-27T02:00:06.057", "Id": "45458", "Score": "19", "Tags": [ "python", "matrix", "numpy" ], "Title": "Finding a zero crossing in a matrix" }
{ "body": "<p>One way to get the neighbor coordinates without checking for (a != 0) or (b != 0) on every iteration would be to use a generator. Something like this:</p>\n\n<pre><code>def nborz():\n l = [(-1,-1), (-1,0), (-1,1), (0,-1), (0,1), (1,-1),(1,0),(1,1)]\n try:\n while True:\n yield l.p...
<p>I am trying create an algorithm for finding the zero crossing (check that the signs of all the entries around the entry of interest are not the same) in a two dimensional matrix, as part of implementing the Laplacian of Gaussian edge detection filter for a class, but I feel like I'm fighting against Numpy instead of...
45458
GOOD_ANSWER
{ "AcceptedAnswerId": "67662", "CommentCount": "7", "ContentLicense": "CC BY-SA 4.0", "CreationDate": "2014-03-27T02:00:06.057", "Id": "45458", "Score": "19", "Tags": [ "python", "matrix", "numpy" ], "Title": "Finding a zero crossing in a matrix" }
{ "body": "<p>Here's concise method to get the coordinates of the zero-crossings that seems to work according to my tests :</p>\n\n<pre><code>def zcr(x, y):\n return x[numpy.diff(numpy.sign(y)) != 0]\n</code></pre>\n\n<p>Some simple test case :</p>\n\n<pre><code>&gt;&gt;&gt; zcr(numpy.array([0, 1, 2, 3, 4, 5, 6, 7...
<p>I wrote a program that reads a pcap file and parses the HTTP traffic in the pcap to generate a dictionary that contains HTTP headers for each request and response in this pcap.</p> <p>My code does the following:</p> <ol> <li>Uses tcpflow to reassemble the tcp segments</li> <li>Read the files generated by tcpflow a...
57715
GOOD_ANSWER
{ "AcceptedAnswerId": null, "CommentCount": "4", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2014-07-22T18:26:02.543", "Id": "57715", "Score": "10", "Tags": [ "python", "http" ], "Title": "Parse HTTP header using Python and tcpflow" }
{ "body": "<p>New Lines and indentations help the interpreter know where the code terminates and blocks end, you have to be super careful with them </p>\n\n<p>Like in your if condition, you can't have a newline in between the conditions.</p>\n\n<pre><code>if header.find(\" \")==0 or \n header.find(\"\\t\")==0:\n ...
<p>I wrote a program that reads a pcap file and parses the HTTP traffic in the pcap to generate a dictionary that contains HTTP headers for each request and response in this pcap.</p> <p>My code does the following:</p> <ol> <li>Uses tcpflow to reassemble the tcp segments</li> <li>Read the files generated by tcpflow a...
57715
GOOD_ANSWER
{ "AcceptedAnswerId": null, "CommentCount": "4", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2014-07-22T18:26:02.543", "Id": "57715", "Score": "10", "Tags": [ "python", "http" ], "Title": "Parse HTTP header using Python and tcpflow" }
{ "body": "<p>A few brief comments:</p>\n\n<ul>\n<li>Use four spaces for each indentation level</li>\n<li>Use a space around each operator (<code>==</code>, <code>&gt;=</code>, ...)</li>\n<li>Use the <code>in</code> operator instead of the <code>has_key</code> method</li>\n<li>Use <code>subprocess.Popen</code> instea...
<p>The profile tells me it took ~15s to run, but without telling me more.</p> <blockquote> <pre class="lang-none prettyprint-override"><code>Tue Aug 19 20:55:38 2014 Profile.prof 3 function calls in 15.623 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) ...
60540
GOOD_ANSWER
{ "AcceptedAnswerId": null, "CommentCount": "3", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2014-08-20T01:02:35.297", "Id": "60540", "Score": "3", "Tags": [ "python", "performance", "matrix", "numpy", "cython" ], "Title": "Where is the bottleneck in my Cython code?" }
{ "body": "<p>There's a lot of code here, so I'm just going to review <code>interp2d</code>.</p>\n\n<ol>\n<li><p>There's no docstring. What does this function do? How am I supposed to call it? Are there any constraints on the parameters (for example, does the <code>x</code> array need to be sorted)?.</p></li>\n<li><p...
<p>I'm new to Python and I just wrote my first program with OOP. The program works just fine and gives me what I want. Is the code clear? Can you review the style or anything else?</p> <pre><code>import numpy as np import time, os, sys import datetime as dt class TemplateGenerator(object): """This is a general class ...
70989
GOOD_ANSWER
{ "AcceptedAnswerId": "70994", "CommentCount": "3", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2014-11-27T11:04:44.870", "Id": "70989", "Score": "4", "Tags": [ "python", "beginner", "parsing", "numpy" ], "Title": "Printer Color Templates" }
{ "body": "<p>I could make out some parts that could be improved.</p>\n\n<ol>\n<li>Good that you have used docstring for the class. You could do the same for the methods. In general, the code could have more comments where things are not obvious. Right now there are hardly any comments.</li>\n<li>Python programmers p...
<p>In honor of Star Wars day, I've put together this small Python program I'm calling JediScript. JediScript is essentially a scrapped-down version of BrainFuck without input or looping. Here are the commands in JediScript.</p> <ul> <li><code>SlashWithSaber</code>: Move forward on the tape.</li> <li><code>ParryBladeWi...
88783
WEIRD
{ "AcceptedAnswerId": "88797", "CommentCount": "2", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2015-05-04T14:07:32.930", "Id": "88783", "Score": "16", "Tags": [ "python", "interpreter", "language-design" ], "Title": "JediScript - May the 4th be with you" }
{ "body": "<ul>\n<li>Why do you allow each cell of the tape to hold numbers from -1 to 128? seems like an odd range.</li>\n<li>in <code>move_backward()</code> why do you allow the tape to reach position -1?</li>\n<li>in <code>move_forward()</code> why do you allow the tape's position to be beyond the end of the tape?...
<h2><strong><a href="https://codegolf.stackexchange.com/questions/50472/check-if-words-are-isomorphs">Are the words isomorphs? (Code-Golf)</a></strong></h2> <p>This is my non-golfed, readable and linear (quasi-linear?) in complexity take of the above problem. For completeness I include the description:</p> <blockquot...
94776
GOOD_ANSWER
{ "AcceptedAnswerId": "94810", "CommentCount": "2", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2015-06-26T13:36:14.983", "Id": "94776", "Score": "3", "Tags": [ "python", "strings", "unit-testing", "rags-to-riches" ], "Title": "Are the words isomorph?" }
{ "body": "<pre><code>for index, unique_letter in enumerate(sorted(set(text), key=text.index)):\n text = text.replace(unique_letter, str(index))\nreturn text\n</code></pre>\n\n<p>You don't need to go through the set and sort, you can do:</p>\n\n<pre><code>for index, letter in enumerate(text):\n text = text.repl...
<h2><strong><a href="https://codegolf.stackexchange.com/questions/50472/check-if-words-are-isomorphs">Are the words isomorphs? (Code-Golf)</a></strong></h2> <p>This is my non-golfed, readable and linear (quasi-linear?) in complexity take of the above problem. For completeness I include the description:</p> <blockquot...
94776
WEIRD
{ "AcceptedAnswerId": "94810", "CommentCount": "2", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2015-06-26T13:36:14.983", "Id": "94776", "Score": "3", "Tags": [ "python", "strings", "unit-testing", "rags-to-riches" ], "Title": "Are the words isomorph?" }
{ "body": "<p>There is a Python feature that almost directly solves this problem, leading to a simple and fast solution.</p>\n\n<pre><code>from string import maketrans # &lt;-- Python 2, or\nfrom str import maketrans # &lt;-- Python 3\n\ndef are_isomorph(string1, string2):\n return len(string1) == len(str...
<h2><strong><a href="https://codegolf.stackexchange.com/questions/50472/check-if-words-are-isomorphs">Are the words isomorphs? (Code-Golf)</a></strong></h2> <p>This is my non-golfed, readable and linear (quasi-linear?) in complexity take of the above problem. For completeness I include the description:</p> <blockquot...
94776
WEIRD
{ "AcceptedAnswerId": "94810", "CommentCount": "2", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2015-06-26T13:36:14.983", "Id": "94776", "Score": "3", "Tags": [ "python", "strings", "unit-testing", "rags-to-riches" ], "Title": "Are the words isomorph?" }
{ "body": "<p><code>text.replace()</code> is \\$\\mathcal{O}(n)\\$. Assuming we have a string of \\$n\\$ distinct characters your algorithm could devolve in to \\$\\mathcal{O}(n^2)\\$. Of course your strings are likely never long enough for big O to matter.</p>\n\n<p>In problems like this no matter what language yo...
<h2><strong><a href="https://codegolf.stackexchange.com/questions/50472/check-if-words-are-isomorphs">Are the words isomorphs? (Code-Golf)</a></strong></h2> <p>This is my non-golfed, readable and linear (quasi-linear?) in complexity take of the above problem. For completeness I include the description:</p> <blockquot...
94776
GOOD_ANSWER
{ "AcceptedAnswerId": "94810", "CommentCount": "2", "ContentLicense": "CC BY-SA 3.0", "CreationDate": "2015-06-26T13:36:14.983", "Id": "94776", "Score": "3", "Tags": [ "python", "strings", "unit-testing", "rags-to-riches" ], "Title": "Are the words isomorph?" }
{ "body": "<p>The code in the post does not work! Here's an example where it fails:</p>\n\n<pre><code>&gt;&gt;&gt; are_isomorph('decarbonist', 'decarbonized')\nTrue\n</code></pre>\n\n<p>The problem is that the eleventh distinct character gets represented by <code>10</code>, but an occurrence of the second distinct ch...
End of preview. Expand in Data Studio

Dataset Card for "my_section_5"

More Information needed

Downloads last month
3