« first day (3578 days earlier)      last day (1353 days later) » 

3:16 AM
Concerning skimage: If you use io.imsave(), what do you call next? How do you put the file in the desire directory then?
 
 
3 hours later…
6:14 AM
cbg :)
currently I do python3.8 or pip3.8 for python and pip, will it cause problems if I alias them to python and pip, I have two system pythons already (2 and 3)
% python --version
Python 2.7.15
% python2 --version
Python 2.7.15
% python3 --version
Python 3.7.3
% python3.8 --version
Python 3.8.5
this is how it is right now
previously I have used anaconda for python and that would just let me use python for the anaconda python, my linux knowledge was not enough to understand what exactly happened
 
 
2 hours later…
8:12 AM
Hey guys is there a way to check what variables are set in the flask env? I
I am busy trying to figure why an env variable with an API key won't set.
 
 
2 hours later…
9:45 AM
@python_learner I'm always unsure about that. You can use a virtualenv that would automatically alias python and pip for its own.
@JohnnyApplesauce set the full path complete with directory when calling imsave?
 
I've been trying to make something like this in pandas for a while but I can't seem to figure out how to perform math operations with multiple criteria in pandas
 
@Pherdindy you probably need groupby. I don't know pandas well enough for this.
 
may be pivot_table will help you if you put index as Person, column as Type. then the subtraction becomes easier
 
The thing with pivot_table is that it makes the data points into columns
 
@Pherdindy then perhaps your original df is better
 
9:49 AM
Will check into groupby and pivot_table again
Simple boolean indexing doesn't seem to cut it
I tried looking into groupby initially and I don't know if I can use it
Since it will group by Person for instance but I am not sure how to do math operations between the Type column
The "data smell" I had was due to pivot table turning data points into columns so when the category wasn't in the data the mask would fail
Unless I code it somewhere to pre-check the condition but was thinking if there was a better and more efficient way to do it
 
@Pherdindy side note: if your values are signed you have to sum your numbers, not subtract them...
 
Right I thought I edited the photograph
It didnt seem to update lol
 
Do you always have one "expense" and one "revenue"?
 
Yup for each Person I believe it's only 1 "expense" and "revenue"
 
So in your original df you had rows for each Person, and you had Expense and Revenue as columns?
 
10:01 AM
Expense and Revenue were under 1 column
In the data I had
 
So there were multiple rows per person already before pivot_table?
Seems like you need something like stackoverflow.com/questions/22127569/… to get one row per Person
 
Yeah there were multiple rows per person
This is the real data
Order Number was the Person equivalent
It seems like there is more than one Expense and Revenue per person rather
 
@Pherdindy your real data has more than just one expense and one revenue
@Pherdindy yes. I don't know pandas well enough and you are making it very hard to help you. Good luck.
 
Sorry bout that but yea gotta group them before performing the operation
 
10:12 AM
shippingNames  = ['Shipping Fee (Paid By Customer)', 'Shipping Fee Paid by Seller']
df_shipping = df[df['Fee Name'].isin(shippingNames)]
df_shipping = df_shipping.groupby(['Order No.', 'Fee Name'])['Amount'].sum().to_frame().reset_index()
I actually grouped that frame already so yeah it's only one expense and one revenue in this point. Referenced the wrong frame (which was the original)
Anyway gonna look around in SO more can't seem to find it
 
 
2 hours later…
11:53 AM
@Pherdindy By "real" data is this proprietary data you shouldn't be permanently posting to the internet? (just checking)
fyi - your first picture is a pivot table & yes, you typically clean your data (ensuring needed data points are in data would be part of this) before pivoting it
also: morning (or good localtime) all :)
 
12:48 PM
@LinkBerest No the data I posted is fine to share didn't really give too much info for it
@LinkBerest yeah perhaps a pivot table will do and i'll just create some checks to ensure the mask doesn't error
 
 
1 hour later…
1:58 PM
Does someone know how to make a true copy of a function? I've managed feeding types.FunctionType with code (copied, since constant), globals (a dict, trivial), name (a string, trivial) and argdefs, but I cannot properly clone __closure__ – I fail top copy/create a cell to decouple it from the original closure.
I've pondered creating a throwaway function with a single closure cell and just throw away everything but the cell. Seems a tad excessive...
 
2:17 PM
@AndrasDeak I guess that will do it for me then, thanks
 
user13036845
2:47 PM
Hey guys! I am learning pygame and having a little difficulties in writing codes myself. Can anyone tell me how can I write my own games?
 
@BruceBanner that sounds like an incredibly broad question
Have you learned python fundamentals first?
 
user13036845
@AndrasDeak I'll try my best again
 
user13036845
@AndrasDeak Yes, I have
 
OK, that's a good start :)
 
user13036845
The difficulty I'm facing is in the while loops. I don't know the content that I should put in those loops. Can they be used only for character's or sprite's movements?
 
3:14 PM
@BruceBanner you can put anything in a while loop, see e.g. docs.python.org/3/tutorial/…
@BruceBanner have you read most of a decent tutorial?
That's what I meant by fundamentals
 
 
3 hours later…
6:28 PM
Hey all, curious if anyone has an opinion on the usage of expanding dict.keys() or just dict into a list, seeing as it's only a syntax difference, ie [*d] == [*d.keys()] => True
 
please just use list(d).
if you want to clarify they are keys, use keys = list(d).
 
yup
 
Well, I can at least say performance shouldn't be part of the debate:
from timeit import timeit
d = dict.fromkeys(range(10_000), None)
timeit('l = list(d)', number=10_000, globals=globals())
# 0.450119815999642
timeit('l = [*d]', number=10_000, globals=globals())
# 0.44900086600000577
timeit('l = [*d.keys()]', number=10_000, globals=globals())
# 0.4483546579999711
 
7:30 PM
dpaste.org/w9yA Hi can someone fix that line so that I can call init method of forms.Form?
__ init __
 
Uh, so, what's the json_input method supposed to be doing?
 
Without diving into exactly what you're trying to do, if you remove the @classmethod decorator, change cls to self (since it's no longer a classmethod) and then instead call setattr(self.__class__, f"question{question_number}", ...) you'll fix the immediate problem
Whether or not that's the best solution for what you're trying to do is a different question though
 
Changing class attributes at runtime seems questionable at best
 
Definitely, unless this is part of building the class itself in a factory, but the naming suggests it might be happening mid-run after a response of some sort
 
7:47 PM
Vishesh has struggled before with using help he got here, so if the code is fishy it's probably a mistake rather than something elaborate.
(I'm adding this as context because if Aran or Miyagi do something fishy it's usually on purpose)
 
insert something about knowing the rules well enough to break them appropriately
 
no it's ok, it was rather simple, I had to google many terms but finally got cls() and blocking init wasn't needed.
 
8:26 PM
@Aran-Fey Doesn't sound so crazy if it's a form dependent on configured features. I did it for a FlaskForm for that purpose.
 
8:41 PM
@toonarmycaptain except that this was also part of the reason that I moved away from FlaskForms
 
9:29 PM
 

« first day (3578 days earlier)      last day (1353 days later) »