« first day (2811 days earlier)      last day (2362 days later) » 

00:01
I am completely baffled here:
new_results = []
for row in results:
  found = False
  row_dict = dict(row)
  for k, v in measures_as_dict.items():
    print(k)
    print(row_dict)
    print(k in row_dict)
    if k in row_dict:
      row_dict = {**row_dict, **v}
      break
  new_results.append(row_dict)
print(json.dumps(new_results, default=default))
renewal_acv__c
{'renewal_acv__c': Decimal('0'), 'renewal_amount__c': Decimal('0'), 'type': 'Add-On Business', 'engagement_type__c': 'Sales Assisted', 'isdeleted': False, 'amount': Decimal('0')}
False
It says the key is not in the dict and it clearly is in the dict.
Only changed the numbers for privacy
It is a dict... The key is not in the dict
@Simon It is a dict... The key is not in the dict
That's ok I apprecaite the help @Simon
Sorry. I misread.
Totally no problem.
It seems to work out for me. pastebin.com/y6j9f4iQ
hmm
I don't get it.
Even when I change it to
  print(k)
  print(row_dict)
  print(row_dict.get(k, 'nothing'))
It prints nothing each time.
Maybe an MCVE so I can run it for myself?
00:16
@Simon What is MCVE?
Minimal, Complete Verifiable Example stackoverflow.com/help/mcve
Aha. Cool.
Let me see if I can repro in repl.it or something
Melon.
00:33
Ok I figured it out.
The original key had an extra space on the end. Oy
At least you know what was wrong now. @Johnston :)
01:11
Rhubarb all.
01:56
Thanks @Simon
02:35
@MoxieBall & @OlivierMelançon That factorial encoding card trick was devised by Fitch Cheney. I wrote some C code years ago that generalised it, I guess it'd be easy for me to translate it to Python.
Feb 10 '16 at 15:16, by PM 2Ring
@InbarRose Like Fitch Cheney's card trick that uses factorial counting.
02:45
Wow. The new PyYAML update broke our serialization
actually quite amazing, entire system's down with like 30 unit tests broken
put a <= in our setup.py for now as a bandaid but it seems to not even be able to dump np.float32 objects or anything.
is there a room for Selenium?
never mind i now know there isnt one
does anybody know if there are relative path selectors in Selenium like there are in Scrapy (i.e. ele = response.css('#id'); ele.css('#relative') )
@OneRaynyDay So PyYAML is currently yammed?
@AnttiHaapala I get more joy from seeing a +1 than a +10, because it means that a bad answer I downvoted got deleted.
14
@PM2Ring super yammed:
0
Q: New PyYAML version breaks on most custom python objects - RepresenterError

OneRaynyDayAbout 5 hours ago, version 4.1.0 was released. It is breaking my unit tests. Here is a clean MVCE displaying this: Version 3.12: >>> import numpy as np >>> import yaml >>> x = np.int64(2) >>> yaml.dump(x, Dumper=yaml.Dumper) '!!python/object/apply:numpy.core.multiarray.scalar\n- !!python/object...

I was surprised, and then I saw this commit message in PyYAML:
> wtf, how did this typo happen
And then my stomach dropped and my gut told me to never use PyYAML in serious projects ever again
03:02
@Anthony Click the hamburger icon on the far right of the menu bar. It opens up a list of Stack Exchange communities, but right near the top are links to help & chat.
03:16
@PM2Ring yeah thanks. can u lend a helping hand? does u know if there are relative path selectors in Selenium like there are in Scrapy (i.e. ele = response.css('#id'); ele.css('#relative'))
@Anthony Sorry, I don't know Selenium. You might get a response to your Selenium question later, this room is usually pretty quiet at this time of day.
@PM2Ring ahh ok. hopefully. when is this channel most busiest?
wim
wim
03:41
pyyaml is garbage
im out take care guys!
@wim yes sir
wim
wim
unfortunately the alternatives are also garbage
recommend move to toml or something else
these names are just...
well, the things we're yaml'ing isn't really of tip top performance bottleneck or anything. The format doesn't matter, but the guarrantees that come with yaml should at least be respected
wim
wim
maybe with donald stufft on the maintainers list now it will become less garbage
@OneRaynyDay So, if you weren't using yaml.safe_load your code was already broken :P
yaml.load is allowing arbitrary code execution, it's as bad as eval. the ruby community got seriously burned by the same issue (basically every ruby gem was compromised). fortunately python community was generally using .ini for config files, not yaml.
@OneRaynyDay what "guarantee" - 3.1 to 4.1 is a major version bump, that means backwards compat is broken. read semver if you don't know what I'm talking about.
 
1 hour later…
05:24
@wim In the yaml documentation, they stated explicitly that "beware that yaml will execute arbitrary code like pickle"
and that was what they specified, so for current purposes we treat a part of the serialization like pickle (that we know will not execute malicious code, and don't worry it will be changed in consequent updates)
But I did not actually know about the semantic versioning thing; good read, thanks
wim
wim
05:44
And thanks for bringing the PyYAML release to my attention. Because this required a change in my lib oyaml for which I will releasing a new version shortly.
gotcha. No problem :)
wim
wim
I wonder how much stuff will be on fire at WimCorp tomorrow ... we use PyYAML quite extensively
Interesting corporation name ;)
wim
wim
btw, little known trick in pip that might be handy for you to know, the squiggle equals operator. if you pip install something~=3.1 it will upgrade any point release as they become available in the future (3.2, 3.3... up to 3.9) but won't upgrade a major release.
so when you pin something, it's good to pin it like ~= so that you get the point releases / bugfixes, but you don't get the backwards breaking changes (assuming the proj maintainer are doing semver correctly).
I see. That is very useful, thanks. I'll probably cork up the errors with the ~= operator tomorrow and then do some proper cleanup afterwards and remove some unecessary yaml and move the actual pickling into pickle
Anyways, thanks @wim for answering my question
TIL
 
1 hour later…
07:09
Morning cbg
07:22
morning
cbg
07:45
cbg
@thefourtheye o\
@AndyK /o
08:25
cbg
09:13
@AndrasDeak \o
 
1 hour later…
10:16
Stuff should be countable with the plural stuves
10:51
Cbg
cbg
is python 3.7 going to be released today?
The last news: python 3.7.0b5
"If your code makes use of the ast module, you are strongly encouraged to test (or retest) that code with 3.7.0b5, especially if you previously made changes to work with earlier preview versons of 3.7.0".
 
2 hours later…
12:52
Cabbage all.
13:15
mon g s
icb bci
s g nom
cbg \o
My feeling when I don't wanna look at anymore code at work, perfectly captured with that doggo picture
DSM
DSM
Cabbage for puppies everywhere!
cbg
@piRSquared "don't migrate crap"
fine! (-: guess that's true
but if it's migrated, they can help make it better. There's a nugget of a good question hiding in there
DSM
DSM
13:27
We (and by we I mean SO) have gotten pushback from our sister sites, esp. codereview, when we push low quality stuff over there. It comes up on meta from time to time.
fair enough
CR is the worst in this regard, they even have a howto codereview.meta.stackexchange.com/questions/5777/…
that's why CR is not a standard migration path in the close dialog
my close vote still counts as a close vote despite it being for migration, correct? Meaning, 5 votes still closes it?
yup
hopefully it won't cause it to get migrated ;)
I think I read that rule somewhere. IIRC it shouldn't unless a majority of votes went that direction.
13:34
let's hope so ;)
as long as your migrate isn't the popular one (which it can't be in the current trend) then you are fine
14:12
@PM2Ring neat, never knew the source.
morning cbg
CBG
hello folks, I am trying to install this gurobi interface Previously I've done it with Anaconda on Win OS with no problem. Now I am trying to install it on Ubuntu without Anaconda. Where is setup.py in Ubuntu? or what am I supposed to do, if you guys can take a look?
hey, Sardar :)
Hi, Andras. :)
setup.py should be next to your downloaded source, so how did you download the module?
14:17
Sorry i didn't know if I was supposed to download something. I was expecting them to give the similar manual as that of anaconda. I'll take a look
you could also install anaconda on ubuntu and use it the same way as on windows :)
will it affect python that comes preinstalled in ubuntu? or is there anything that I need to be aware of?
ha, good question, and I don't know
according to askubuntu.com/a/507714 you can install locally (without sudo) and use that, in which case there's no way for it to mess with system python
you could still edit your $PATH so that you can just run it as anaconda or whatever
but there are warning such as
Be careful as Anaconda seems to install their own version of moc (for building Qt apps), which may conflict with the system libraries if you compile when /home/USER/anaconda3/bin is in your path. — landroni Feb 28 '17 at 17:16
Thanks, Andras!
No worries. Unfortunately I don't use any fancy package manager tools (other than pip) so I can't help further :) There are a few regulars who use conda, so if you get stuck they'll eventually be able to help, probably
14:27
hopefully :)
OK, so I read your link again: it says "the Gurobi installation includes everything you need to use Gurobi from within Python"
so yeah, there should be an existing gurobi installation of yours, inside which there's the setup.py
also I'm pretty sure you can use setup.py with --user in which case the installed files will be kept separate from the system ones, put in your home directory
I'll try finding it
what's everyone's favorite "hmmm, where did I put that?" command?
@SardarUsama find /usr -iname "*gurobi*" and the same in your home may be relevant; they may take some time though
@AndrasDeak Thanks
14:38
going to commute, be back later
Travel safely!
14:54
A bunch of robo reviewers accepted an obvious reply as an edit to an answer of mine when I was afk. See here. Any recompense?
Is there a better canon dup of "Why are all my lists changing?" than this?
wim
wim
@MoxieBall locate
@coldspeed you sure?
sure about? I rolled it back.
@coldspeed that the guys are robo
15:00
huh, you'd be surprised by the number of robots on the site... ;)
@AndrasDeak I've installed it successfully. Thanks to you! :-)
@coldspeed oh ok
skynet's plotting something I tell you.
@coldspeed lol
15:34
Look what I got in the post!
The other slips have Python 'code' on them to randomise cube interactions. :-P
@MartijnPieters I like what the other note says!
15:50
Not sure if there's a ucv-pls tag but this question is marked as a duplicate of a question it's not a duplicate of
@MoxieBall done
thanks
the real answer to that question is pretty neat too, so I was annoyed it got closed as "just make your string lowercase"
@piRSquared there's 6 cubes, and 6 notes. The code is pretty awesome! :-)
@MartijnPieters inb4 5 cubes giveaway?
oh great, I've done it again. 40 tabs linking to various pages in the tensorflow docs open now
15:58
@Neoares nope, they are all very useful to me.
Perhaps you can never have too many but when do you have enough?
16:10
@SardarUsama glad to hear that! Without anaconda, I take it?
@MoxieBall yes
@AndrasDeak is that a yes, there's a ?
@MartijnPieters but you only have 2 hands and 2 feet :c
heh, I could have just tried
@MoxieBall it's yes and just follow the link
hint: tags are arbitrary
@Neoares and a tendency to forget where I put things, and a need to have one of these around in about 5 different locations. Add one spare for travel, and 6 is just about perfect.
morning cabbage
@MartijnPieters Congrats :)
16:36
cabbage :)
uh, I'm getting an error I don't quite get
do tell
SyntaxError: 'return' outside function
You can't return from a class
what is your goal?
@MoxieBall oh! silly me.
also please don't post code and errors as images, post them in a pastebin or similar
16:41
get a query set. I just have to wrap in a function is all.
16:58
@AndrasDeak this project is bound to spew up more errors, I'll keep that in mind when I encounter them next.
thanks :)
wim
wim
@MisterGeeky It's almost like the error message is trying to tell you that there is a return outside of a function, and that this is a syntax error.
it could be a trap
@AndrasDeak yes without anaconda, thanks
17:12
OK, no problem :)
@wim It took me an embarrassingly long time to figure it out.
17:46
Well I'm done. Please check it out.
18:14
Serious question: Why does a card game need 7(!) hours of server downtime to unroll a new expansion? What do they have to do other than copy/paste some new files?
@Aran-Fey they have to rewrite the code from scratch since they hardcode all the card stats.
Oh. Well in that case 7 hours is actually pretty short :P
wim
wim
18:36
Martijn is wrong, for once. This is an MCVE, and the OP was/is correct - that decorator simply not working on Python 2.
DSM
DSM
19:08
Okay, I'll buy it. Although for an MCVE it has a syntax error, two typos, and an undefined function for me. :-P
wim
wim
cleaned up the syntax error. the undefined function is not a deal breaker imo.
can not find the typos
true and false I think
wim
wim
oh, but that was the syntax error, no?
hmm, true, something doesn't add up
wim
wim
19:23
it's pretty rare that a 150 rep user has a problem, writes a comprehensible question, and their issue actually turns out to be a bug in Python.
DSM
DSM
@wim: no, syntax error was missing colon. true and false were just NameErrors.
wim
wim
aha. got it.
Are you aware, as a 185k rep user, that you have edit priveleges? :P
are the two typos still there? little help please?
I've just seen a post with so much code the asker just added the rest in the answer section. :|
wim
wim
LOL
Maybe he understood MCVE as Maximal, Complete, and Verbose example
19:39
*Copious?
What should I do with it? Just down-vote/comment and leave or vote to close/flag?
This is the post in question
"Maximal, Complete, and Verbose example" is a win
/wim. Nice redefinition :)
@Simon I've voted to close as unclear. The title implies that it's a Data Science problem, but then the code has things like find_dotenv() load_dotenv(dotenv_path) KAGGLE_USERNAME = which just isn't syntactically correct.
Indeed it implies web scraping (or similar)
It's taken a while but my first ever code submission at google has finally been accepted!
If your hesitancy is over it being a self-answered question with a detailed answer... well I can't see myself ever searching that term
wim
wim
19:55
when the OP accepts the quick fix hack instead of your answer that addresses the root cause of the problem ... :'(
Thanks. It works!! — 최연석 11 hours ago
cabbage all
20:38
Hey, print('Roll Tide') but on a serious note. What does QUOTE_ALL really mean in the import Csv module?
Does it just mean it is gonna take into consideration that all input is a string or something and not worry about the CSV formate since there is no standard?
@user3483203 change 2 to 3 :P
I still don't like that 2 shows up first in all my google searches >:
okay, thank you. And yea considering they are stopping it in 2020 that is annoying
@user3483203 that's why you need to take extra care and click 3 links
wim
wim
21:10
I like the css of the 2 docs better than the 3 docs
21:20
Does anyone know how to get a list of punctuation characters in Haskell, similar to Python's string.punctuation?
21:56
hey guys, in the gensim word2vec documentation, this is an argument into the ctor:
hashfxn : function, optional
            Hash function to use to randomly initialize weights, for increased training reproducibility.
I looked it up and it seems like the default hash function in python varies in behavior across py2/py3.
Is there any reasonable hash function that is cross compat that can be used for general purpose hashing? (nothing heavyweight like sha or md5)
lambda: 4 :P
Are you sure whatever happens after seeding is guaranteed to be the same across the rest of the code on any python version?
@AndrasDeak yes because gensim uses this hash function to generate the np.random.RandomState
also insert xkcd comic
I'm only guessing here but if you want reproducibility you probably do want a specific, named hashing algorithm
Any chance that something in hashlib is fast enough for your taste?
I can find out :) one second, let me try it out.
this sounds like something you're running only once per simulation, so its cost should be negligible compared to whatever your simulation does
which is to say, perhaps you can afford to use md5 or something
22:01
22:22
yup. Speedwise speaking, md5 is honestly fine for what I'm doing right now
But I am also not the end user. I will keep these in mind, thanks guys :) I don't know much about the different hash functions offered.
I don't think your needs are particularly pressing in terms of offered features
How do parentheses around generators work? how does any(isinstance(a, list) for a in [1,2,3]) know that the argument is a generator?
and if that works why doesn't x = isinstance(a, list) for a in [1,2,3]?
when the generator is the only argument in a function call the parentheses are implied
(the latter is not a function call)
is there any particular reason they shouldn't be implied on assignment?
I don't know
perhaps generators with multiple loops can provide an ambiguous counterexample
22:29
nope, I don't think what I just posted was ambiguous
it may just be as simple as "you always need the parentheses unless it's inside a function call because foo((stuff for bar in baz)) looks redundant"
I'd believe & agree with that
but really, I have no idea
the corresponding syntax is discussed here
> if a function call has a single positional argument, it can be a generator expression without extra parentheses, but in all other cases you have to parenthesize it.
it explicitly compares a function call to an assignment, so whatever the reason it's on purpose
good reading, thanks
rbrb for now
rbrb
and bedtime for me soon
22:39
Rhubarb for me too, @MoxieBall @AndrasDeak Rhubarb
23:02
@OlivierMelançon collisions between ants can actually be replaced by treating the ants as non-interacting (the ants can go around one another by stepping aside a bit along the stick), in which case the solution is trivial
23:30
hi, anyone familiar with scrapy?
I'm still a little confused on what link extractors are used for

« first day (2811 days earlier)      last day (2362 days later) »