« first day (2918 days earlier)      last day (2246 days later) » 
01:00 - 17:0017:00 - 00:00

01:56
Hey what’s up with this
stackoverflow.com/users/10459256/… This person joined yesterday and is consistently pumping out these questions
Taking exam or something I’m confused about this, also had shots so I pass it on to you
02:10
cbg
Question: indeally, should installing testing dependencies that aren't required by the project itself (eg pytest, coveralls) be accomplished in the CI .yml, or in the project requirements.txt?
02:52
I guess In wondering if in the .yml files, in the project requirements.txt, or having a second requirements.txt in the tests/ folder and calling that in the .yml files is the more pythonic way to do it?
 
2 hours later…
04:28
Does anybody know if I can convert py file to exe which will open in IDLE not console?
05:06
@BlackThunder you want to open the exe in idle? Why?
The console looks very weird
I want to make a neat interface for user to work with.
@Code-Apprentice Many features like copy, paste etc takes time in console. We cannot even select text using keyboard (like hold shift and use your arrow keys to select text)
And also, the font is not so good.
I have a lot of complains about Console.
If by console you mean the REPL, that's unsurprising. It's not an IDE.
Your users should choose their own IDE if they want to
@AndrasDeak I am talking about python IDLE i.sstatic.net/bz1qE.jpg
You're talking about "console" vs IDLE
05:19
whatever
When we convert a .py file to .exe file, then the exe file will open Console but I want such IDLE
Any idea?
Something like cmd embeded in tkinter may also work. But I have never found any solution of that.
 
1 hour later…
06:59
cbg-ning
Hi Friends, I was wondering if you could help me take a look at stackoverflow.com/questions/52771637/…
07:18
Does anyone has the answer: stackoverflow.com/questions/52745426/…
07:31
@AndrasDeak closed
@BlackThunder tbh I'd say your question was off-topic for SO
user9792856
hello
07:51
@roganjosh I really need an answer.
I want syntax highlighting for my programming language Numbairy.
(In the console)
@MartijnPieters (Since you are a moderator so) I think I have found a bug. Click on thefourtheye user profile icon on the right side and you will see the text overlapping with SO icon.
user6718998
08:07
Hi guys. Anyone worked with MPI before ?
@BlackThunder I'm certain I've seen that on a meta years ago
And mods don't accept bug reports, don't bug them
@Thewise what are you referring to? en.wikipedia.org/wiki/MPI
user6718998
python mpi4py
@Thewise yes, though only cursorily in pyhon
user6718998
I need help changing my code to use 4 threads
user6718998
08:09
no idea how to use thiss tuff
@BlackThunder please don't ask for help with fresh questions
@Thewise threads?
Are you sure you don't need threading or multiprocessing?
MPI sounds like hpc, 4 cores sound like 1 CPU
I suspect if you had MPI set up you'd know how to use it
user6718998
I just know i have to adapt my code for a supercomputer to use 4 cores, but I am new at this
user6718998
andras, you lithuanian ? xd
08:17
Grr, my "bullet-proof" code crashed overnight after a month :/
Nope
Rhubarb, back later
user6718998
08:30
pastebin.com/hcXj5mvu so any idea then how should I use mpi4py in this code ? What do I exactly use those size and rank and comm ? `it's kinda abstract from the docs, just some general cases
@BlackThunder That's something best reported on Meta. Community moderators are not developers, we can't do anything about bugs.
08:52
recbg
@BlackThunder it only looks ugly... if you look around in SO do you really think the aesthetics come first in the TODO list :P
If you brought it up, they'd only see another opportunity to throw in a giant flag icon taking up half the popup anyway
morning cbg
This has been an inordinately long week. Very glad i've made it to friday.
Same. Friday is a special day, I get to escape at 1:30 :)
09:04
oh, nice. no early escape for me, but at least a drink after work and post-morteming the week
Is it likely to be a particularly grizzly examination?
@Aran-Fey I'd say it's pretty important considering I just landed on that exact question stackoverflow.com/questions/50065643/… :P
It's not been a fantastic week, better than last week though, couple of abortive releases/launches
@roganjosh I assure you having a __cake__ variable isn't a necessity for a well-designed library :P
well that's disappointing :/
09:33
Cbg
@Aran-Fey how are you doing ?
Do you know what best practices to use angular and django reste (front back)
Nope, I've never used either of those
@Thewise let's start from square 1. Do you have MPI installed on your system?
09:51
I always tried to work with python for everything, so i realize it's complicated cause of its late in real time web, architecture as microservice.......
user6718998
@AndrasDeak yes
Do you know how to use the scheduler with a parallel environment?
user6718998
what is scheduler ? never used
How do you have to run your jobs?
user6718998
what jobs ? it's just a script
09:57
Who told you to use the supercomputer?
user6718998
teacher
the answers you seek lie therein
user6718998
nah, he doesn;t want to help
the code you linked should work if run properly (though will do redundant work on all nodes)
user6718998
yes ofc it runs, but its not using 4 cores, i have to change to code somehow to use that comm
09:59
ofc
we can't help you here
user6718998
at least if you could show how to start...
I literally can't
The code is fine as far as setup for parallel execution is concerned. You have to run it in a parallel environment. This is outside python. Until you figure this out (by communicating/finding resources with people responsible for your supercomputer) there's no point going forward. If you figure this out, you can edit the code so that the behaviour changes based on rank, and add parallel communication between nodes. That's it. Good luck.
user6718998
I know that. It's an additional file. I have that
user6718998
I will comeback in few mins and tell u exactly
10:04
take your time
user6718998
i saw that edit
user6718998
xdd
hey guys, I have written small python server which listens on given ip:port for any incoming requests. Single request is contained in single json sent on port. That json also contains required serialized, character escaped data files (in max 20 megabytes) as values of various keys along with some other parameters (key-values). In new requirement I am going to receive big binary files in several hundred megabytes. Should I rewrite code to receive these data files separately from first json?
If yes, how can I delimit between two things, like I have completed with sending initial json, now I will send first file, now completed with 2nd json, now I will send 2nd file, and so on. Should I be doing socket.flush() and then again socket.send() for next file? This sounds like building some sort of communication protocol. Should I be even doing this? or there is any ready made library / approach to do such things?
10:24
please read the second pinned post for how to post multiline code in chat
10:35
@AndrasDeak Is there an error message in your interactive JS console?
it just doesn't work, can't you understand? :P
just a few screenfuls of errors
> Unknown property ‘user-select’. Declaration dropped. stacks.css:1:1383
Unknown pseudo-class or pseudo-element ‘-webkit-input-placeholder’. Ruleset ignored due to bad selector.
Expected media feature name but found ‘-ms-high-contrast’.
stuff like that
let me see if they go away if I disable your script
That looks like CSS stuff, not JS
yup, bunch of errors still
finding your errors will be more difficult :/
ah, it shows the relevant files (?) on the right-hand side
clc.min.css and stuff like that
gotcha!
> Script error: ReferenceError: "BaseClass is not defined"
<anonymous> user-script:Aran-Fey/StackExchange%20duplicate%20manager:1414:5
scopeWrapper user-script:Aran-Fey/StackExchange%20duplicate%20manager:1382:10
<anonymous> user-script:Aran-Fey/StackExchange%20duplicate%20manager:505:17
Alright, I can work with that
(for everyone else, context is Aran's userscript not working with firefox)
10:39
Do you have any other userscript from me installed?
nope :)
and I mostly installed it because a matlab guy said it didn't work with firefox...
I'll look into it, but I can't promise quick results. I've got some work coming up IRL
Hey all,
hello
@Aran-Fey sure thing, just wanted to file the bug report
How to load machine learning model, written in Scikit in Node js.
any idea?
10:44
you mean from python+scikit into node.js+something?
I don't know, but since node.js is a general framework I'd expect a specific machine learning library to be involved on the JS side, at which point their documentation should let you know of options to import models
user6718998
@AndrasDeak IM BACK
user6718998
10:48
pastebin.com/SHU8ADZV this my MPI config file
user6718998
and then the script above
user6718998
thats it
user6718998
so how does that help me in rewriting my script ?
I never said it does
user6718998
10:50
so, how do we proceed
user6718998
well, "I" don't know
user6718998
that's why i came here for help :)
me neither, I've never used slurm
fortunately slurm has nothing to do with python
user6718998
its not about the slurm, but just that mpi4py on using it in my script
10:51
how are you using that "config" file?
and how can you tell it only runs on 1 core?
user6718998
i add python script name isnide it and call it from HPC
user6718998
because it takes sooo much time
:|
What do you think the effect of parallelization is?
user6718998
an teach asked explicitly to make a configuration like that with mpi
user6718998
none
10:53
okay?
user6718998
im so confused haha
I'm sorry but your level of confusion or ignorance makes this discussion very frustrating for me. I don't think I can help you further
Parallelization is not magic pixie dust which you spread over your executable making it faster. You make use of it by distributing work onto seperate workers. None of that is happening in your code.
51 mins ago, by Andras Deak
The code is fine as far as setup for parallel execution is concerned. You have to run it in a parallel environment. This is outside python. Until you figure this out (by communicating/finding resources with people responsible for your supercomputer) there's no point going forward. If you figure this out, you can edit the code so that the behaviour changes based on rank, and add parallel communication between nodes. That's it. Good luck.
55 mins ago, by Andras Deak
the code you linked should work if run properly (though will do redundant work on all nodes)
user6718998
My code generates a bitmap. I was told to generate it that one core will generate 1/4th of it (4 total). This is how I need to use it. Is this relevant ?
Your code tries taking user input for all 12 cores (assuming you're running it right). The prompt text should be present in some kind of aggregate output 12 times.
@Thewise it is relevant; that's what you have to implement
aren't there any log or .out or .o or whatever files during/after execution?
user6718998
The other config it's just an example. I will reedit it. Im not running that
user6718998
11:00
sorry for confusion]
user6718998
pastebin.com/YZphU6FZ this would be adapted for my code, and to run in on HPC I will use sbatch mpi-test (name of this file)
user6718998
this is all I know
that's way more than what you originally told me
user6718998
Thought would be simpler..
you're kidding me
1 hour ago, by Andras Deak
How do you have to run your jobs?
1 hour ago, by The wise
what jobs ? it's just a script
user6718998
11:05
aaa.. so thats a job
user6718998
teacher just said do this, literally nothing else
if you had showed me that mpi-test script I'd have seen "mpirun" at once which would've saved me half an hour of trying to force you to convince me that you're actually using MPI
@Thewise I'm afraid you'll have to start bothering the teacher with the rest. I've lost patience, sorry. You just need to write your code by branching based on the rank variable (which is the index of the running process), and using something like reduce or allreduce to collect all bmp contributions on the root node
user6718998
im not the brightest sheep in the shed
user6718998
I see....
user6718998
Oh well, thank you for your time
11:33
recbg
is there any way to merge repeating cells in pandas.to_html ?
no comment on this?
https://chat.stackoverflow.com/transcript/message/44245692#44245692
user9460641
11:54
I am using tensorflow's Object Detection API and the model I'm using for training is faster_rcnn_resnet101_coco_2018_01_28 but I a getting a InvalidArgumentError : assertion failed: [maximum box coordinate value is larger than 1.100000: ] [1.15277779]. I have checked my bounding box coordinates but none of them exceed the image dimensions. No answers yet. The link is : stackoverflow.com/questions/52758723/…
@anir upvote
2 hours ago, by Andras Deak
please read the second pinned post for how to post multiline code in chat
Yeah. Its not a codegolf
12:13
anyone good at ML here?
let's assume there is
If there were, what'd you ask?!
I'm trying to figure out what could be a good idea of "custom metric" for the MNIST dataset (60000 examples of 10 digits) to replace the Euclidian Distance and obtain possibly better results with some basics algos (knn, k_mean, isomap).
I thought about maybe adding some decay factor to integrate neighbor pixels when calculating an image's distance with its pixels' values. How dumb does that sound?
:44246997
     hi guys, little help here

    "I don't want to put unknown encodings of group image in to a classifier"

    what i did was find Matches for each of the encoding and trying to remove encodings with matches=0


    for encoding in encodings:
         matches =np.count_nonzero(face_recognition.compare_faces(data["encodings"],
         encoding))
         d["encods"]=[matches,encoding]

    for k,v in list(d.items()):
    if v[0]==0:
    del d[k]

    print("dict",d)
@payne btw wrt mnist, this is good general video youtube.com/watch?v=9sFUlR-CS7Y :D
wrt ?
12:18
@payne That sounds like CNN with extra steps
@payne with regards to
Or with respect to.
@payne by custom metrics, do you mean a new feature?
@Arne yeah, and I would simply use CNN if I could, but the assignment is about improving 5 basic algos by comparing the results with my own custom metric and the euclidian distance. :/
@Arne no, for example, in KNN, we use a metric to calculate what are the "k" nearest neighbors. This metric is usually L2 (euclidian distance). The "custom metric" would be to use something else as a function to calculate D(x, y) that would be symmetrical, that is D(x,y) = D(y,x)
Do you know the difference between L1 and L2?
12:27
for the most part an exponent and an absolute function, or something basic like that, no?
anyhow, using L1 is kind of cheating and I would doubt that it'd get me any points, haha
there is no "cheating" in ML.
L1, aka manhattan distance -> (x^1 + y^1)^(1/1)
L2, aka euclidian distance -> (x^2 + y^2)^(1/2)
L3, aka L3 -> (x^3 + y^3)^(1/3)
any metric, how stupid it is,
if it gives good results, it is good.
you can try those as metrics, but they usually don't change much
@AnttiHaapala there is at university ;)
12:30
@payne that is bs.
@Arne ah, hadn't seen that relation, thanks for that
such a "school" should not be called a university.
don't get me started on what's stupid about universities nowadays...
I see people getting carried through projects and getting good grades despite not really understanding nor being able to program.
@payne iirc, you can just put them as lambdas into the metrics param in sklearn. You're using sklearn, right?
yup, using scikit
12:31
for example in my alma mater, they cheated like this: en.wikipedia.org/wiki/Local_binary_patterns
@AnttiHaapala interesting. I've been thinking about using something similar to SSIM.
(this guy was the one who taught the machine vision course for us)
it looks so deceivingly stupidly simple idea.
oh, part of the assigment says that if an image is classified as a certain digit, our custom metric should ensure that a translation of that digit (moving it a bit to the right, for example) would not affect in any way the classification of that digit
that's a good one.
so are you supposed to come up with one metric
or many metrics that can be used
@AnttiHaapala if I understand correctly, LBP is about pre-processing the input given to a model to reduce the dimensionality, among other things ?
12:38
lbp is not suitable for your problem necessarily
@AnttiHaapala the professor wasn't exactly clear about that, so I'll assume it's ONE to be used on the 5 algo he wants us to use
it works rather well with textures.
we didn't have a mnist task, only a registration plate recognition, so it was easier
@payne That's a hard problem, actually arxiv.org/abs/1710.08864
Irrelevant for your setup, since you don't use DNNs, but still hilarious
It's a good article to bring up when people start talking about how DNNs are so very robust
yeah, I've watched a whole conference on attacks on DNNs :p
anyways, I've got a math demonstration to go assist to
if you have any idea, ping me out :)
@AkhilAlexander u mean u likes what I asked?
12:49
yes
13:22
cbg
[crypto job interview] interviewer: do you actually know what blockchain is? me: no, do you? interviewer: no me: so am I hired? interviewer: I guess
I point to a cool video or info-graphic while i raise my eye brows, nod, and vocalize "huh" a lot. This indicates that I know what the video and graphic are saying and that I really agree.
\o cbg
Happy Friday \o/
13:38
Cbg
@roganjosh!!!!!!!! lol I would rather buy a mini
But you're ignoring "reasons"!
Do so at your peril. The llamas that made the decision specifically warn against going against reasons
i rather be friends with alpacas than llamas :) they tend to be more friendly sir.
We have nothing further to discuss here, you've chosen your fate. Good day, Sir.
13:48
winamp whips the llama's ass
4
come at me
I was always a realplayer man myself (j/k don't judge me)
That would be too obvious. Give it 6 to 8 weeks them BAM, llama uppercut
Scrolling up to see if there's any context for this... Scrolling... Scrolling... Still scrolling...
Kevin.....there's never context with me. I just do things.
you should know this
-4
Q: How to host Flask app with MongoDB, for free?

Hemath HackerI'm working with a project using flask and mongo DB. I've completed the project and I need deploy it... Which host is for python with MongoDB?

13:50
Mini coopers, south american ungulates, media players from last decade... I need my tackboard and red string for this
Remember, context is for sissies. Starboard said so.
my message was flagged....
was that an auto flag for "profanity"? Or was there genuine offense taken by that?
I just got notified my message was flagged by three people
I didn't flag, but I do want to keep things hovering slightly below PG-13, all other things being equal
13:52
Serious question: Is a## considered above PG-13?
I questioned it and thought it was OK. But I can adjust.
I saw it pop up... wiggled my head a bit and said "yeah, that's valid"
I'm pretty sure that would be fine in films
@piRSquared valid as in "valid to flag as offensive"?
As in I can see it. Not that I was
@idjaw no autoflags
13:54
Well, isn't this a funny situation then.
Just the usual flag kiddie looking for ways to pretend to be offended
yeah....sure seems like it.
which comment got flagged? On another note we gotta go deeper!
That's quite a disappointing turn of events, I would have assumed that a regular could be nudged to change rather than 3 people flagging if there was a genuine issue. I don't think it's a serious event.
13:56
Can you feel the welcomingness?
it's delicious
@MooingRawr not very relevant
@idjaw Whats delicious?
I had to read that comment to the tune of "can you feel the love tonight" and it just didn't work :/
I didn't think it was serious. Just when a question gets thrown in my face I answer honestly. /shrug
13:57
@piRSquared I don't think I understand what you're saying
@piRSquared you should have your offensometer checked
Personally. There was nothing offensive about that. It was also a slogan for the winamp application. Being offended at that is why things take the wrong turn and things get blown out of proportion and escalated for no reason.
Only verify flags for which you find it OK to autosuspend the poster for 30 minutes.
With that being said, this discussion should stop and we should move on.
And yes. Be more realistic with what truly is offensive.
hmm, if you tell me that this is how we should measure it, from own perspective rather than perceived perspective... I'd let a LOT more slide
13:59
OK
Also, context is still for sissies I guess
^^
So the bug I thought I fixed last year and didn't: I fixed it again. Didn't help.
Perceived perspective is what causes things to spiral out of control.
Perhaps I should fix it a third time
14:03
@AndrasDeak I'm confused now, but I think we've moved on so oh well moving on :D
@MooingRawr yup, thanks
@AndrasDeak your diplomacy has returned :P
Off to play some pool and forget about the nonsense CSVs I've had to trawl today :)
Have fun :)
Currently annoyed by a recent question that asks "I have this complicated five dimensional JSON object, which is structured like this... [two paragraphs later...] and it contains a string 'a=b' at its deepest level. How do I get just b out of it?". The answer the OP was looking for was the_string.split("=")[1]. So... What was the point of including all the stuff about the JSON structure?
Naturally half of the answers spend 90% of their length talking about iterating over the elements of arbitrarily structured nested objects in order to find all strings that start with "a=", which as far as I can tell is totally unnecessary
Is there a name to a "function" that behaves like: where it uses the number to the left to determine if we should round up to the next digit slot (ignoring 0). For example, 10 adding 1 we get 11 since left is 1 and right is 1 we increase it to be 20, 20 adding one becomes 21 adding one again becomes 22 which rolls over to 30. This pattern shouldn't be limited to just 2 digits so if we have 1099 it rolls over to 1100 cause 99 rolls over, and then 11 part of the number rolls over to become 2000.
14:10
Is there any sort of input that doesn't roll over to some nonzero digit followed by some number of zeroes?
f(11) == 20, f(21) == 30, f(1099) == 2000. So far the logic is just "add one to the leftmost digit, and set all other digits to zero"
@Kevin the reddest of herrings
Maybe function wasn't the correct word, but I was hoping to find a math pattern term or something, to describe this sort of pattern
Some recently resurfaced demo from SOPHIE and A.G. Cook soundcloud.com/unreleasedpc/sophie-i-demo
no, it's not consistent with a number base for instance
@Kevin downvote
14:26
If we have a canonical for "how come my string s (which contains special characters) looks different when I do print(s) compared to print(tuple_containing_s)?", Replace double backslash with backslash could use it
@MooingRawr is that even a well-defined system? And can the available numbers be easily listed?
@Kevin I think there's a container str canonical
@Kevin there is
My current understanding of the system is "f(x) is the smallest number greater than or equal to x that can be represented as 'a * 10*b', where 1 <= a <= 9 and b >= 0"
My jimmies were too rustled to search properly.
Apparently the number sequence 1,2,3...9,10,20,30...90,100,200... is oeis.org/A051596, "Numerical values or Gematriahs of Hebrew letters {aleph, bet, ..., tet}"
14:33
@Kevin but that's only first 22 terms of oeis.org/A037124
Numbers that contain only one nonzero digit.
wim
wim
this (2015) duped to this (2014), yay or nay?
Googling "8, 9, 10, 20" site:oeis.org gave me A051596 as the top result, so therefore it is the most official number sequence. A037124 is hit number seven, hardly even worth mentioning
>>> "A037124" < "A051596"
True
QED
@wim Fine with me.
14:37
@wim NAK.
i.e. it was deliberate that it has been left open
Cbg Room 6 :)
I have a question for you
"The canonical questions list contains it, therefore it must be around for a good reason" places a lot of faith in the maintainers of that list :-P
@wim I am pretty shure Zero himself wrote the entry and the q or sth
do you have Zero confidence?
why u no show history sopython :F
14:40
Also worth noting that links aren't ordered by importance, since you can't order links at all.
Quite possibly the 3-upvotes question was meant to be a supplemental P.S. to the 38-upvotes one, but oops they're in the opposite ranking now
(Nah, I solved it myself trying to express it there)
@wim the other canon dupe exists to explain that container str uses element repr instead of str...
wim
wim
@AnttiHaapala yeah, ok. assumed that fact was obvious enough, but perhaps it's not.
@wim FWIW I linked the other question into the answer
So flags popped up from the PHP room. I didn't even have to read the post, I was offended at PHP.
wim
wim
14:47
If it used str that would be really dumb for a list like [2, '2']
ah additionally the other question uses invalid escape sequences :D
wim
wim
I'm offended on behalf of any llamas that might be offended.
@AndrasDeak "fun" was not quite had. Meatloaf had it wrong, " One Out of Four Ain't Bad" is the new line when it comes to pool :)
maybe next time :P
15:04
A recent question asks "is there something like my_byte_obj.find?", the answer to which appears to be "yes, it's my_byte_obj.find"
@AndrasDeak no clue.. I didn't think it through just thought of a pattern and didn't know if it was a thing. It fits in with what I'm currently doing at work
I wager 20 quatloos that Difficulty with reading csv file will eventually reveal that not all cells in the third column are floats, just most of them
"oh yeah, sometimes it says N/A or --, I would just like those to be None in that case, thanks"
Nevermind, you were right, there was just an error with the compiler. — Anonymous 57 secs ago
Darn. Another 20 quatloos for the "losses from bets that nobody agreed to the other side of" piggy bank
15:21
Or just use DictReader
I'd wager 40 quatloos that there isn't a CSV or JSON question in existence this year that hasn't already been answered before
Incidentally, docs.python.org/3/library/csv.html is clear as mud when describing how to invoke QUOTE_NONNUMERIC behavior. I have to reverse engineer the names of fmtparams by looking at the examples
"Couldn't figure out what the docs meant by 'For full details about the dialect and formatting parameters, see section Dialects and Formatting Parameters.', huh?" you hypothetically say. Damn right I couldn't. You can't expect me to click an additional link and/or scroll an entire page length to determine the behavior of a function.
16:10
say we are printing a string can we unpack the list into the string
>>> i = [1, 2, 3]
>>> print('Example {} {} {}'.format(*i))
Example 1 2 3
like this but without using a fixed amount of {}
print('Example', *i)
that was easy lol
lets pretend i didnt ask that and move along
16:27
im sorting this list does python know by default how to sort strings such as '1/12/2001, '1/28/2001', '1/5/2001' it seems to be doing it but wasnt sure if that is just coincidence or it does recognize to sort such dates in a string
date strings ordered as year-month-day can be sorted automatically because alphabetical sorting happens to put them in the correct order
assuming leading zeros
so ISO 8601
Any order other than year-month-day is liable to give out-of-order results
In fact, the exact example you gave sorts incorrectly. 1/5/2001 does not come chronologically after 1/28/2001.
i meant to put single /01
not 4 digits when i use this format 'm/dd/yy' it sorts properly
was confused
16:32
Ok, here's another example. sorted(["6/01/2001", "7/01/1999"]) gives ['6/01/2001', '7/01/1999'], which incorrectly orders the 1999 date after the 2001 date.
Similarly, sorted(["3/01/2001", "12/01/2001"]) gives the wrong answer.
Long story short, Python does not have special logic for sorting strings that look like dates.
@Kevin meant this
>>> l = ['1/1/11', '1/3/11', '1/2/11']
>>> print(sorted(l))
['1/1/11', '1/2/11', '1/3/11']
Sure, m/d/yy strings will sort properly if you can guarantee the month is always exactly one digit, and the day is always exactly one digit, and the year is the same across all of them.
okay yeah is that just happening cus its sorting the ints or does it recognize that as being a date
> Python does not have special logic for sorting strings that look like dates
> alphabetical sorting happens to put them in the correct order
@vaultah ty
and kevin as well
16:40
Python also does not have special logic for sorting strings that look like ints. Consider: sorted(["5", "10"]) returns ['10', '5']
@Kevin yeah I was just confused because it was workign with lists with a variety of years as well
oh no that was just one case i tested
okay so i was just looking at one case if i looked at others would see this was just coincidence
ty
Related reading: docs.python.org/3/reference/expressions.html#value-comparisons indicates how various built-in types implement the "<" operator, which in turn determines how they're ordered during sorting.
wim
wim
IIRC only the < is used by sorted.
hmm, nope, I was wrong
16:59
I don't know about sorted, but sort says "This method sorts the list in place, using only < comparisons between items."
I'd expect the implementations to be very similar but I take nothing for granted
01:00 - 17:0017:00 - 00:00

« first day (2918 days earlier)      last day (2246 days later) »