« first day (2895 days earlier)      last day (2278 days later) » 
00:00 - 18:0018:00 - 00:00

00:10
Does anyone have experience running Pandas on Alpine on Kubernetes? import pandas alone seems to take ~30 seconds. Lots of moving parts here I know. Not sure if to ask here or kubernetes, or linux, or docker
01:04
@roganjosh I want that to be a badge
or a hat during winterbash
Answer a question after 30 minutes of comments
 
3 hours later…
03:54
Hello, does anyone know the correct method to improve stack limit of PyPy in linux? This code can reach the system limit in CPython but I have a much less stack limit in PyPy.
import sys, math
sys.setrecursionlimit(1000000)
def f(i=0):
    if int(math.sqrt(i))**2 == i: print i
    f(i+1)
try:
    f()
except RuntimeError, e:
    print e
04:49
@Thiner: sys.setrecursionlimit(n) sets the underlying C stack size to n*768 bytes on PyPy. You may be running into the limit of what you can set the C stack size to.
I wonder whether my most recent downvote is a tactical downvote or someone just not understanding the (pretty obscure) attribute resolution mechanics at work. It's annoying either way.
Cabbage.
@user2357112 got a room 6 reversal from me </vr>
perhaps it would benefit from a short TL;DR on top though.
Tried adding a "short version" to the top. Not sure how much it helps.
05:41
Hello, I am working with keras and pandas to tokenize my data for a machine learning sentiment approach. However I keep getting the following error when i run my model IndexError: list index out of range. I've checked my csv input files for empty lines or other issues. I'll post code in a bit if I cant figure it out.
 
1 hour later…
06:43
hello
Is there a way to get the current iter i am on during the for loop
Depends on how you are looping.
You could use the built-in enumerate function.
I am already using the var for something else
for index, var in enumerate(my_iterable):
    ...
where index (can name it whatever you want) will be your current iter, starting from 0.
06:48
Thank you @shad0w_wa1k3r that works perfectly
you're welcome
07:33
@shad0w_wa1k3r are you familiar with xml?
ignore my previous
cbg-ning
07:57
@ex080 you can try posting an MCVE here
08:19
brief cbg
this is no mcve, right? There's nothing wrong with that code?
08:35
Martijn didn't seem to think so in 2014
I mean, if the double backslash were a problem then the os.listdir call would've failed. I don't see how it's possible to obtain the path E:\\dir\\.project and then have a FileNotFoundError thrown
08:50
> Happy to announce Matplotlib 3.0.0!
This is the first version of Matplotlib to only support Python 3.
7
09:08
They bumped the version number from 2.2.3 all the way to 3.0.0, huh? Looks like they really don't want anything to do with the number 2 anymore
probably just semver :) I don't know how that precisely works but "killing off support for a major python version" sounds reason enough to bump a big one
Though 3 for 3 sounds nice
09:55
@user2357112 Maybe I did not state it very explicitly.. I did both ulimit -s unlimited and sys.setrecursionlimit(1000000), however the latter did not seem to lift the stack limit as what CPython does. PyPy segfaults here. Unfortunately I cannot have the symbol work in gdb, but the crash site should be libpypy-c.so and the crash reason should be like another buffer overflow rather than stack since the offending pointer is not stack IMAO
Cabbage
@Aran-Fey That looks ok to me, although I guess the OP's English could be cleaned up. And the 1st line of the accepted answer is ambiguous. It should be something like "If you are using a raw-string, then you do not escape backslashes".
10:11
cbg
Managed to get a 160K answerer to switch to a close vote. Chalk one up for the little guy
closed
thanks
@roganjosh Nice work! He's a chronic answerer of dupes. But at least he's not immune to criticism.
10:34
Yeah, I've noted the name a couple of times
11:09
@CalebHoward okay... seems an odd approach though. You're going to write your own version of graphics for when it's not there... so now you've got effectively two modules/classes that are meant to do the same thing... Just makes more sense to me to ensure that graphics is required instead of bundling your own copy for when it's not present... seems like a maintenance nightmare in terms of compatibility, user expectations and debugging later on... I can't help but feel you're over complicating this and doing a lot of work for no real gain... just make graphics a dependency and you're done — Jon Clements ♦ 56 secs ago
I have a feeling it's going to fall on deaf ears... but at least I tried...
11:26
@Aran-Fey I've edited the question and the accepted answer. Let me know what you think.
Well I'm still pretty confident that there's nothing wrong with the OP's code, but I'm not on Windows so I can't say for sure
Ah, right. I see what you mean. :) Redundant extra slashes in *nix paths get ignored, but I don't know what Window does with extra backslashes or slashes. OTOH, in other contexts, eg regex, then you definitely don't want extra backslashes.
I don't know much about Windows, but IIRC, double backslashes have some significance in network filepaths.
Careful when editing error messages by the way, I was very confused for a minute because you edited out the double backslashes in FileNotFoundError: [Errno 2] No such file or directory: 'E:\\dir\\.project' :P
@Aran-Fey Yikes! I didn't even notice that. I guess that happened when I removed the backticks from the error messages & put them into quote blocks. :oops:
@Aran-Fey I just noticed in the OP's original edit there are double backslashes in both error messages. And the question doesn't make sense unless both the error messages have the double backslashes. So I just fixed that.
11:53
I'm starting to see "web scraping" referred to as "web scrapping" so often now, I'm starting to wonder if it's me that's got it wrong...
I know what you mean. :)
Jun 13 '17 at 23:41, by PM 2Ring
Please don't scrap the Web, some people are still using it. — PM 2Ring yesterday
12:11
Double backslash is valid in Windows paths
12:23
Cbg
I'm starting a campaign of getting people to post df.to_dict() for pandas questions. Bored senseless now of fighting with read_clipboard, I spend more time faffing with that than actually trying to solve the problem :/
cbg
CBG? does cbg stand for cabbage? Found this reference not really helpful acronyms.thefreedictionary.com/CBG
@PythonBeginner it does: sopython.com/salad
@roganjosh ty I guess I am a green bean
No worries, you're not expected to know that there is a language called "Salad" :) Welcome.
12:28
@roganjosh while I agree it's definitely nice to have a .to_dict() - using pd.read_clipboard(sep='\s{2,}') works in most cases (minus having to convert things to timestamps but...)
ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\s+' are interpreted as regex); you can avoid this warning by specifying engine='python'.
return read_table(StringIO(text), sep=sep, **kwargs)
Specifying the engine doesn't seem to be helping either
Oh - the one you posted that on, I just copied, then did pd.read_clipboard(sep='\s{2,}', engine='python') and got a DF
What do you get for df.index?
RangeIndex(start=0, stop=21, step=1)
hmmm, you're right
Don't know what I was doing wrong. Handy trick, thanks
12:35
You're welcome... I'll add another sausage roll to your tab :p
Now we'll see if I can get an answer in before being Jezrael'd :P
that's already happened :p
In future, I've cut my losses on that one
I've seen them completely rewrite an approach from scratch in under a minute when the OP changed the question. I don't think I'll ever get to that standard, I just need to be quicker at opening the question :P
12:52
Way too broad but they've chosen the best animal stackoverflow.com/questions/52406278/python-top-trumps-game :)
Wow... looks like it also summoned my evil twin @thefourtheye :p
Is this a typo or should it be answered? They have a conflict of names with x stackoverflow.com/questions/52406175/… or is there a dupe?
@roganjosh "standard"
What does that mean? :/
that made it sound like a good thing
jez "not a dupe because here x=2" rael
Commute rbrb
Hahahaha
13:01
Hi. Do you know how to count/group/aggregate the number of identical items in a pandas dataframe column? I mean that for
a
b
a
I should get a new table like
a 2
b 1
Use .value_counts() ?
I was using groupby()
That can also work...
@PM2Ring Whoops, I didn't notice there was a 2nd one!
13:06
cbg
I am not getting the interface of groupby though; this is giving me an error

TypeError: data type "weight" not understood

autoren_table.groupby('weight').describe(include=['weight'])
"autoren_table"? Why the half german, half english name?
german is domain langauage, english is technical
@Phil that's not because of the groupby.... that's because weight isn't a valid argument for include to describe...
@Phil what actually are you trying to do that .value_counts didn't solve?
Do you have a full example how to use it?
13:11
You mean that isn't already covered with examples in the documentation?
ah wait, its ok
thank you. I thought it would be way more complicated
I have a linter saying: "Relative import 'myfolder.myscript, should be '_master.myfolder.myscript' " - but when I change it to that, it doesn't work... The actual code is of the form from myfolder.myscript import some_function but I don't suppose that distinction matters. Suggestions?
stackoverflow.com/a/52401986 no idea why this is accepted, it's just a restating of the same steps from the question (which is a dupe)
@toonarmycaptain Well, the linter is definitely wrong. The question is why. Do you maybe have an unused __init__.py lying around in the _master directory? Maybe that makes the linter think that _master is the directory of your package
@Aran-Fey I don't have a directory named _master. I have a structure project_folder\app_files, with the run_app_script, .travis.yml, README, tests_folder etc in the project folder, and everything else in the app_files folder
13:26
\o cbg
Hello!
What's the quickest way to share mcve? Python notebook?
@ex080 pastebin.com is one option
@ex080 github gists
Ok, let me try that first.
13:29
Which do you guys think is faster for membership testing. Converting a list to a set then test for membership, or just test for membership in the set directly?
You mean in the list directly?
Why not time it and find out?
yes
list directly*
I was hoping to be lazy.
Great way to use the room.
Thanks @davidism
13:31
@toonarmycaptain Huh. Weird linter bug. I guess you should write a bug report and get it fixed
It'd be intensive to test whether the speed of converting to a set is dependent on size, or whether it's done at ~O(1) using some move operation.
Maybe someone has that in depth knowledge here
Intensive?
relatively
And anyway, you'd only have to do it once and then you'd also have the knowledge and maybe learn something along the way, rather than just being told a "fact"
Doubt it. But my theory is that it will be faster to check for membership in the list
13:34
I am hoping for set technical specs instead of relying on the circumstances of the experiments
It's impossible to convert a list to a set in O(1) time. Their internal representations are far too different from one another
because the worst case scenario is O(n)
but conversion to a set is going to also take O(n), AFAIK
since you have to iterate all of the elements to put them in the set
of course you could make your own special type that's faster, if you need it.
MCVE: https://pastebin.com/dhPcNrgP
OUTPUT/ERROR: https://pastebin.com/ScE8GcMF
Okay. Membership testing of a list is O(n) anyway, so converting to a set to get O(1) testing time is futile.
It's just going to take 2n space
13:36
Thanks @WayneWerner !
I'm not sure why I keep getting index error, I have checked the length of X_train and y_train and they match. Any ideas?
@J.L.Louis bingo. The only way around it, like I mentioned, is to roll your own.
@ex080 somehow data is an empty list
Hey, all! I'm hoping to get some close vote support for an under-specified problem. I asked for clarification five days ago with no response:
Roll my own. Create my own set datastructure?
13:38
@roganjosh but the print logs show the encoding?
What line are you referring to sorry?
@EthanFurman please use standard [tag:cv-pls] link reason format, see our guide: sopython.com/wiki/cv-pls
I have a feeling we'd need to know something about the library to be able to help on this one
` if isinstance(data[0], list):IndexError: list index out of range`
13:40
Yep. No index is valid for an empty list, but data is a variable inside the library
hmm so it's a library issue
Not necessarily
i must be doing something wrong somewhere
@J.L.Louis Yes, it's silly if you're only doing a single membership test. But if you intend to do lots of tests then it will be worthwhile creating the set, unless the list is tiny.
13:41
Done
I assume so, but since I don't know the library I'm not sure what to suggest
@EthanFurman I'm not sure if that's really a reason to close the question. Surely the answer should be "You shouldn't create Enum instances dynamically like that" anyway?
Don't need to know every last detail of the OP's bad idea to tell them that it's a bad idea
FWIW, here's some timeit test code & output on doing list intersections via lists vs sets. It's not quite the same as what you're asking, but it's similar. :) stackoverflow.com/a/33168356/4014959 The code runs on Python 2 & 3
Ok, well thanks for trying maybe I'll post it as a full question
@PM2Ring makes sense
Is there a way to converting a string to a set of words directly?
13:47
You mean like set('abc')?
I think ``` if word in set(string.split(" ")) ``` implicitly converts the string to a list first, then to a set
I'm not talking complete BS in stackoverflow.com/questions/52407021/… am I? I'm fairly sure it's why that signature was chosen...
(I can't think of any other reason for it...)
the split function converts the string to a list. I wonder if there's a way to split it directly into a set..
@J.L.Louis Yes, it does create a list first, so it does use a little more RAM than a function that goes straight from a string to a set.
13:50
@Aran-Fey Done.
@JonClements In case of sorted and sort, part of the reason is probably also to make the difference between python 3's key and python 2's cmp more obvious
Yeah... If I recall in 2.x you could specify both for some weird stuff :)
@PM2Ring is there such a function in Python's standard library?
Nope. :)
Okay, trying again...
13:52
@J.L.Louis might save memory but probably heck of a lot slower.... {m.group() for m in re.finditer(r'\b(.*?)\b', some_text)}
https://stackoverflow.com/questions/52333953/create-python-enum-item‌​-dynamically
Cool! :)
It's closed
heya @EthanFurman
Don't worry about it. Lists are fast and relatively cheap. In many situations Python already uses a lot more memory than equivalent C code. Partly that's because everything's an object in Python. And partly it's because it would be even slower than it is if it tried to do everything with minimal RAM.
Umm... {*text.split()} seems slightly faster than set(text.split())...
13:57
@J.L.Louis BTW, it's usually better to do some_string.split() than some_string.split(" "). The former splits on all runs of whitespace, the latter only splits on single spaces.
and .split(None) is nicely optimised
Reading the Dask documentation:
A modern laptop has a multi-core CPU, 32GB of RAM, and flash-based hard drives that can stream through data several times faster than HDDs or SSDs of even a year or two ago.
Lol. I think that's still only a dream for me
But yeah... pretty much never is ['test', '', '', '', '', '', 'something', '', '', 'blah'] something you want/expect from 'test something blah'.split(' ')
My desktop PC only has 8 gigs of RAM...
@JonClements Howdy!
14:00
@JonClements I guess that makes sense. When I've messed around with that sort of thing I've found it hard to get consistently significant speed differences, and I guess the relative speeds can easily vary from one version to the next. And on the data relative to how big your CPU caches are.
I still have boot floppies so my PC has different configurations to run dos4gw games and different amounts of conventional, expanded and extended RAM :p
@Aran-Fey It's probably a bad idea, but I have seen one other instance where, for example, building an Enum as various modules are imported make sense.
Yeah, I think Dask has a slightly wonky world view for now
It's possible that this use-case also makes sense but it is definitely non-standard usage with great potential for abuse. Given the ease with which it is possible to inadvertently break an Enum (by subclassing EnumMeta) and not realize it until much later I'm not going to answer it without a better specification (and would prefer no one else does either).
@JonClements Nice one, nuppy. :)
14:01
You should see the loops I went through getting Chrome to work :p
Which reminds me... I should try to buy another 1 gig DDR1 card for this ancient beast. I'm currently running on 1.5 GB after one of its cards died a few months back. Luckily I had 2 pristine half gig cards sitting in my spare parts collection.
@PM2Ring ah, I thought split() would split the individual letters, that's why I used split(" ")
cbg all
@J.L.Louis It's always a Good Idea to check the docs for stuff like that. They explain that .split() is handled as a special case.
14:04
@PM2Ring The depressing thing though is we probably lost well over half the room on that :p
@JonClements so split(None) is more optimized than split()?
Err... split() is split(None) :)
okay
I thought so :)
But I know python has a lot of syntactic sugar where things are not always as they seem
Thank you, all.
Any quick Enum advice I can offer before getting back to work? ;)
Like how many Enums does it take to cross a road?
@Ethan yes... how many Enums does it take to cross a road frogger style? :p
14:08
sigh Actually, I'm terrible at creating jokes -- I have no idea!
@Aran-Fey Weird, I commited, cleaning up a missing newline/removing some trailing whitespace, didn't touch the import line or anything near it, and...voila, no more issue.
@EthanFurman Pretty sure it only takes one, right?
class RoadCrossingStatus(Enum):
    ON_WRONG_SIDE = 0
    CROSSING = 1
    ON_RIGHT_SIDE = 2
    HIT_BY_A_CAR = 3
@JonClements Probably. :) Back in the days when PC users had to deal with that "interesting" memory architecture, I was using an Amiga. But the memory shenanigans still had an impact on me, since I was writing in C and a large majority of C code online had all that crazy memory stuff happening in it.
@Aran-Fey I like it. :)
14:10
@roganjosh thanks man I made a public post here hopefully someone knows. I tried to put as much explanation as possible
https://stackoverflow.com/questions/52407777/indexerror-list-index-out-of-range-keras-tokenizer
Being an Aussie, "enum" always looks like a dyslexic variant of "emu" to me. :)
Umm... is there no Enum.from_whatever(['cat', 'dog', 'cabbage']) or have I missed that in the docs?
@toonarmycaptain Hooray for problems that fix themselves (:
!!afk
ahhh... glanced over it... it's under the bit that has Animal = Enum('Animal', 'ANT BEE CAT DOG')
ignore me...
I was thinking - umm... shouldn't this act a bit like namedtuple and lo' and behold... :p
14:14
Indeed :)
As I'm obviously lucky... onto my thinking of 6 numbers between 1 and 59....
Should this answer by the OP be converted to a comment? stackoverflow.com/a/52406869/4014959
@idjaw that's pretty cool. So you build the release as a docker image, too, right?
@PM2Ring maaaaybe. I think it would be better moved to a comment than just deleted with no idea where the heck it went.
i.e. moving to a comment >> gaslighting
Agreed
14:19
yeah... before it starts getting flagged, goes through the NAA queue and downvoted etc... etc...
Thanks, Jon.
In today's episode of Yamming Stupid Python Assignments, may I present stackoverflow.com/questions/52408105/masking-part-of-a-string
The influx of new students doesn't seem to only be restricted to asking questions. I'm seeing lots of cases of the blind leading the blind with answers recently :/
14:35
@Code-Apprentice It depends. For the case I provided, it is for a docker image. If this was, for example a python package, or an ansible role, I would simply bring up a container to do the work inside, and not bother doing any docker tagging
and simply do the git tag and push
@wim yes, mocks are truthy, I misspoke.
@wim don't use dict.get as a sort key. Use dict.__getitem__. But better yet: use Counter.most_common() and let Counter figure out the better sorting method.
@wim Counter.get(value) is None tells me that value was never seen. That's helpful information.
Example:
>>> c = Counter('abc')
>>> c.subtract('ab')
>>> c
Counter({'c': 1, 'a': 0, 'b': 0})
>>> c.get('b')
0
>>> c.get('d') is None
True
15:00
I understand people using SO to cheat on their homework, but it still baffles me why we get so many people dumping stuff from coding challenge sites. I guess some of those challenges could be set as homework assignments. Or maybe they do it for fake bragging rights. :)
have quite often been tempted when seeing pythonchallenge stuff... to just go... yeah... ignore that one - it's boring... here's the link to the next one :p
You don't feel like hammering out a solution to a constrained TSP?
@PM2Ring oddly though, reading that question suddenly made me realise a much better solution to one of my interview coding challenges from last year. Not sure why it prompted my thought, but at least I got something out of it :P
@roganjosh It's tempting... But I'd prefer that Kevin did it with one of his unreadable multiply-nested lambdas. :D
Preface it with "look, it's all just pure python" so they don't suspect a thing when they submit the homework :)
That masking thingy?
It's kind interesting, with the restriction that the next node weight has to be a whole multiple of the current weight. It really cuts down on the possibilities.
oh... sorry... was looking at the "masking one" @PM2 linked... re that one: what's that function name and code got anything to do with the task?
@JonClements Yeah, that one's just too silly.
@PM2Ring yeah, that's what prompted me to think of my interview challenge. I missed an extra constraint that could have sped up my search dramatically. I got the job so thankfully it's not crushing hindsight :P
@PM2Ring surely one needs a regex for that? :p
15:12
@JonClements Perhaps, but with assignments like that, you normally aren't allowed to import any modules. :)
Not satisfied, the TSP OP is now asking me to recommend somewhere else that will do their homework for them lol
It seems a little odd that given what they're asking - you'd have thought they'd know a bit about TSP/graph algorithms etc... if it's homework - you'd seriously expect them to have some background on that at least...
Ha! That's what I just said in a comment. :) Hopefully, they'll read it as encouragement, rather than someone being on a pedantic high horse.
wim
wim
@MartijnPieters aha. now that is an interesting one.
I had forgotten about the behaviour difference between Counter.subtract and Counter.__sub__
and Counter.__isub__
15:32
Bloomin' heck... an old colleague and friend of mine asking me how much SAS I remember...
think I just about remember data steps, some procs and basic macro'ing... wow... that's jolted the old sponge...
I did about 3 months of SAS and abandoned it. I found it so unintuitive.
Makes you all sassy again
broseph's answer is "interesting"
not sure if using filter or creating the filter by a lambda outside the filter is bugging me the most
wim
wim
assigning to a lambda is an immediate downvote from me
15:46
also appear to just have gotten a downvote on that keyword arguments answer - interesting... wonder what's wrong with it
If the downvote doesn't come with a comment, I recommend being paranoid and assuming it's a strategic downvote from the/a competing answerer. That's more convenient than worrying about some part of the answer being wrong/bad
I recommend being paranoid - did they tell you to say that... I bet they did... I knew you were part of it :p
I'm not at all bothered - just find it odd... I'm sure I'll sleep soundly tonight and worry about things that are actually important :)
Learning how to turn an image into ascii art using numpy, (super fascinating) but is there a way to interpolate (I think this is the term I don't remember much of my image analysis class), to highlight the edges clearer maybe through pillow first before trying to feed it in?
Or rather anyone know the term for "highlighting the edges/lines of an image" maybe turning it into just a line art ?
@JonClements Oh no, you dialed up the paranoia too far! Go back while you still can, before you become a conspiracy theorist!
@Aran-Fey the truth is out there! trustno1
15:54
Oh no, it's too late :(
@MooingRawr you've reminded me of yonks ago a guy I knew wrote a program that'd take images and produce ascii art from them and then get mIRC to post them via DDE...
wim
wim
The choice for sorted is almost surely due to the deprecation of cmp, and you didn't even mention about that. The other answer is better.
20 odd years ago... I'd imagine that'd be much, much harder than it is now in terms of libraries and stuff...
@JonClements Not going to lie, the IRC community I'm apart of for some gaming community is one of the main reason for me looking at this project.
@wim the argument in general is still the same though really: sorted(iterable, cmp=None, key=None, reverse=False)
If I want to provide a key to that using position arguments, I'd still have to use sorted(iterable, None, key_func)
wim
wim
15:58
cmp came first in the python 2 signature, now it's absent
I know... I've been around since the 2.1 days thanks
wim
wim
that means if sorted key wasn't kw-only, code that was passing cmp positionally would now pass it in as key
I suppose for that exact case and history I should mention that but that'd be stepping on the other answer... I was trying to make something true to generally why sorted works the way it does now within the context of positional argument ordering not making much sense...
but yeah... since the cmp was removed completely it made sense to make keyword arguments compulsory... shame such a radical change can't be made to re.sub etc... so people don't confuse the number of replacements arguments with the flags argument :)
@MooingRawr "edge detection", filed under image processing. Scipy.ndimage (maybe), opencv (probably)
Thanks AD, lunch time will look it up after lunch
16:04
@MooingRawr Yes, PIL has a couple of edge detection filters pillow.readthedocs.io/en/5.2.x/reference/ImageFilter.html Or you could just do a simple convolution in Numpy, See en.wikipedia.org/wiki/Edge_detection for some example convolution kernels.
Thanks PM,
there's also skimage scikit-image.org/docs/dev/auto_examples/edges/plot_canny.html (but I've never used that)
user7437554
16:25
Hi guys. I'm trying to label a chart with multiple graphs, not using a label-box but a word on each graph-end
user7437554
I couldn't find it anywhere. Is there any way to do it?
Which library?
user7437554
Mathplot lib
matplotlib, mat as in matlab as in matrix :)
What do you mean by "chart" and "graph"?
user7437554
I'm sorry. Just starting out with al this mess xD
16:27
it's OK, just thought I'd note ;)
user7437554
Chart is the "box" with multiple graphs?
A figure with multiple axes inside?
Ooo, Andras is gonna see red for a matplotlib slur :P
user7437554
Btw. Yes thanks, I like people to correct me.
you can count on me for that :P
import matplotlib.pyplot as plt
fig,axs = plt.subplots(nrows=2,ncols=2)
plt.show()
like that ^ ?
Which one do you call box, the whole window, or the 4 things inside?
16:31
@JonClements ah, did you have a go with your heatmap yet? I choreographed an interpretive dance for you to go along with your virtual reality plot. I dare say I exceeded your demands.
user7437554
Wait a second...what I've done: import libraries, write two lists, one is horizontal axe, and then the perpendicular one. Then I plot the dataset using plt , on second argument label='smth ' @AndrasDeak
is the Gregg's sausage roll real or virtual? :0
@santimirandarp you could also show me an image of your own so that we're talking about the same thing
Imaginary
We'll go with virtual, you just have to think very hard
@santimirandarp I now suspect what you're asking is "I have an axes with multiple plots inside, and instead of a legend box I want to annotate the axes such that each plot has a Text of its own"
user7437554
16:33
Thanks for knowing what I'm asking @AndrasDeak
let's hope that's really what you want :D
If that's the case, drop the label=... and instead call pyplot.text for every label you want to place on your date, with appropriate coordinates
the coordinates are given in the usual units, same as your plots in the axes
you'll have to choose the coordinates manually, of course, but you can take the last point from each plot or something
user7437554
Yes, I'll try doing so. @AndrasDeak
user7437554
Thanks a lot.
no problem
@AndrasDeak *data...
Did you just tag yourself to correct your own text?
16:39
yes?
Not seen someone do that I don't think. It seemed a bit like talking in 3rd person :)
I'm hopeless at chat, presumably the tag leads back to a specific comment you're correcting
yes, it's a directed reply
@roganjosh It's not common, but it does happen from time to time.
@PM2Ring But what's really silly is stuff like this. :)
Andras likes to ensure that Andras is correct at all times
There's a special place for answers telling someone how important indentation is in python and then introducing their own indentation errors :P
16:54
314/500 Towards Illuminator I'm pi way there.
weren't you "pi" way there at 157/500 as well?
@roganjosh It's a classic example of Muphry's law, also known as McKean's law, and in some circles the law of recursive pedantry.
Don't forget Clements' law... "I never said that!" :p
I'd pay to watch the monster who came up with this question try to solve it themselves
wow...
maybe I haven't spotted it yet but normally there's a little "gotcha" in those that means you immediately know what it is because of something or other...
17:02
It probably was designed to waste time, as I don't see any shortcuts
The intent is explained in the name of the function. "Angee: cute way of saying 'Angry'"
@JonClements two answers at the bottom differ only in numbers, meaning you actually need to know the value of k
@vaultah I know...
that's just a beep one... generally you get stuff like that that you can as @PM2Ring says... spot a "shortcut" or what it's meant to be doing quite nicely... in this case... I think I've worked out what it's doing... but I'd not be able to do that in under a minute or two at best
that code is basically the equivalent of "solve this quadratic equation" (type of thing) I think...
@vaultah might be faster to type it in...
@AndrasDeak I OCRed it after staring at it for several minutes
And switching windows was disallowed 👌
17:10
I think we should kill that Muphry's law answer. Its author doesn't seem willing to fix it, and it's not worth keeping.
Ha, I'd not heard of that, PM. I like it!
I've downvoted it. I'm now off the committee for further action I guess :/ must. Answer. More.
:) It's a very powerful law. Whenever I post something pointing out spelling or grammar errors I check it 3 times before I submit it. That almost always works. :)
@vaultah oh wait... if you work backwards and ignore all the obfuscation it's still really bad but wow
ugh... no k and s get mutated as well...
@vaultah Do you know the correct answer? I say it's number 2
if that was a good question and wanted to see if you knew what was going on... it'd have all that stuff there without mutating the variables and the answer would be "it's just (k + j) / 2"
17:17
The answer is gngirster cjavhi eicrti,eeen as .. t108.5 (I ran the code)
Oh wow, my math must've been way off...
@vaultah the GRU is really pushing things these days hey? :p
Quite a lot for a tourist agency
Hey @Aran-Fey Apropos your recent conversation, here's an OP who's confused about the difference between reading from stdin and getting command line args. stackoverflow.com/questions/52411090/…
17:33
Hmm, I guess you may be right. I initially thought they were confused why the input("No arguments read from command line!") was executed more than once, but they don't seem to have figured out that they didn't need to implement interactive input at all
17:53
is there a better way of writing, x1,x2 = x*h, (x+1)*h?
x1 = x*h
x2 = (x+1) *h
or using some algebra:
x1 = x * h
x2 = x1 + h
x1 = x*h
x2 = x1 +h
kevin'd
is there a better code golfing solution for a one liner ?
17:54
i can't think of anything other than what I wrote but it's too "verbose"...
ahh...need a better definition of "better"
shorter/less bytes
if not I'm going to figure another solution to my problem I guess...
yah, golfing that line probably depends on the rest of the code.
x1=x*h;x2=x1+h is still viable
well k thanks
00:00 - 18:0018:00 - 00:00

« first day (2895 days earlier)      last day (2278 days later) »