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

6:00 PM
I feel like I'm reinventing the wheel. Right now I'm manually getting the coords around a pixel of an image to call image.crop, so I can calculate the greyscale value, I feel like there should be an easier way to do this, time to hit up google-sensei
 
np.array([x,x+1])*h or np.arange(x,x+2)*h
 
hmm I guess that's an improvement to my manual grabbing of pixel around a given coord.
 
Hi. Is there anyone who is familiar with multiprocessing in python.
 
6:15 PM
Weird. This OP claims he's running Python 2.7, but his error messages mention bytes, so he must be using Python 3. stackoverflow.com/questions/52411503/…
 
@vaultah I was trying to use multiprocessing in a function where I wanted to take list of columns in parallel and perform clustering over it. But I am getting error. A sample program of multiprocessing using Pool is working fine but when I use it for my program I am getting no output of it. I am new to this multiprocessing thing.
 
user7437554
I have this dataset for y axe: sodium_iodide = np.array([159.0, 167.0, 178.0, 191.0, 205.0, None , 257.0, None, 295.0, None, 302.0]).astype(np.double)
sodimask = np.isfinite(sodium_iodide)
 
user7437554
but the last datapoint (302) is not plot
 
isfinite -> ~isnan?
 
user7437554
I took that from the web, is it wrong?
 
DSM
6:20 PM
@AndrasDeak: no. Think about inf, for example.
 
user7437554
It worked to build all the plots
 
@DSM but their literal only has None and the question was half-done when I guessedd :P
 
DSM
:-P right back at you. ;-)
@santimirandarp: if something's gone wrong with the plot, we'd need to see the failing plot code.
 
user7437554
Here is the image: imgur.com/kwjV6y9
 
@vaultah I was trying to use multiprocessing in a function where I wanted to take list of columns in parallel and perform clustering over it. But I am getting error. A sample program of multiprocessing using Pool is working fine but when I use it for my program I am getting no output of it. I am new to this multiprocessing thing.
 
6:23 PM
I know! Line but no marker, 1 isolated point
 
user7437554
yes...
 
user7437554
:(
 
Try plotting with 'o-' style
 
Does anyone know a good dupe target for "I'm getting a FileNotFoundError when I try to write to a file"? The best one I could find is this, which I don't like because there's too much unreadable and irrelevant code
 
user7437554
but that's what I did, isn't it? @AndrasDeak @DSM
 
DSM
6:24 PM
Still haven't seen the failing plot code, so who knows what you did? ;-)
 
user7437554
wait
 
user7437554
Yes, I'm doing so
 
Also in the supermarket, rhubarb :P
 
user7437554
There are many plots
 
DSM
6:25 PM
@AndrasDeak: buy some! :-)
 
user7437554
import os, sys
import matplotlib.pyplot as plt
import numpy as np
 
user7437554
sodium_iodide = np.array([159.0, 167.0, 178.0, 191.0, 205.0, None , 257.0, None, 295.0, None, 302.0]).astype(np.double)
sodimask = np.isfinite(sodium_iodide)

#TEMPERATURE
T = np.array([0,10,20,30,40,50,60,70,80,90,100])
 
user7437554
plt.figure(2)

plt.plot(T[sodbmask], sodium_iodide[sodbmask], marker='o')
plt.text(90, 302, 'NaI')
 
DSM
What's sodbmask? How does it differ from sodimask?
 
user7437554
6:27 PM
oh damn
 
user7437554
wait, maybe that's the error
 
could anyone please help me ? :-(
 
user7437554
I worked perfectly thanks both
 
user7437554
import os, sys
 
user7437554
I cant @Vamshi. too newbie
 
6:30 PM
@santimirandarp ok. no Problem and Thank you
@vaultah I was trying to use multiprocessing in a function where I wanted to take list of columns in parallel and perform clustering over it. But I am getting error. A sample program of multiprocessing using Pool is working fine but when I use it for my program I am getting no output of it. I am new to this multiprocessing thing.
 
@Aran-Fey It's not fantastic, but it's close enough. Pity it doesn't mention os.makedirs though. I assume you want it as a target for this: stackoverflow.com/questions/52411867/…
 
user7437554
thanks @Aran-Fey I'll get into the sandbox room
 
@Vamshi yeah, you already said that. You don't need to ping me specifically. If someone is interested in helping, they will.
 
@vaultah ok
 
@DSM couldn't see any. It's not a typical sight here. I've only seen homegrown.
 
6:34 PM
@PM2Ring Yeah, I was going to use it as a dupe target for that question, before it turned out that the OP wanted the slashes in the file name
I can't believe there isn't a single legitimately good Q&A about this FileNotFoundError stuff. Not much of a knowledge base, are we
 
@Aran-Fey I'm still not sure about that. I think she may want directories, but she's stopped responding to comments.
We're mostly a pretty good knowledge base, but there are glaring mysterious gaps where you least expect them. :)
 
Well, if they don't respond it's not our problem
I guess we could/should a add a dupe about creating directories for the benefit of future visitors though
 
Sounds reasonable to me.
 
@PM2Ring I guess everyone assumes that there's a canonical Q&A about the easy topics somewhere out there and so nobody bothers writing a good answer themselves
 
Maybe there is. And we just aren't using the right search terms... ;)
 
6:52 PM
not quite as old as the Petula Clark one... but nothing wrong with a bit of Pat Benatar
 
I was never a big fan of Pat, but she does have a good strong voice. I'm currently listening to random stuff from my MP3 collection (all from my CD collection). Now playing: People by Joan Armatrading.
 
cabbage that reminds me... Jeff Lynne has 4 dates in London at the O2... probably already missed out on the possibility of getting tickets :(
 
7:11 PM
interesting... a late evening email from a client "why are we paying for 5 servers when we're only using 3 at a time in the cluster you setup"...
sure I explained that their given scale of operations and what they agreed to was having replicated servers across 5 different data centres... but... shrugs
 
Aww, and here I thought the answer was "because I'm ripping you off" :P
 
hey nice folks :-)
I am trying to implement optimize.curve_fit from this answer: optimize.curve_fit
65
A: Getting standard errors on fitted parameters using the optimize.leastsq method in python

Pedro M DuarteUpdated on 4/6/2016 Getting the correct errors in the fit parameters can be subtle in most cases. Let's think about fitting a function y=f(x) for which you have a set of data points (x_i, y_i, yerr_i), where i is an index that runs over each of your data points. In most physical measurements...

I get ValueError: sigma has incorrect shape.
am I doing something wrong or the code there is wrong in your op?
 
Fully expected to see the name Aaron Hall after scrolling through that :)
Please show the full traceback
It's hit-and-miss whether someone will be familiar with the exact problem you linked to, but that gives us all a leg-up in understanding what might be happening
 
@roganjosh It's not quite long enough for an Aaron Hall answer. :)
 
(well, idk whats happening exactly neither :/ )
 
7:21 PM
This is true but after two mouse-scrolls and still being mid-way, the suspicion creeps in :)
@PalSzabo that's why I'm asking for the traceback
We're all a bit blind atm until we see the actual issue
 
Now playing: A Pillow Of Winds, by Pink Floyd, from Meddle.
 
roughly in the middle of that answer, there is a boldface part: optimize.curve_fit
I am running the code exactly below it
starting with:
def fit_curvefit(p0, datax, datay, function, yerr=err_stdev, **kwargs):
ending with: print("perr = ", perr)
 
I see it
 
and it doesnt run, giving me ValueError: sigma has incorrect shape.
 
That's not the traceback
 
7:24 PM
could you help me how should I explain the issue more? :-)
hmmm
what is traceback then?
 
The traceback is all of the text spewed out, ending with the actual error message
That shows what code in what file and on what line led to the eventual error.
 
cbg
 
Oh ok
can I post error msg here?
 
@PM2Ring haven't listed to some PF in ages... but you've reminded me of one of my favourite covers of "Wish You Were Here" by Alpha Blondy (it's a reggae version which I actually quite like) -youtube.com/watch?v=bsoiupLME-w
 
If it's more than a few lines, please put into a pastebin or something
 
7:27 PM
(doinit...)
this is the error I am getting:
 
@JonClements That won't play in my old Firefox. I'll have to watch it on my phone.
 
I find it worth listening to...
there's very few covers I actually enjoy... but that one I don't mind at all...
 
(code comes is a min...)
 
could easily see me doing that with a glass of rum on a sunny Sunday afternoon... (I'm in the wrong country for sunny... but whatever...)
 
7:33 PM
Can I make a question? In my computer, I downloaded python from python.org. Does that mean I'm using CPython?
 
@PalSzabo thanks, having a look
 
@EnderLook Yes.
 
@roganjosh thanks
 
@Aran-Fey Oh, great!
Thanks
Is there a way to know what I am using from the python console?
 
@PalSzabo fixed it
 
7:37 PM
@EnderLook stackoverflow.com/questions/1093322/… maybe via this way?
 
@EnderLook do you mean the implementation of it or the version of it?
 
@roganjosh how?
 
As per the docs, sigma is "sigma : None or M-length sequence or MxM array, optional"
You are passing a scalar
 
yup - that one pretty much covers it - thanks @PalSzabo
 
err_stdev = [0.2 for item in xdata]
 
7:37 PM
@JonClements Implementation, like CPython
 
You need to make it an M-length sequence
 
oh yep it works now
wanna edit the post or should I?
 
Note that this assumes the problem is homoscedastic
At least, that's my interpretation of why it wants an M-length array
 
alright I think my problem is such
so its hopefully gonna work
 
Where exactly is the issue in the answer you linked to?
 
7:40 PM
@EnderLook you'll only get the CPython version of Python from python.org... you'll consciously know if you've installed Jython or IronPython etc...
 
Mmmm, I'll have a think about editing that answer
 
@JonClements Ok, I just wanted to know if there is a way to know which one was installed in the computer
 
Probably it needs to be a comment, let's not upset the initial setup of the problem
 
@roganjosh 5th line from the bottom, in the code part below the bold text "Let's see some examples"
 
Yep, I see it
 
7:42 PM
@roganjosh alright!
 
I'll sort it shortly
But for now your issue is fixed :)
 
I already suggested an "import random" edit I think it makes it better (it was missing from the beginning)
yes :-)
thanks!
 
errr, looks like something crashed
"improve edit", just accepted your edit and then greyed out the screen and didn't give me a text box :P
Anyway, I can edit it now
 
Let's Golf rules: no itertools: What is the most succinct way to find the union of all dictionary keys in a list of dictionaries? The result can be a set, list, or tuple
d1 = {'A': 1, 'B': 2}
d2 = {'B': 3, 'C': 4}
d3 = {'B': 5, 'D': 6}
d4 = {'E': 7, 'F': 8}
d5 = {'H': 9}
lod = [d1, d2, d3, d4, d5]
from itertools import chain
{*chain(*lod)}

# {'A', 'B', 'C', 'D', 'E', 'F', 'H'}
 
>>> {k for d in lod for k in d}
{'F', 'D', 'B', 'A', 'H', 'E', 'C'}
 
7:56 PM
looks pretty good
 
Do imports count toward the score? They do, right?
 
yup
 
yep
 
@PalSzabo edited it
 
python4.0: {*l for l in lod}
 
7:59 PM
@roganjosh reading it. Cool!
 
Python 5.0 {***lod}
 
set().union(*lod)
 
^ dude!
 
@piRSquared how short is set is set().union(*lod)
bloomin' heck - Kevin'd by vaultah! :(
 
neat
 
8:01 PM
I was trying to experiment with if set.union could be used with .keys or something but oh well
 
@PalSzabo just replying to your comment in that thread so the OP understands the edit :)
 
@roganjosh noted :-)
(i replied so folks can see that the edit makes it work)
 
I'm just going to say that @vaultah got that trick from me and hold my head up high and go sulk in the corner :p
 
:)
 
I'd split the quantloos... but I don't have any
 
8:07 PM
don't go having a divide by zero on us :)
 
I'm sure I've said before that quantloos need to come in lower denominations
 
You can do this without an import in Python 2:
reduce(set.union, lod, set())
 
@PM2Ring but then wim will shoot you down :p
 
The normal rules are suspended for golf. :)
 
there's probably some esolang using unicode that can do it in 4/5 chars anyway :p
anyway... I've appeased myself from the Kevin'd chair by finding this one
 
wim
8:25 PM
yaha I have one of those on main too stackoverflow.com/a/50535741/674039
 
Do those say "edited 3 minutes ago"?
 
wim
>>> {*ChainMap(*lod)}
{'A', 'B', 'C', 'D', 'E', 'F', 'H'}
 
where is ChainMap imported from?
 
wim
my IPython sitecustomize.py file
 
{*sum(map(list, lod), [])}
 
8:33 PM
Is * still the splat operator in all of this?
 
yes
 
wim
yes but it's not really an operator
 
It seems to be so prevalent in discussions these days
 
wim
it's grammar
 
Yes, "operator" probably wasn't the right word, for me it's vocabulary sorry :/
 
wim
8:35 PM
I tried to override it when I was a n00b and failed miserably
 
I'm always a little unsure when I want to use certain terms
 
If I were to cite a trait of mine that has helped me learn the most, it would be the lack of fear to ask.
 
I don't fear asking in here
On the main site, I still have worries about asking. In the past I've had a pandas typo question that got answered and the answer upvoted - all I could do was watch the downvotes and comments come in :/
 
wim
yahaaa
you can probably get typo deleted by post in here
hide your shame
 
I got rid of it in the end :)
Someone else peer-pressured the answerer to delete
 
8:46 PM
I don't think downvoting typos makes sense unless the OP clearly couldn't be yammed to try and read the error/fix their code
typos are fine, and they are often only obvious in hindsight
this is not to say that we want them to stick around
 
I had no error
I typoed in the column name and it ended up assigning data back to a new column with a typo name :/
 
I suspected as much, just saying
 
welp I finished my first version of pic to ascii but I'm not happy with the calculating average greyscale number part but it will do for today. Time to go play some ping pong.
 
9:00 PM
"I'm voting to close this question as off-topic because the problem is that the OP simply didn't notice something fairly obvious." Hmm
 
Rogan what are you talking about ?
 
-6
Q: Don't understand this TypeError

ChefJVery basic stuff and I completely don't understand why do I get this error. Two lines of code below: Discount1 = 2.2 * 5 / 100 Discount1 = Discount1(round,2) print(Discount1) Traceback (most recent call last): File "C:/Users/Jacek/AppData/Local/Programs/Python/Python37-32/kdkjd.py", line ...

Custom close message. Seems a bit OTT
 
Oh and also the code dump answer with no explanation
 
Omnishambles
I don't know if "shambles" means anything outside the UK. Basically a complete mess. Throw "Omni" in front of it and it's a brilliant word. I think it was Charlie Brooker that came up with it
 
curious, why do you think shambles means something different outside of UK o.o ?
 
9:07 PM
Some things just strike me as fringe words
 
@roganjosh hard to believe this gem was from only 2 years ago stackoverflow.com/q/38293593/2336654
 
"Finance professional turned python/pandas enthusiast." make sense :D
 
@roganjosh always reminds me of shingles
 
@MooingRawr I spent a lot of time working with international students and realised at some point that they didn't get some of the words I was using but didn't say anything. I've just become a bit hyper-aware when speaking to international people that I might be taking too much for granted
 
@roganjosh wasn't that used for the government at the time?
 
9:10 PM
@JonClements yup
Shingles/ominshambles. About the same thing :)
 
@roganjosh make sense, but I think maybe they didn't get the words you were using not because the words meant something different, but just maybe they never heard of the word?
 
@piRSquared your rise is more meteoric than mine. Stop making me feel bad :P
 
stackoverflow.com/a/52414267/4099813 is this flaggable or just a downvote since it doesnt answer the question...
 
"shambles" is a word - but it's "omnishambles" that now has other connotations regarding politics.. think it made it into the OED or something?
 
@MooingRawr yeah, but I could use colloquialisms. Do you know what a ginnel is?
I was only second-guessing myself on whether I'd used a local term :)
 
9:13 PM
@MooingRawr an answer, an awful one
i.e. downvote at best (worst?)
 
It's downvotable and I exploited that. "Hahaha"
There was a question on the English grammar SE. "What is a phrase for something that can be applied everywhere?"
The comments came up with "ubiquiplicable" and "omnipropriate". I need to get them into general use.
"universal" was the obvious and boring answer
 
@roganjosh no clue what ginnel is
 
wonder what the word is for the "government" "handling" "brexit"... there must be something stronger than "shambles" :p
 
@JonClements yep it's ******* stupid **** ****** ****** ***1!1!1one!
 
@roganjosh is that the splat operator?
 
9:19 PM
ssssssssssssssplatttttt operator
 
I wish
Clear the namespace
 
And then there's the Discworld kind of shamble.
 
@roganjosh I've reached the point where I just want the UK & EU to run off the proverbial "cliff" and then that'd seriously focus minds... but here's not the place for such cabbage :p
 
That's suggesting there are minds to yet be focused
Those that can think are bored of thinking
 
off the cliff -> splat again
 
9:28 PM
^
I was so on-topic without realising it :P
@JonClements from your earlier posts it seems like you do independent work? I'm curious what type of stuff you're working on?
 
Starting the Independent British Kingdom. Or too soon? :P
 
Too soon? I need all the escape routes I can get
 
pupland...
 
If Boris becomes PM, I will genuinely consider up and leaving
 
perhaps you'll be able to get an EU visa
 
9:32 PM
@roganjosh that or JRM that seems to be from 1920 and hasn't realised it yet
 
I feel my "welcoming" shield collapsing on the mention of these people :/
 
by the way is there anything in the UK vis-a-vis daylight saving?
 
<insert splat operators here>
 
@AndrasDeak yup... think they change shortly
 
@AndrasDeak it was mentioned on the BBC, but nothing confirmed AFAIK
 
9:34 PM
i.e. going to follow the EU thing?
 
Follow the EU? Outrageous! We'll turn our clocks 2 hours each way!
 
Don't you tell us what to do!
 
what I meant to say was "lead by example for the EU to follow in your footsteps"
 
the UK has done it's own analysis... we've got a bit more north that most EU stuff
 
9:35 PM
@AndrasDeak During WWII they even had double daylight saving...
 
@JonClements huh, true, Scotland goes as north as Stockholm!
 
I think it's either been voted on or due to be voted on in Parliament
 
Oh, well then we'll assemble a committee to do a 500 page report, and we'll give you the top 3 suggestions in bullet points. Hopefully that will clarify how things should run in Europe
 
(almost)
 
@AndrasDeak I know there's some MPs that introduced it to the "House" recently, and many have done many years before now about how stupid it is... but it's never reached a majority to stop it.
when you consider why it was done in the very first place, it does seem daft
 
9:38 PM
Wasn't it for school kids not getting run over?
 
nope... energy savings
remember 3 day weeks and strikes?
 
I'm sure I read something about it being due to road traffic accidents
I'm not that old :)
 
read up on what DST is and all that :)
 
Let's not and pretend I did :P It's 22:40 and it's been a long day, please don't push me to datetime stuff :P
 
give me my sausage roll and I shall not? :p
 
9:42 PM
Do you want your interpretive dance for your presentation or not? (Two can play this game)
Slide 3, or in the biz, the 3rd Movement, oozes passion. They won't be eating sandwiches when they see the car park presented like that. Just sayin'
 
hahah... I'll set up a boom box going "beep beep boop boop beep beep" then? :p
 
What could cause import pandas to take up to a minute to execute?
I have an strace
 
9:57 PM
@JonClements went for a cig and "two can play this game" should have been "takes two to tango". I'm totally rewinding the last 10 mins and pretending that's what I said to keep it on topic of dance
 
10:17 PM
How could anyone disparage itertools? stackoverflow.com/a/52414814/2336654
 
wim
6 parentheses nested on one line, that's a paddlin'
 
@piRSquared In cases where itertools answers are put up against a standard Python approach, have you ever used timeit?
 
That would completely tarnish the cool factor!
 
cabbage
 
cold-cbg to u
 
10:20 PM
itertools has lost every time for me. And it's mentally much harder to parse too.
 
@roganjosh maybe, except when flattening nested lists... chain is super fast.
 
cbg coldspeed
@coldspeed We'll call that the coldspeed caveat :)
 
wim
If only there was a timeit -h (human) mode to measure how long it would take a developer to comprehend the code. Then people could optimize for that instead of obsessing over runtime microseconds.
 
sounds like a task for AI
 
I've long fantasised over a git commit --yolo which bypasses integration tests and ignores merge conflicts (because yolo)
 
10:24 PM
"(because yoro)" Fixed that for you. You only run once.
 
wim
... your commit hooks run integration tests?
 
Nah, but my company's equivalent of git commit does...
 
wim
that's insane. I shudder to think.
 
yeah it takes me 45 minutes to submit.
on a good day.
 
wim
so nobody at the company commits work in progress and rebases before pushing?
 
10:26 PM
Well, it also depends on the language. Java code had to go through a lot more checks than my python code did.
 
Gotta run... YORO!
 
@wim Regardless of how big or small their commits were, those tests always run
continuous integration test suites, I believe. I never looked into them too much. JUnit categorises them as "enormous".
 
wim
testing every commit going into master is reasonable. because git bisect working correctly relies on things not being intermittently broken in the history. but testing at commit time is pretty silly.
 
If not at commit time, then when?
Ah, I should mention there's something called "presubmit" which does a soft submit and runs the tests on that. Not on the master. Sorry about the misunderstanding.
 
wim
when pull-request created
no point to test ephemeral commits that might be rebased/squashed out of existence later in your workflow
 
10:32 PM
Oh, ok. Our version control system works a little different. You create a workspace, develop your code, run the tests and presubmit checks, and then commit.
 
10:54 PM
matplotlib 3.0 ships with a cyclic perceptually uniform colormap; love it!
and I missed that they added a new colormap in 2.2 called cividis, which is not only perceptually uniform but it should look as similar as possible to colorblind and non-colorblind people (at the cost of being a bit ugly)
 
11:16 PM
Anyone doing ML here?
 
@payne In the past. I can talk conceptually about it, but not the current library implementations.
 
Good enough :)
I'm just starting. I've been following the "cs231n" course (Stanford - Convolutional Neural Networks)
I want to start a mini-project just for practicing, but I'm slightly lost as of where to start
My goal is to have a network that can enhance the resolution of an image
 
That's generally for image processing
 
I'm having trouble understanding what my intuition should be in terms of Architecture of the Network
 
I'm out. I used them for industrial processing
 
11:20 PM
@roganjosh yup, and more about classification than other things, actually
I do realize my problem isn't actually related to classification
 
Yep, whereas I used ML for continuous problems to find some optimisation rather that clasification
Sounds like you problem is classification?
 
nope
I want to input an image, and the output should be an image with a better resolution
 
And that's the end goal?
 
yup
=> zero classification to be done
 
Yep, got it. I know what you're trying to do and my mind is drawing blanks sorry (literally bed time)
Gah, thanks a lot for giving me something to think about when I should be sleeping :P
 
11:25 PM
example of application: i.snag.gy/gAdDuw.jpg
 
rbrb. I have to sleep. I know what it is you're asking, hopefully someone else finds the term before me tomorrow
 
00:00 - 18:0018:00 - 00:00

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