« first day (3716 days earlier)      last day (1236 days later) » 

12:17 AM
 
Hi all, i have a question related to tox & dependencies, anyone is familiar here?
 
i can't wait to get mugged at 250k (although this time it seems like they dropped the mug so my 100k mug is now a collector's item)
I've heard the cynicism on swag and how it's pointless, but considering we're all here for free anyway I think it's OK to be recognized for our efforts here every now and then
 
12:29 AM
saying I can't wait to be tumbled or bottled doesn't quite has the same ring to it as getting mugged
 
12:43 AM
@Theo I've used tox a tiny bit
 
thanks for your answer! i dont know if it comes from tox my python setup, but when i run tox, i bump into modulenotfound error on the first dependency that is imported, namely tqdm
i have python 3.7 in a conda env, and a conda env for every other versions of python im testing
 
Are you sure tqdm is properly listed as a dependency in your setup.py or pyproject.toml?
 
so it is in the install_requires of my setup.py
tried this only and iit didnt work, then on top of that i added it in requirements.txt with deps=discover in my tox.ini, still nochance
and finally i added all my deps in deps = tqdm .. etc
in my tox.ini, and still no luck
luck being the main thing im relyinig on when testing my packages
 
Hmm. Have you tried (manually) installing your project in a virtualenv? Does it properly install tqdm there?
Wait, even adding deps = tqdm in the tox.ini didn't work? That's super strange
I'm afraid I'm out of my depth here
 
ok so update here
(and thaznks again for your time, super appreciated)
i was doing all that through pycharm
running tox --recreate -e py38 in a separate terminal actually works fine
i guess its linked to pycharm, i will dig on this side
additionally, i ran sometimes in problem in knowing hoow i should call my envlist
in all examples i see with tox they never explain how to install all the python versions needed, and they just put envlist=py27, py37 etc
in the tox.ini
 
12:56 AM
How to install different python versions depends on your OS
 
how do you know how to name those paramaters in envlist? i failed multiple times in conda and the only way was to create an conda env for each python versions, and then i had to put in env list the name of the conda env containing the python version
@Aran-Fey i see. im on mac os x
 
I'm not sure how exactly the envlist works either
 
so many mysteries to be solved
thanks a ton anyway for your kind help
 
1:29 AM
interestingly, github actions has the same problem with my dependencies when they are only in setup.py -> install_requires
 
2:01 AM
hey all if anyone would see any explanation why tox doesnt seem to install whatever is in the install_requires of setup.py, i would be eternally grateful
 
 
3 hours later…
4:41 AM
@inspectorG4dget I's always wondered about the name of the 'fsck' disck-check utility. Anyway, I wouldn't use a string dwearword in code, even stuff intended just for my eyes. 'drat' is about as bad as I'd get.
^ Typos. 'wouldn't use a strong swearword'
 
user13727121
5:41 AM
how to pass in multiple args inside a json settings file?
 
user13727121
"python.linting.pycodestyleArgs": ["--ignore=E303"]
 
user13727121
i can only ignore one thing, I also want to ignore the blank line warning it gives, which is `["--ignore=W292"], but when I put that in, the other one goes unignore
 
it's a question of whether --ignore argument accepts multiple arguments. If so, then something like "--ignore=A123,B456,C789,..." should theoretically work
with comma separated args or the like
 
user13727121
5:57 AM
@cs95 woah, okay, that works, thank you :D
 
heaven praise foresighted developers
 
user13727121
When creating a project in VScode, is it better to use the global Python venv or create a virtual environment and use that instead?
 
Depends. I have a truckload of projects that all depend on each other, so for me it's more convenient to use the system python instead of individual virtualenvs
You should definitely test your code in an isolated venv (at least before a new release), but there's tox for that
 
user13727121
6:14 AM
I see, I don't find it convenient having to switch back and forth to the venv of the project that I want to work on.
 
user13727121
if it's just a small and personal project, then system Python venv will do, right?
 
yeah
 
 
3 hours later…
8:57 AM
Hi @skuzzy
 
Hey @Anusha
 
Thanks a lot for helping with this graph.
 
Glad I could help. No problems.
 
@skuzzy Can you tell me which sns.style or color scheme you are using
Also, if you could edit the solution to add palette that works.
I have been trying and it gives that error ValueError: min() arg is an empty sequence
 
I usually go with the ggplot2 scheme. Or fivethirtyeight scheme if I have to present in a business-type presentation.
 
9:00 AM
@skuzzy Are you able to run this with adding palette argument?
 
I have not tried. Maybe you can share what you have tried, and I can see if I have a resolution.
 
I am simply adding palette argument to what you gave. I think I understand what is happening. I want three colors for the stacks or 4 categories in the tips example. Palette that I am specifying is discrete but it now requires continous color palette.
 
Is it resolved then?
 
Not yet, it needs a continous palette now but I want only three colors or discrete colors as before.
It is working if I add a continous color palette but not a discrete one!
 
Hmm, interesting. Does it throw an error?
 
9:08 AM
I only want three colors for the stacks though. alueError: min() arg is an empty sequence
ValueError: min() arg is an empty sequence
Try with palette = 'tab10'
Interesting, it is working in the example case I gave but not in the actual data that I am plotting.
Any clue on how to resolve this
Just to clarify, my actual graph works with palette = 'rocket' but not with 'tab10'. It was working perfectly with three colors before I changed the tick marks.
 
It works for me for both your questions. If you run the examples from my answer, and provide your palette argument, does it throw an error?
 
No.
 
That is weird, because it works for me all maps.
 
I have to filter ManyToMany models field in Django admin. I need to get current model instance in init function, but I don't know how I can do that?
 
Yeah, let me run all the files afresh and check if some quirk happened. I will post here in case need help. Thanks again.
 
9:19 AM
@Anusha
 
@skuzzy Yeah I am getting these graphs too. When I implement is for my actual data, it is working till I add the palette argument.
And it was working with palette of three colors until I wanted to have the tick marks labelled and centered.
 
It should work, the error is elsewhere. The error you posted signifies that you are calling min() on an iterable of length 0. Can you post the traceback?
 
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-341-62bb43b0312a> in <module>
5 bin_width = val_width/n_bins
6
----> 7 sns.displot(x='R',
8 hue='Strategy', multiple = 'stack', data=payoff, hue_order = color_dict_strategy,
9 bins=n_bins, binrange=(min_val, max_val), palette=color_dict_strategy)

~\anaconda3\lib\site-packages\seaborn\distributions.py in displot(data, x, y, hue, row, col, weights, kind, rug, rug_kws, log_scale, legend, palette,
 
Right, the error is in how the histograms are being calculated. Not the plotting itself. 1. Are you sure that the exact same code without just the palette argument works?
2. Could you try replacing displot with histplot?
 
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-353-18700b3f6ecb> in <module>
5 bin_width = val_width/n_bins
6
----> 7 sns.histplot(x='R',
8 hue='Strategy', multiple = 'stack', data=payoff, hue_order = color_dict_strategy,
9 bins=n_bins, binrange=(min_val, max_val), palette=color_dict_strategy)

~\anaconda3\lib\site-packages\seaborn\distributions.py in histplot(data, x, y, hue, weights, stat, bins, binwidth, binrange, discrete, cumulative, co
Yes, it was working perfectly with plotting with palette.
Thats why it is working if I add palette of continous colors but not discrete colors.
Somehow the binning has changed the calculations and is not working with same groupings as before
Even now, the code works with palette = 'rocket' which is a continous palette but it is not the color scheme I want.
 
9:38 AM
I understand, you might have to recalculate your color dicts.
 
Any workaround the binning or tick labels?
Can't have both, is it?
or making continous palette act like a discrete one with very less gradation of colors, so that it is giving the three distinct colors I want to see.
Anything to make the trend in 3 stacks visible would be enough.
 
Of course you can have both. Binning is the distribution mapping, while ticks are plot artefacts. You can have arbitrary ticks. They are independent. We make them work together for the plot.
 
I don't know how. Thats why the question posted.
 
In three stacks? The example has 4, if you can share some sample data, I can check. There are color maps with less gradation.
You can find many here (see if any suits your case): https://seaborn.pydata.org/tutorial/color_palettes.html
The question only goes so far with the sample data, which I would say is pretty much solved.
However, it seems to me that there is much else going on with the data that you are trying to apply this to.
 
3 or 4 doesnt matter. It is a fixed number. I am also using hue order to have the same order applied to all graphs.
Is it possible that some bins get zero counts with changed binning and thus throw an error
With continous palette like mako for example it is possible to specify gradation colors in each stack?
 
9:49 AM
@Anusha Yes, indeed. That is the obvious implication of the single value histplot.
 
With continous palette like mako for example it is possible to specify gradation colors in each stack?
Can you just help with this part? I haven't been able to find a solution for this.
I have been trying to make the solution you gave work for my data with this workaround. Have a submission in couple of hours.
 
@Anusha I don't know readily about explicit selection of colors, but seaborn will usually automatically choose the appropriate number of discrete colors from the continuous map. You can see this in the rocket graph in my answer.
@Anusha If you can share a sample of your data, I can try to see what could be going wrong here.
 
@skuzzy Yeah, I thought so. Will have to figure out what to do then. I will let you know by sending a message here. Have to complete other parts before coming back to this. Thanks for helping out today. W
 
Good luck.
 
I will wait for some time in case someone has another approach. Otherwise will accept your answer.
@skuzzy what settings did you use to get the green graph?
 
10:00 AM
I don't think one will be able to solve your problem any further by the details of just that question.
@Anusha It's in the answer - "Paired"
 
 
1 hour later…
11:28 AM
Anyone following the pandas tag here besides me? It looks like folks these days are more mindful about taking out the trash and closing duplicates than oh... 6, even 12 months ago. That makes me happy.
 
 
1 hour later…
12:51 PM
@cs95 I am, hard to tell, we're still getting deluged with newbie ML gimme-teh-codez stuff.
Here's a good one from just now, I thought it would have been asked and answered before but if it has I can't find it: How to get a new column with sum of even/odd/kth rows? ...
...(which reminds me, increasingly now we're getting questions too reliant on details esp. now that users post dataframes without a verbal description of what the data is and what they're doing, or images of dataframes)
 
1:29 PM
recbg
 
1:54 PM
-360 22:38 removed User was removed (learn more)
NOOOO
-10 22:38 removed User was removed (learn more)
who wasit :D
 
It was a sock puppet named Hantti Aapala. Nobody knows who the master account was.
 
user13727121
how do i remove a Python venv I just created, i can't seem to locate the folder, all it gives me is .\myprojectname\Scripts\python.exe
 
user13727121
in vscode*
 
@CoreViSional you can edit/delete chat messages for 2 minutes
 
user13727121
2:11 PM
sorry, yes I know that, I realized that I didn't mention which IDE I'm referring to, so I quickly just typed it in :|
 
If you can run a script in that venv, just print out sys.executable
 
@AndrasDeak Anti Happala, Pro Nan
 
2:39 PM
NaN?
 
user13727121
3:22 PM
@Aran-Fey I appreciate the reply, but I just found out that vscode will remove it from the list whenever I exit vscode, if I had the file deleted of course
 
3:33 PM
@holdenweb Metaphorically. I just wanted to mention the Dropkick Murphys' song
 
3:48 PM
Streaming Advent of Code day 18! twitch.tv/davidism
 
4:08 PM
@smci Not familiar with that.
 
4:26 PM
@holdenweb The Celtic punk song used in 'The Departed', the Sam Adams ad, etc...
 
hey everyone
 
user13727121
5:04 PM
what's this undefined name flake8(F821) error in vscode? When I try to print(sqrt(25)), it displays that error, but it works in Pycharm and not vscode. I've also use import math but it says it is unused...
 
@CoreViSional you need to import math, then call print(math.sqrt(25))
 
user13727121
@MattDMo i just did, it works :D I was just trying a bunch of things
 
You're welcome. Just remember, in Python, generally if you import a package, you need to use that package's name when calling/accessing any of its methods/attributes.
 
user13727121
I figured if I just put math.sqrt, maybe it will work, and it did. But from math import * gives me an error
 
If you do from package import *, then all of that package's members are imported into the current namespace, so you don't need to access them using the package. method, you can just call/access them directly.
So, for example, if you do from math import *, you can directly call sqrt(25).
 
user13727121
5:16 PM
@MattDMo i did, but vscode raise an error when i wrote it that way, this is the error 'from math import *' used; unable to detect undefined namesflake8(F403) even though I've already use print(sqrt(25))
 
Was this in a new session?
 
user13727121
yes, I just created it to test out some stuff
 
Wow, flake8 really doesn't know what attributes the math module has?
 
I don't use VSCode (I'm a Sublime Text guy), so I can't try it out myself...
 
user13727121
even though i've use from math import *, it raises errors for other math functions too if i try to directly call it, for instance, when i try to do ceil(-2.1), it raises an error saying 'ceil' may be undefined, or defined from star imports: mathflake8(F405)`
 
user13727121
5:25 PM
nvm, it works now, had to tell flake8 to ignore those errors
 
@CoreViSional Did you do that import inside a method? from xyz import * is only allowed at module scope. Other thoughts - this code isn't in a math.py source file is it? Or do you have a math.py somewhere in your Python path? This will supplant the math module from the stdlib.
Job hunting update - I was allowed to retake my failed hackerrank coding test, followed by a 7-1/2 onsite-interview-over-zoom, which included 2 more coding tests and 2 "find the bug in this broken system" tests. I finally wore them down and they just gave up and gave me the job. Start Jan 4.
14
Irony #1 - the coding test I failed was to write a simple arithmetic parser! I guess I'm just lost without my pyparsing. Irony #2 - one of the coding problems was to implement a simple keyword search algorithm (find and index keywords in job descriptions). I just wrote this 2 weeks before when I added this feature to littletable!
 
user13727121
5:46 PM
@PaulMcG no, i didn't create a math.py file for that. I defined it at the top level of the program, but I just read about the error and the flake8 rules. flake8rules.com/rules/F403.html
 
6:26 PM
I have a super weird error here with JSON
I am using the jsonschema library, but actually I don't think that's the issue
json.decoder.JSONDecodeError is throwing an error when I pass a certain JSON object
If I type this:

{
"io_domain": ""
}

the decoder throws the error
but if I type any variant of this, such as

{
"iodo_main": ""
}

it does not throw the error
is this a bug in the decoder?
 
gimme a sec here
 
user13727121
how do i continue adding args here? "python.linting.flake8Args": ["--ignore= E303, W292"],, i want to add --max-line-length 100
 
# Define a validator.
validator = jsonschema.Draft7Validator(schema_pass)

# Define the errors list.
errors = validator.iter_errors({'io_domain': ''})
the schema is just a schema that I pass
I think the error may be in the package itself to be honest
 
Without knowing the value of schema_pass that's really not an MCVE
 
6:35 PM
@rdevn00b "the decoder throws an error" is vastly inferior to "and this is the error I got <followed by actual error>"
I've used jsonschema before, and it is very easy to get wrong. I would scrutinize the schema for errors before jumping to "probably a bug in the package".
 
the schema is IEEE-issued
I haven't had issues with this package previously
including using this schema
notice that the schema is a downstream error
 
Too much code - please use a paste service.
 
the schema doesn't matter because the decoder is what is throwing the error
 
as I said, the schema validator works with the strings containing an underscore, such as "iodo_main", "iodoma_in" and so on. But specifically the string "io_domain" throws an error
and the error thrown isn't schema incompliance, it's decoder incompliance
@PaulMcG There are actually 59 open errors for this package. You should look at them.
 
6:41 PM
alright, I don't know nearly enough about json schemas and references to figure this out
 
Hi @rdevn00b. As suggested by others, please ensure that you read our room rules in relation to posting code into chat; specifically in relation to posting off-site if the code is lengthy. For smaller snippets, please see our formatting guide for chat
Additionally, linking to a github issue page is not helpful in people being able to track down the problem. If you think it's related to a specific issue on that project's issue list, then you should pinpoint it. 59 open issues is tiny if you were to compare to something like Pandas
 
The point is that I was told that I shouldn't blame the package, the implication being that the package couldn't possibly be to blame. I merely provided evidence that this is not a legitimate viewpoint.
 
user13727121
nvm, figured out how to add in multiple args now
 
Well, I also feel that there is something else going on that isn't supported by the code you've posted. It could be something weird like stray whitespace that causes the issue, and you changing the name is, by chance, fixing that hidden issue. We don't know but it's also not something we can easily help with
 
there isn't any whitespace???
I hear you though
I think it's the package
 
7:10 PM
Ok then, this seems to be a pretty tolerant schema (maybe post a link to where it came from, if not behind a paywall), that it will accept keys that are not defined in the schema, but it may have some specific expectations for the key "io_domain", such that an empty string is not a permitted value, so maybe search the schema for defn of "io_domain". When posting the error, the full traceback is usually in excess of what we would like to see here, but the error message itself may be insightful.
 
@PaulMcG Yea I'm looking now
 
7:30 PM
Hi, has someone worked with django-cors-headers yet?
 
Hi, I have a dll file and I want it to import using the codes bellow.
'
import uuid
import sys
import clr
import os
from pathlib import Path

sys.path.append(os.path.dirname(__file__))
clr.AddReference('dllname')
'
I read most of the related questions but still have the following error:
'
System.IO.FileNotFoundException: Unable to find assembly 'dllname'.
at Python.Runtime.CLRModule.AddReference(String name)
'
 
7:45 PM
Try using the full path to the dll?
 
@Aran-Fey did, had the same issue
 
Whew, sure wasn't easy to dig up that thing's documentation
And it wasn't even worth it, because that code looks like it should work
 
8:28 PM
@MattDMo You should also be aware that from module import * is considered very bad practice in production code (which is why flake8 complains it can't find functions imported that way).
 
Absolutely. I was going to say something to them about it, but I think the conversation moved on.
 
@PaulMcG Congrats!
@MattDMo It always bears repeating.
 
It certainly does. I've never been tempted to do it, but I understand why others are.
 
8:48 PM
@PaulMcG great news, congratulations!
 
Indeed. Sorry PaulMcG, I hadn't yet gone through the transcript. That's great news; congratulations :)
 
9:51 PM
@Aran-Fey solved my issue by upgrading python to 64-bit version. version of dll was 64 bit and my python was 32 bit, not compatible. I do not know why I have previously install 32b on my 64b system!
 
10:45 PM
Hi guys, I made a class Tasks() and then i instantiated it twice, and then appended two instances two list, is there anyway that i can just get the instance? so its like [<lstbox.Tasks object .!tasks>, <lstbox.Tasks object .!tasks2>] is there anyway to get just .!tasks1 and .!tasks2 ?(other than indexing :p)
 
Let me guess, these are tkinter widgets?
Anyway, .!tasks2 is not an instance. That's most likely the name of an instance. I'm pretty sure indexing is exactly what you need.
 
Maybe your problem is more __repr__ related
 
@Aran-Fey Hahah yes
 
Yeah, .!tasks2 is the name tkinter assigned to your widget (i.e. it's a string). It's not the widget itself.
 
@Aran-Fey The problem was that, sometimes is .!task> and .!task2> so indexing might be simple?
 
10:51 PM
Do you want to get a widget or the name of a widget?
 
Just to clear confusion, what are the difference between both?
 
the_list[0] will give you a widget. I think widget.winfo_name() gives you the name of the widget
A widget is a Button or a Label or a Tk etc. instance. The name of a widget is a string.
I don't think there's ever a reason to access a widget's name tbh
 
@Aran-Fey Yep, winfo_name() did what I wanted. How are you so familiar with all the methods of widgets?
@Aran-Fey But here it was what i looked after. Basically according to mouse movement I wanted to know to which widget it was over at.
 
I'm not, I just googled it
 
:p Wonder why I couldnt find it
 
10:58 PM
Hi guys , hope everyone is good, enjoy your weekend in advance
Some help in Django
 
@LutaayaHuzaifahIdris You too ;)
 
I would appreciate it
 
Hi @LutaayaHuzaifahIdris . Please see our room rules in regards to asking questions posted on main. You should wait at least 48 hours before posting here, if you haven't already got an answer
 
@CoolCloud I don't know what you want to do with the widget after you find out where the cursor is, but 99.99% of the time working with the widget instance is much more useful/convenient than working with its name. Anyway, is your problem solved now?
 
Oooh apologies, the answer was justed posted @roganjosh. Let me wait.

Thanks
 
11:03 PM
No worries :) Hopefully your question is already solved :)
 
@Aran-Fey Yeah here it might be what I wanted but thanks a ton for that method!
@LutaayaHuzaifahIdris You mean question ?
 
I mean the answer @CoolCloud
 
@CoolCloud No, they mean that the question that I just removed just got an answer posted very recently
Hence the room policy; to help try stop duplication of effort
 
Ooh, I thought why would they post an question which already got an answer, my bad.
 
11:36 PM
I've gone from one of the most manic weeks in a decade for me, to a tame existence. It feels... odd. I can't go to the pub so I feel like I should be breaking something to end the anti-climax :D
 

« first day (3716 days earlier)      last day (1236 days later) »