« first day (2527 days earlier)      last day (2437 days later) » 

2:38 AM
recbg
 
3:05 AM
OverflowError: integer division result too large for a float
How can I avoid that?
I mean, there is a way to round by the max amount of decimals allowed by float?
 
What is the max allowed decimals allowed for float?
I have a feeling python has a "exact numbers without or with specified precision" thing somewhere
Can using integer division/mod work for you? ie // instead of /?
Btw, I love the readibility of the f'abc{}ced{}' string formatting I just discovered.
 
 
4 hours later…
7:23 AM
cbg
I was gone too long, nothing starred on the star board.
 
7:36 AM
@EnderLook "round to max amount of decimals"
no, this means that the result is 100000000000000000000
when the maximum number representable by float is 42
so one possible result would be that instead of exception, you would get 42, not 100000000000000000000.
Of course, what you want is the integer division
 
8:33 AM
It definitely may have been stated before, but the author sure did one hell of a good job naming their tutorials "Learn Python the hard way".
They got that right at the very least.
 
A good idea I have never known before! However, I have to change the first line of inner/b/b.py with from inner.a.a import A to run inner.py. Is it the only way to specify the tool name at the very beginning? — Ben Lee 24 mins ago
we'd really need ...
@AshishNitinPatil it is "Learn Python 3 the Hard Way" :D
 
Hah, well, they don't do that great a job with py2 as well.
 
actually it is really good: It is "take the 'scenic route' via the garbage dumps and industrial areas of Python 2 to learn Python 3 in a way that's harder than necessary, and also learn how to question 'authority'"
sigh
 
Well, the OP doesn't seem to know the difference. Unfortunately, we don't have all the time in the world to educate everyone likewise.
 
"question authority other than me, maggot"
cbg
 
8:42 AM
cbg
@Kevin Windows?!
 
9:24 AM
As always
 
10:15 AM
5th gold, Populist :D
 
10:54 AM
hi @AnttiHaapala, @MartijnPieters, @AaronHall, @PeterVaro, @thefourtheye a long time since I was not here
 
@XavierCombelle hi; "since I was here (the last time)"...
I just asked a Java question
 
does codeacademy an ok resource for learning python ?
 
no
passable
still python 2.
did you read the blog post? :D
 
 
2 hours later…
1:29 PM
I was wondering what month it is...
but of course the answer is...
Sat Sep 8782 16:30:06 EEST 1993
 
wait, wat? (PS: cbg)
 
@ByteCommander today is 8782nd day of the September 1993.
 
I see that, but still wat.
 
and the quality of stack overflow questions confirm it.
 
Where did you get that output from?
 
1:32 PM
it's standard Finnish time
 
@ByteCommander sdate
 
@AnttiHaapala you are right my poor wording is due to bad translation from french
 
so what you've been up to :D
In any case the strip doesn't make sense there so you should still remove it... — Antti Haapala 27 secs ago
 
1:57 PM
stripception
 
pprint(model.strip())
 
removed it got this error TypeError: normalisePaper() missing 1 required positional argument: 'n' – Jane 17 mins ago
OMGLOL...
 
@AnttiHaapala yes I read the blog post
 
@XavierCombelle :D
no, codeacademy is not a good resource.
 
@AnttiHaapala it was referenced in the stared question
 
2:10 PM
reminds me of this
 
"I know that I can use replace function in python to remove one time, but how can I remove the second time? I mean s = "shshitit" will become s = "shit" and I need to remove that too. So how can I do that?"
should I add that "do not use the .replace again"
 
 
2 hours later…
4:27 PM
I have a pandas dataframe, df, in which one of its columns, Time, is of type datetime64[ns].
I'd like to filter df to get only one specific month, say February.
I'm looking for something df[df["Time"].month == 2], but can't find anything that works.
What's a quick way of doing this?
 
4:43 PM
Nevermind.
 
5:21 PM
There are two possible readings to your question. The answer to one is yes which is too short to post as an answer. The other reading results in closure with too broad. — Antti Haapala 25 secs ago
 
*groan* convincing sphinx to output proper documentation is hard
 
> python or r(java eventually)
sigh, people still think that for some reason java would be needed to speed up the scraper
 
if I use autodoc, it fills the Index page with literally every single method of every single class. who the yam thought that's a good idea? And without autodoc, well, I'm probably gonna spend an hour configuring sphinx to document every single file and class in my package
isn't there something that generates a minimal index page with two links: classes and submodules?!
 
6:15 PM
Hey!
Which would you recommend between Pandas series.`resample` and `reindex`?
and asfreq
 
6:50 PM
Well, that could be part of the problem. I'd have thunk that you knew you're coding in C#, yet you tagged this in C. — Antti Haapala 12 secs ago
 
7:02 PM
bad on bad on bad...
today's stack overflow
downvote downvote downvote
 
this question's title was a good summary of SO today:
-2
Q: Struggling with basic python code

Proxi HennI need to implement a program that requests a positive integer n from the user and prints the first four multiples of n. n = eval(input('The number: ')) after this im not sure what to use. Do i need to use the for i in range() or for loop? I also need to implement a program that requests an i...

 
I am not understanding how you think this contradictory information is going to help to solve this problem?! 0x1 is in the zero page and surely it isn't executable, so the instruction that caused the crash cannot be pop ecx. — Antti Haapala 7 secs ago
C fun ...
 
7:27 PM
Weekend cabbage
I just lost my first two rated chess games are my first ever rated tournament.
 
7:43 PM
Weekend cabbage indeed
Am I using yield correctly/well here?
def adder(added):
    for i in range(1, 11):
        yield i+added


def multi(num, mult):
    for firsttotal in adder(num):
        print(firsttotal*mult)

multi(7, 3)
 
It's not the most useful function in the world, but it's a valid use of yield
 
@Rawing MCVE, right? :) thankyou
 
It might be better to just trash this code and start over. Your question doesn't make any sense at all. — Antti Haapala 6 secs ago
I don't say that very often, but, seriously?!
 
8:00 PM
@AnttiHaapala it looked like it was producing hex values as text, but I don't know where it would have been doing that...
 
it's the ord(char)*key thing. he's multiplying the character value into the unprintable range.
 
@Rawing ah, right. Next.
 
the most common C math question: stackoverflow.com/questions/46257089/…
as evidenced by the number of duplicates I put there...
 
makes you wonder if there's a limit to how many dupe targets you can add
 
no, it's that 5.
otherwise I would have added more
and I surely downvoted that questoin
because you just need to google for "error pow c"
 
8:10 PM
o/
 
So is it better/correct to use for something in some_statement_that_yields_values or the next() function?
 
So what does this have to do with python and numpy? — Antti Haapala 30 secs ago
@toonarmycaptain yes.
 
that depends. for x in y: break is worse than next(y). And while True: x = next(y) is worse than for x in y.
 
@toonarmycaptain sorry my joke didn't work there :D
>>> x or y
True
 
@Rawing So depending on what you're doing with it?
 
8:14 PM
yup. most of the time you'll be using it in a loop though.
 
@AnttiHaapala I got what you were trying to do, :p
 
@toonarmycaptain the key here is to be able to imagine how it would look if you used the other..
 
Fair enough. And I'm sure I'll look at it differently after I've played with itertools and more_itertools anyway. Just trying to get a grasp on some things (like yield) that I've seen but not had to use yet
 
@toonarmycaptain being a beginner myself, I found the accepted answer on this post very insightful stackoverflow.com/questions/231767/… (in case you haven't seen it yet)
 
Don't forget about even-more-itertools!
 
8:21 PM
bookmarking... ^ hoping that I will one day get back to it
 
@Rawing thankyou for pointing out that the amount that I need to learn is even more overwhelming than I already stated :p
 
disclaimer: I've never used that module, so I can't vouch for its usefulness. I just found its very existence (and name) hilarious.
 
Hmmm....so if I write a module wow-even-more-more-itertools and put ads on the "documentation page" ...
...I would be everything that is wrong with the internet!
 
wim
for when regular itertools is just not making your code unpythonic enough
 
@wim ...quoi?
rhubarb all :)
 
9:05 PM
wim hates itertools
 
9:28 PM
hey would anyone be up for helping me walk through some python package management issues? been stuck for a few weeks now
 
9:40 PM
Huh. I A student of ours found a pretty huge bug in sympy. I spent hours tracking it down, I also made sure to install the newest stable version. Now that I know what's wrong (and had the beginning of an idea of how to fix it), I cloned the sympy repos and turns out the bug is already fixed there :|
5
I did learn a few things along the way (most important among these is that looking at the newest stable version is insufficient), but I'm somewhat frustrated
at least I know I was right about the source of the bug, and my general idea for fixing it was correct too
 
I'm having issues with ModuleNotFoundError. I run Python 3 and when running my application runs without any problems. However, when I put it inside a docker container and run it I get ModuleNotFoundError: No module named 'src'.
My file structure is
.
src
|-- app.py
|-- other.py
inside app.py I do from src import other
I've verified that it's Python3 that is running inside the docker container
Any ideas?
 

« first day (2527 days earlier)      last day (2437 days later) »