« first day (3540 days earlier)      last day (1401 days later) » 
00:00 - 22:0022:00 - 00:00

12:02 AM
@AndrasDeak correct, Windows API needs LongLong for 64 (has to do more with the C compiler than python but with numpy that doesn't make it easier)
 
 
7 hours later…
7:22 AM
It doesn't matter how aware I am of the issue, or how many hours I've wasted over it, I'm positive that I'll get bitten by it again. That PR looks promising
 
8:08 AM
recbg
 
8:28 AM
Whats the correct way using typing to hint a func as an arg which takes an object param? myfunc: Callable[[MyCustomClass], None] doesn't seem to work
 
An object, as in myfunc: Callable[[object], None]?
 
Yea, but can I be more specific than object?
 
Sure, but then myfunc: Callable[[MyCustomClass], None] should be correct
 
ahh, you know what. Event is the class, and its in the event module. I was specifying the module, not the class
my bad
Ok, one more then. I'm storing some callback functions in a dict, when I come to execute them like this func(arg) it works fine, but the IDE flags it as unexpected arg. Is there a way to make it expected, and not flag in the IDE?
 
cbg, I am trying to filter a list based on two conditions, the elements in a list should not being with certain elements in a different list and should not end with certain elements from a different list, this is what I have now, my actual list sizes are more, is there a pythonic way or any faster way?
not_begin_with=['sys','host']
not_end_with=['py','pyc','pyw']

file_names=['sysTEM.sys','allowed_file.txt','not_allowed.py','host.pyw']

allowed_files=[]

for file_name in file_names:
    if not sum(1 for begin_check in not_begin_with if file_name.startswith(begin_check)) and \
    not sum(1 for end_check in not_end_with if file_name.endswith(end_check)):
        allowed_files.append(file_name)


print(allowed_files) # ['allowed_file.txt']
 
8:44 AM
not_begin_with = ('sys','host')
not_end_with = ('py','pyc','pyw')

for file_name in file_names:
    if (not file_name.startswith(not_begin_with)
       and not file_name.endswith(not_end_with)):
        allowed_files.append(file_name)
 
one can pass the whole tuple as a startswith argument?
lol I did not know this
thank you for that, i feel dumb lol
 
whoa, I did not know that as well. So handy.
 
@shad0w_wa1k3r if I recall correctly it's one of the weird places where a stdlib method accepts a tuple but not a list
 
eh, fine by me though since most usage has known prefix or suffix. It simplifies my code in quite a few places.
 
any reason why it does so?
TypeError: startswith first arg must be str or a tuple of str, not list tried with a list
 
8:49 AM
@python_learner see what I just said ^
 
"one of the weird places..... not a list"? I am sorry I think I am missing something trivial if that is the explanation
 
It's not an explanation, just known behaviour.
 
if its just weird then I guess the devs know it better
 
it is weird, and odds are there's a bug report/feature request with it and someone said "meh"
it came up here a few times
 
i better stick to tuples then, never know when i will run into other methods like this
i knew startswith existed so i didnt check the docs to see it accepts a tuple as an arg, this is what happens if you are not 100% clear
 
8:53 AM
Guido used to say that tuples are for heterogeneous data, lists are for homogeneous data. But in this case this would exactly mean that lists are better than tuples.
 
Something vaguely mentioning tuples when it was requested
 
i just use list everywhere, i dont use tuples other than when I am using a dict or set
 
@python_learner that's fine
you normally only have to use tuples when you need something hashable
 
I find [*map()] easier than doing tuple(map())
 
@python_learner list(map())? *map(),?
I'd stick to the more explicit syntax though, for readability
and if you're only unpacking a map into a list, consider using a list comprehension instead
 
8:57 AM
in terms of typing effort not that one converts to list and the other does to tuple, my usecases dont really have a need for that (tuple / list)
 
typing effort is not a primary concern unless you're playing code golf
 
yeah I have seen a few of them and I can't wrap my head around half of them
 
This answer makes me wonder how Dexter funded his huge underground lab. I'm starting to think that my childhood cartoons gave me unrealistic expectations of life
 
9:37 AM
stackoverflow.com/q/62570334/4799172 opinion-based. I've drafted and deleted two answers; both are just full of anecdotes about how bad the premise is rather than addressing the code itself. I don't think there's an angle to be useful and objective at the same time
 
if my python expertise is not at a huge level how can I answer new questions?
i try to answer some but soon get marked as dupe by the time I figure one out
 
9:50 AM
When they are marked as dupes, do you understand why it happened, if you follow the dupe link?
It's pretty rough to find decent new questions that are also accessible for learners
 
1) become proficient at finding low hanging fruits and answer them quickly. in the past, the pandas tag was a popular choice for that. it's generally not regarded as very nice because it adds very little value to the site and a fair bit of noise, but at least OP will be happy about any help, or 2) heavily filter your question stream with libraries or frameworks that you are familiar with and only answer those.
if they are even a bit specific, you will have more time before someone else answers them, and if OP knows how to properly tag their questions, the overall question quality is usually a lot higher as well.
 
I have been coding only in python for almost a year but I try to limit my search to stdlib questions guess I will have to follow point 1 and be fast at typing
 
can I ask pandas question in here?
 
you can ask, but users will reply only if they can, my success rate here is good provided the question is well formed
 
@buncis Sure, as long as it's presented within the room rules (particularly, not some gigantic block of code :) )
 
10:00 AM
@python_learner unfortunately by now most questions have been answered, so the remaining on-topic non-dupe questions are rare. It's not you, it's the system.
 
once I am familiar with some framework hopefully I can increase my rep :)
or just ask a really good question
 
so I have categorical pandas series that have this value


`Name: is_reported, Length: 261838, dtype: category
Categories (4, object): [0, 1, 0, 1]`

problem is the series consist of 0,1,'0','1' thus why the category has 4 object instead 2

any idea how to make it so it have 2 object and only 0,1 instead of that?
 
@python_learner there are some stdlib modules that have a tag. to give an example, I did a lot of stuff with dataclasses back when they were introduced, and since them am farming a couple of questions tagged with python-dataclass every other week.
 
@roganjosh there's probably part of the lab not shown that's doing a "Breaking Bad" :)
 
@python_learner I haven't reviewed the questions, but the gspread tag seems to have a lot of open questions and I used that library quite a lot when I was learning; it's pretty accessible
 
10:03 AM
why my code tab not working lol
 
yes there is the string one and integers and I want to make it all integer
 
@Arne @roganjosh thanks for the suggestions, I will try looking into that
 
@JonClements Oh god. I'm just waiting for them to be hauled up in court
 
maybe off topic, but every room needs to have a mod as room owner?
 
10:05 AM
@roganjosh it's okay... I'm sure Jessica Jones will wangle something :)
@python_learner Nope - there's a few mods active in chat that might be an RO of a room/two - but they're definitely in the minority
 
@JonClements Now that you've mentioned this, I'm reminded that, on more than one occasion, it was only half-jokingly suggested that I do this. I've seen it suggested that Chemical Engineers should take a Hippocratic Oath of some kind
 
umm... seems a little extreme...
 
Well, I may also have done some back-of-envelope calculations about the market potential of "safe" krokodil. Big money and less exploding limbs
 
big money sounds good... but come on... exploding limbs is fun - why'd anyone want less of that to happen? ;)
 
10:24 AM
On consideration, yeah, the whole oath thing is overblown :P
 
Hi
 
Hello :)
 
What are you talking about? I just came here.
 
I'm afraid that's on you to go back through the chat transcript. The last discussion was off-topic for Python because there's no active discussion going on about Python, though
 
10:48 AM
Ok..... :-)
 
11:10 AM
He Pythonnastias. Why do't we talk about python?
 
We do. Regularly. The room has been around for years - it's not reasonable to expect that there's some continuous musing going on. If you go back up the transcript, you'll see discussions about Python
 
It's like your not breaking a tradition. Your just starting a new one ;-)
 
Does somebody know if now pyinstaller supports python 3.8?
 
@Tanmay nothing has actually changed btw. Many people have been here for years and there are "traditions" (I'm not sure that's the right word) that are reasonably-well understood. As I suggested, there is a transcript you can go back through to see the dynamics of the room
 
@roganjosh ok
 
@Tanmay This mess suggests "no"
Honestly, I don't think I've seen a github issue like that, with a bunch of spam/off-topic removals. That looks really contentious
 
11:50 AM
it's also unusual to request funding for features :)
 
I hadn't followed the link in the first comment but saw the funding issue pop up again in a later comment. From following it: "Otherwise issues and pull-requests will be left to linger until somebody can’t afford to not fix them." That's... gross
 
Well it's their call. A more capitalist take on "PRs welcome"
 
12:06 PM
There's ways of wording things, though, to not sound like extortion
 
yup
Whoever finds issue with it can use another library or fork it
Hard to take hostages in open-source
 
12:41 PM
Hello
 
@ChrisP Hi
 
The callback only happens once. This is it @ChrisP
Jun 11 at 19:32, by roganjosh
@ChrisP Please do. I'm tired of suggesting it. In the meantime, I'm moving those last disembodied comments. You will note that there is a link to the sandbox in the guide I sent you, so you can practice in there before posting here. But you really must know that I'm bored of this now so I'm not joking about the kicking.
 
1:31 PM
^ in addition to above
per the linked guide: 1. Restart from scratch. Create a new program, adding in only what is needed to see the problem. Use simple, descriptive names for functions and variables – don’t copy the names you’re using in your existing code. - with Tk issues this is especially critical as it helps you and us (I typically have a blank form open that I keep messing with when having problems with features then re-clearing) — LinkBerest 1 min ago
 
is anybody able to explain what this sqlalchemy error means? I have provided a hashed password as input but when running flask app it says sqlalchemy.exc.StatementError: (sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter 'password'
[SQL: INSERT INTO users (name, password, email) VALUES(%(user)s, %(password)s, %(email)s)]
[parameters: [{'user': 'Kieron', ':password': 'pbkdf2:sha256:150000$aQfm996V$af032bc39170c1e2b59cab53691ebb48e50d3824b851de6921c56f07f4a10d3c', 'email': 'kieron@example.com'}]]
its saying i need a parameter but i have it there through this db.execute("INSERT INTO users (name, password, email) VALUES(:user, :password, :email)", {"user":user, ":password":passwordHash, "email":email})
db.commit()
 
Firstly, please note the formatting guide because it will be so much easier to read
I'm not sure what you're trying to do, though. Why are you prefacing your VALUES with colons?
 
as placeholder for the values
when going through the cs50 course it was said doing that is recommended so that sqlalchemy can 'sanitize' the values
 
But SQLA has auto-generated a query for you
 
Basically those are all values i ran in through the webpage interface to 'register' a user to the database using the `db.execute("INSERT INTO users (name, password, email) VALUES(:user, :password, :email)", {"user":user, ":password":passwordHash, "email":email})
db.commit()`
 
1:40 PM
I've seen that kind of thing spat out from SQLA on an error, but it looks like the user is fighting with auto-generated binding params here
 
yeah, my chat hadn't refreshed so I didn't see it was the error message until I hit "send"
 
hmm how would I solve that
 
Please try removing the leading colons that I mentioned earlier, in the query string
 
so could make it along the lines of this
db.execute("INSERT INTO users (name, password, email) VALUES(user, passwordHash, email)")
db.commit()`
?
and will that allow escaping dangerous characters
 
No, db.execute("INSERT INTO users (name, password, email) VALUES(user, password, email)", {"user":user, ":password":passwordHash, "email":email})
I need to build an example for this. Referring back to my comment that there's "fighting" about binding params, I'm not sure whether SQLA is doing something fancy
Also, what's the database? SQLite?
 
1:46 PM
really odd error came up now
postgre
 
What's the error with what I suggested?
 
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column "password" does not exist
LINE 1: ...T INTO users (name, password, email) VALUES(user, password, ...
^
HINT: There is a column named "password" in table "users", but it cannot be referenced from this part of the query.

[SQL: INSERT INTO users (name, password, email) VALUES(user, password, email)]
 
Ok, I don't think I'm surprised by that. I just made the query invalid but it assures me that sqla isn't also throwing binding parameters in there
 
ok so what does that mean then with regards to the first one
 
I'm not so sure why I couldn't diagnose the initial issue on-sight. As it happens, I also use postgres so I'll try rebuild on my end but I have a few plates spinning so it'll take a little while :)
Presumably, db.execute("INSERT INTO users (name, password, email) VALUES (%s, %s, %s)", (user, passwordHash, email)) works?
 
1:58 PM
no i get : AttributeError: 'tuple' object has no attribute 'keys'
 
Is db a Flask-Sqlalchemy connection?
Actually, what is db?
 
# Set up database
engine = create_engine(os.getenv("DATABASE_URL"))
db = scoped_session(sessionmaker(bind=engine))
 
2:11 PM
Does someone know how to type-hint a literal ellipsis? Literal[...] is invalid, and I can't find the type ellipsis anywhere.
 
@MisterMiyagi you're not just missing Ellipsis, are you?
 
user12867493
Can someone help me, please? I uninstalled Python 2.7 on macOS but when I type python in terminal is still opens up 2.7...
 
user12867493
:49747203 Sorry
 
no worries
 
2:30 PM
@AndrasDeak almost. I'm looking for the type(Ellipsis).
@Daniil please do not remove python from MacOS!
MacOS uses python for various system scripts. There is a python version that belongs to the system and you should not modify or remove it.
 
@Daniil I know . about python on Mac, but is it possible you uninstalled a user env, and the system has its own, and you can get 3.x by typing python3 or something?
 
Did you install python3?
 
user12867493
@MisterMiyagi Only 2.7, I have 3.8 installed
 
Usually, you install python3 from python.org, homebrew or annaconda. By default, this gives you a python3 command in the terminal.
 
user12867493
NameError: name 'python3' is not defined
 
2:35 PM
python should only ever point to a Python3 version in a venv
@Daniil That looks like you "run" python3 inside a Python shell, not the terminal.
 
user12867493
Yep
 
user12867493
But I want to remove all Python 2 traces
 
I don't follow what you're trying to do, then.
You can run python3 from the terminal, or by any other means that invokes a process (e.g. Python's subprocess).
 
@Daniil ..if you do this, you'll either remove system-necessary scripts, or the ability to run them, from what I understand.
 
2:48 PM
@Kwsswart I fixed it here
Now, I'll also say that I managed to recreate every issue you faced, and I have no idea what exactly I did to fix it. Something feels wonky here
Even trying to PEP8 that code, I managed to break it :/
 
@roganjosh Hmmm im not quite sure what is the issue i have been playing with it and have no idea what you have dont particularly there
sessionmaker(bind=engine, autocommit=False, autoflush=False) that is different and also the class you made to represent the table... however the query is the same
 
I don't know what it was. I'd like to think I'm ok at finding issues but I really struggled with that one; it was a "holy yam, now it's working". I need to figure out what i did
@Kwsswart you could have saved me some time by providing the code and not leaving me to pull it together from my own code base, btw. It's only that I'm interested myself that I built it at all
 
im sorry man
 
if you wanted to solve an inequality like a x num < ceil(num/b) x c for num in python, how would you do this?
 
Ugh
@Kwsswart please see the room rules about asking new questions here. I'll take some responsibility for not checking, but I've put time into trying to fix something for you, built it from scratch, and now find you already had an open question
 
3:06 PM
@roganjosh I appreciate the effort alot and cannot thank you enough and feel a bit like an idiot for not noticing the typo
 
@Permian did you try sympy?
 
@MisterMiyagi didnt think of that thanks
 
depending on what you want to do, it might be easier to solve the equation by hand, then compute it using Python
 
@Kwsswart It's fine, I've gone and stamped my feet about the house :P Please be mindful about duplicating problems across here and main
 
and use a graphical solution to guide you
 
3:13 PM
Ugh what a week
 
@Kevin and it's far from over \o/
troubles at the widget factory?
@MisterMiyagi ah
 
About the usual. My more pertinent frustrations are my loud neighbors, my glitchy fire alarm, the red tape I need to deal with from the township, etc etc
Where's that tweet that's like "just have to get through this month, and then there will only be one more month before the next month we just have to get through"
 
@Kevin I take it that Hang In There kitty is no longer the radical symbol of motivation for modern day cool kidzzz?
 
3:28 PM
looking at imgur posts and comments these days kids have hangman's nooses with that text
 
I'm more of a This Is Fine Dog kind of guy
I don't know what the cool kidz are up to these days. They all migrated to tiktok and I can't be bothered to figure out how it works
I think I'm going to embrace becoming the type of adult that doesn't know how to full screen a youtube video or disable autoplay
Obviously I know how to do those two specific things now. Whatever the 2040 equivalent is, I won't be able to work those.
 
@roganjosh hmm....interesting. I think this may have to do with Postgres schema requirements but I'd have to dig deeper
 
3:57 PM
FWIW, there's a fresh MSE question (by one of the MSE mods) complaining that the new Closed Post notices encourage OPs to re-post questions rather than repairing the closed question. I assume that most of us have noticed that such re-posts are rarely much better than the original, and agree that re-posting is sub-optimal. See meta.stackexchange.com/q/349951/334566
 
already done :P ;)
 
I don't mind OPs posting a new version if 1) it's substantially improved, and 2) if there weren't any valuable comments or answers on the original that are now lost
As you say, most reposts do not satisfy these requirements
 
and then lead to question bans
 
4:14 PM
At least we can still hammer exact dupes to the original unanswered question.
 
I actually remember last school year (Aug-Sept) I just started clicking on user profiles to see what their last questions were for exactly that reason (to dupe them) - never put 2 & 2 together that the new close post might be contributing to that (it happens every year but last year it was cyclic)
 
@LinkBerest I think I've subliminally fixed a typo in transcribing what was posted here and the errors initially thrown are... unhelpful in tracking down the issue
 
ah (if its postgresql I always suspect the schema - postgres is weird with schema)
wish I could use PostgreSQL more - it was my first DB and I've always liked it best (everyone I work with seem to be Oracle, Big Data, or MS shops)
 
4:39 PM
I'm getting kinda annoyed at all the IoT stuff I'm encountering only working for SQL Server. I don't really understand why Postgres isn't the de facto at this point :(
Or, being more egalitarian, at least supporting more than only a proprietary dialect
 
5:00 PM
I really want to play with Postgres Big Data options (I've heard from others they are really nice) but alas I am stuck with what people want to pay me to use
 
5:19 PM
I haven't had a chance to play with fancy stuff for a while now. It's just what I've set up. I guess I could go make IT set me up 5 VMs or something for "reasons" :P
 
5:37 PM
oh, yeah. We all know IT loves request for resources for vague research related reasons ;)
 
Well, I recently squashed them, so now is the time to make demands before it gets back to, at best, status quo :)
 
6:01 PM
Wow, are there seriously no python modules for parsing CSS and finding out what a particular node in the DOM would be styled like? There goes my plan to write a flexible theme switcher for my website
 
6:45 PM
hello, a quick question. I am making an appointment chatbot and wants to make sure that nobody is able to book the appointment for the weekend because we are closed on weekends. So, user will give a date. like 26 June, 27 June. And I have to determine whether this day falls on weekend and if yes then I will tell the customer that we are closed on weekends
 
Ok, what is your question?
 
How to determine whether a certain date falls on weekened
 
@smci i use a timer and go for a walk. Sometimes i strech (i fell asleep yesterday seen your answer now lol)
 
@MuhammadNaufil ok, and you presumably searched for exactly that?
 
7:11 PM
@MuhammadNaufil be a mathematical savant. It helps
(kidding)
 
How do I show more range on x axis while keeping the same data in PIL?
I want it to show more values below minimum value and above maximum value
 
Which module do you use? PIL?
 
oh sorry. matplotlib
also, not on x axis, its y axis
sorry, my brain is getting crazy
 
7:18 PM
But why do you want this?
I think the above graph is pretty.
 
yea but it doesn't match the theme I am using it for
:/
lemme try the solutions
@roganjosh :o Thanks man. That is the one I needed
I couldn't make up the words to google and what I googled, I ended up with nothing
 
7:44 PM
How do I fix those hidden lines? (matplotlib)
 
There are no hidden lines
 
Well yea, thats the region where x labels end
but, isn't there a solution to extend the lines?
or extend the labels maybe
 
No. No, no. At best, you'd have the x axis plot results for y that are flush to the boundaries of the plot. There's nothing wrong with the graph IMO
 
well, Yea but with grids, it looks bad
 
Awful
What are we even debating here? Inventing data to finish off the plot, or dark theme?
 
7:50 PM
dark theme
and both
I mean not dark theme
 
No to both
 
Just finishing the plot
 
I did it
:o
plt.xlim(0,7)
 
^ that just ends the plot at today (which is what rogan asked the first time). Inventing data to finish off the plot would mean calculating the likely extension of the plot then adding those points and continuing the plot "past today"
....to be fair I get asked to make those a lot (people are shocked when I explain accuracy every single time too)
 
7:54 PM
Since I assume we're not supposed to get anything actually useful from the plot other than fancy management-speak; I suggest dropping the dark theme
 
The thing is, the dark theme is because of the photo editor. Its a transparent background instead of the dark color, but I need that transparency for discord
so yea, its dark theme anyways :/
 
I don't know what "it" is, and I think I need to watch some TV to put my brain in idle mode
 
dang it: @roganjosh you jinxed me - management wants a "sparkly" old school drilldown chart as my project for next week argh!
(yes they are fun to make ;)
 
@LinkBerest mate. If you want scalable blobs at pseudo-random locations on a map, I'm your guy
 
lol
 
8:18 PM
@ExoticBirdsMerchant Sure. Forgot to say the most obvious thing: quality chair, make sure its seat height is correct wrt desk height, elbow and wrist angle, this is important for ergo so your leg arteries don't get squeezed and cause pain from extended sitting. Also, lock the seat back(/lumbar support) from reclining, that;' terrible for lower back muscles. A chair whose back cannot be prevented from reclining is really nasty.
 
ohhhh i know it just going back and there is no way to undo this ... rlly bad! Tilting isnt always good
 
@AndrasDeak why?
 
Jun 9 at 20:34, by roganjosh
@ExoticBirdsMerchant please see the formatting guide for chat
 
Its just discussion i understand how it works just the principle seems not-normal. Anyway
Ill look it up i know is Ctrl + K but sometimes it needs more editing lol
 
8:24 PM
@ExoticBirdsMerchant There are lots of free office-grade chairs (FreeCycle, CraigsList, don't know where you live), else invest in a quality bargain office chair, it is likely tax-deductible/employer-reimbursable, it will be a great investment and prevent back pain. I guess we should end the ergo discussion here unless other people find it useful.
 
I got a 250euro from IKEA ... at the beginning i bought a cheap one and it messed my back big time. It had a bump where the lower back should have a lumbar support just thin air it had...
Right now i am living in Europe
I am listening on loop .. I am a Creep from Radiohead .. and i am trying to write something creepy for code .. but all i get bugs. Well thats life. A buggy life. With bugs
def evaluate_expression_1():
    global x
    x = x - 3

    def evaluate_expression_2():
        global x
        return x + 7

    return evaluate_expression_2()
# Main Program #
x = 33
print(evaluate_expression_1())
It is so counter-intuituve ... Why on earth the second global x doesnt get x= 33 which resides in the global namespace and it gets the first global x from the enclosed namespace from evaluate_expression_1? This is creep~!
There re many examples in stack overflow but it seems simply counter to the logic of a sane and collected individual
 
@ExoticBirdsMerchant the first function call rebinds the global x to be equal 30. That's why you get 37 after the rebounds global x gets read out in the nested function.
there is nothing "creep" about this, and if it's counter-intuitive to you then your intuition is wrong
in your code snippet there is only ever one thing pointed to by the name x, and it lives in the global namespace
 
@AndrasDeak hmmmm rebinds huh?! didnt knew that. The tutor didnt explain it ........ oh it lives in the global variable which gets rebinded
 
Sprinkle print(globals()['x']) in a few places to see the global value change in each step
 
Ohhhhhhhhhhh thanks dude!~!!
 
8:35 PM
@ExoticBirdsMerchant please calm down
 
I am happy that i finally crack the damn ridle.
 
@ExoticBirdsMerchant That's nice. You can even do somersaults in front of the computer, I don't care. But when you start typing please folllow standard social conventions.
 
okie @AndrasDeak sry for the tension.
 
it's alright, thank you for your understanding
 
How do I interpolate this graph?
The thing is, it got strings on x axis
And I can't figure out what to do with them.
 
8:45 PM
@BlackThunder strings are usually plotted as categoricals. Define an array of numbers that matches the categoricals.
if you presume that interpolation makes sense you have to have corresponding numbers anyway
 
I just wanna smoothen that line,nothing more
 
why?
 
@BlackThunder Don't, that's lying.
consider removing the line and only having markers instead
 
Hi all, can someone check out my post and tell me how should I edit it, or what details provide to receive the answer?
 
smoothen? that will change the monotony of the line
 
8:49 PM
I'm sure it's quite simple, but no one helped me yet
 
@ExoticBirdsMerchant no
@Bowcoy you are missing a self-contained example that people can copy-paste
 
? no how if you change the direction of the curve ... hmm
 
@ExoticBirdsMerchant why would it?
 
I'm moving your message to ensure that it doesn't get answered here, as per our rules
 
@AndrasDeak I thought provide a link with an example is even better :/
allright, thanks.
 
8:51 PM
@ExoticBirdsMerchant if you change the direction of the curve then the direction of the curve will change. But you don't need to do that to smoothen it, depending on how you smoothen.
@Bowcoy no, links can rot away. Ideally every SO question should be self-contained. See also MCVE
 
@BlackThunder See pd.DataFrame.rolling() and e.g. Plot smooth curves of Pandas Series data. There's tons of existing Q&A on that. Just use rolling(), don't resample. matplotlib/pyplot might have a smoothing filter you can apply to plots as a postprocess, I don't know, I'm too busy to check.
 
@AndrasDeak aha maybe changing the scale .. that can be also a way or the graphics .. i got caught up because you said .. that would be like lying--> the smoothening of the curve
 
@smci as for pyplot: it's not supposed to have any kind of filter, so I doubt it
 
200
Q: How to smooth a curve in the right way?

varantirLets assume we have a dataset which might be given approximately by import numpy as np x = np.linspace(0,2*np.pi,100) y = np.sin(x) + np.random.random(100) * 0.2 Therefore we have a variation of 20% of the dataset. My first idea was to use the UnivariateSpline function of scipy, but the proble...

Splines and scipy.interpolate are probably waay overkill too. Just pd.rolling()
 
@smci dont know who he is but he damn sure has a great picture!!!!
 
8:55 PM
ugh
 
@ExoticBirdsMerchant seriously, please reduce the number of exclamation marks and other unnecessary punctuation in your posts. It comes across as annoying.
 
Okie okie nobody wants to annoy ppl
 
I hope so
 
@BlackThunder I'm being serious now. Stand by the data. There doesn't seem to be a reason to interpolate anything. It doesn't need a trendline and you're being a bit flippant with "I just wanna smoothen that line,nothing more". It is what it is
If you want a trend, fine, we can explore that. But just "smoothing" is data manipulation
 
I already did that, but I don't know how to change x labels
 
9:02 PM
Change to what? Half-characters between your strings?
 
I don't want the numbers, I want strings
x_new = np.linspace(0, 7, 300)
a_BSpline = interpolate.make_interp_spline(x, y)
y_new = a_BSpline(x_new)
 
those two graphs are not the same (I don't mean they look different - I mean they don't represent the same data)
 
FWIW, I'd want the original data plotted behind the trend
 
@roganjosh I bet you'd also want a lack of distracting colour gradients in the axes annotations
Black Thunder is doing a lot of work to make their figure worse
 
@AndrasDeak Why do you think that? :/
 
9:07 PM
Because I'm a physicist, most of my job is conveying precise (and unbiased) information in limited media
To me the point of a figure is to tell other people about your data. What you are doing to it is making this task harder.
 
@AndrasDeak really? looks like white numbers with a blue line to me (sometimes being colorblind is actually helpful ;) :P
 
@AndrasDeak I'm pretty fussy. If I find a red sweet in my room's jar, I won't be held responsible for what happens next
 
The second graph looks like measuring a concentration or smth the first one like following a stock price.
 
As far as figure styling goes, I recommend just using something built-in in matplotlib or seaborn. It's fun to waste hours to personalize a figure beyond recognition, but the end result will more often than not only be useful for decoration purposes.
 
@BlackThunder to illistrate: I would read graph 1 as trend has been increasing and is now reaching a steady point. graph 2: as trend has an downward and upward curve which is moving to its downward cycle
 
9:11 PM
Hmm
That makes more sense
You changed my mind ._.
 
@LinkBerest which is what ExoticBirdsMerchant was talking about
 
Secondly - the points (which are where the curves start/end) are not in the same place because matplot is correcting (which is what @AndrasDeak meant by half-chars)
 
You are a mind changer bruh
 
@LinkBerest what I actually meant is that interpolating over categorical data is nonsense
 
oh, that too (it does change the plots though - thereby showing incorrect data). I don't like "rounded" graphs with line charts - its a line that's in the name
 
9:14 PM
Lines are curves with infinite radius, change my mind.
 
Is there any discord server for stack overflow?
 
@AndrasDeak am I limited to Euclidean Geometry? ;)
 
@BlackThunder nothing official
 
@BlackThunder one of the mod's links to a discord in this comment
 
Hi all,
It is my first time trying to use python. I am just trying to simply run a python script developed by another researcher. However, a simple test of plotting a graph based on the code from the package is not working as it should. Could you guys check this out?
https://stackoverflow.com/questions/62584255/python-script-not-plotting-graph-it-plots-only-a-white-pdf-recon-v2-5-python
 
9:21 PM
@rodrigarco hello. Please don't ask for help here with fresh questions on the main site as per our rules
 
Is it "update all the charts!" day and nobody told me?
 
@rodrigarco since you're new to python: do learn and use python 3 instead of 2! Python 2 is an archaic language which is no longer supported.
 
anyway, my glass is empty and my kids are hungry so time to walk in a line toward my kitchen and make supper ;)
rbrb all
 
@LinkBerest yep. Still for-hire if you need those blobs :P
 
I am reading now that out of 7 billion ppl in the planet 4 of them do not have Internet. Imagine how many ppl are still out of the game
 
9:24 PM
4 billion?
 
Yes 4 billion! We are the minority here
 
@roganjosh lol, nah. I keep a pretty decent class for making those so just have to update it for this new "I don't get why you want this but here" project
and now: the real rbrb
 
rbrb :)
 
9:56 PM
@AndrasDeak I wanted to, but the script I wanted to use is written in python 2, so python 3 doesn't work for that specifically.
 
@rodrigarco how large a script are we talking?
 
2300 lines
 
00:00 - 22:0022:00 - 00:00

« first day (3540 days earlier)      last day (1401 days later) »