« first day (4343 days earlier)      last day (623 days later) » 

12:10 PM
Hi
I'm working on a python framework named panther, this something like django + fastapi
I would be happy, you give me your feedbacks:
https://pypi.org/project/panther/
or any contribution ...
 
For starters, it would be nice if the project description would actually describe the project. What you have there is not a description, it's more like a very bare-bones quickstart guide
 
12:37 PM
There's a Python Packaging survey on PyPI, in case anyone wants to click their mind on the topic.
 
@Aran-Fey Yes I have to create a complete doc for it, so anyone can understand what it is
 
Hello I am trying to import a csv file into python. With mode ='r' encoding ='cp1252
I am able to pull in the data using:
data = pd.read_csv('Data.csv',encoding='cp1252'). But when I try to read the data it only shows NAN values. I have checked the data file the data is seperated via ,. The one thing I noticed is that column headers are in the first two rows. I am wondering if this is the issue?
 
@Paul should be, by default it tries to use the first line only as column headers
try data = pd.read_csv('Data.csv',encoding='cp1252', header = [0,1])
or skip the first line and use the second one as a header
data = pd.read_csv('Data.csv',encoding='cp1252', skiprows= [0], header = 1)
 
12:52 PM
What kind of insane person and/or library splits a csv header across two lines?! o.O
 
@PeterT I get a list index out of range
@Aran-Fey my wonderful workplace data team
I tried to combine the csv header into one row using excel but the maximum character count was reached
 
I'm pretty sure you need the number of column-labels in one header line to match the number of columns
if it's one header split across 2 lines then you need to remove that one newline at least during processing in your program (no need to change the file on disk I mean)
 
How would I process the data without all the headers?
 
Can you give an example of the format? Are the headers wrapped into the next line, or is it interleaving columns to reduce length, or something else?
 
I tried skipping the first two rows but I still import NAN values
ROW 1:
ResponseID,Wave,Country,S1,S2,S3A4,S3A7,S3A12,S3A1033,S3A2057,S3NEWCH,S4_1,S4_2,S4_3,S4_4,S4_5,S4_6,S4_7,S4_8,S4_9,S4_99,S5_1,S5_2,S5_3,S5_4,S5_5,S5_6,S5_7,S5_8,S5_9,S5_99,S6,A1_1,A1_2,A1_3,A1_4,A1_5,A2_1,A2_2,A2_3,A2_4,A2_5,A3_1,A3_2,A3_3,A3_4,A3_5,A4A_1,A4A_2,A4B,A4C,A7NEW_26,A7NEW_27,A7NEW_28,A7NEW_29,A7NEW_30,A7NEW_31,A7NEW_32,E
ROW 2: A_31_6,E2A_31_7,E2A_31_8,E2A_31_97,E2A_32_1,E2A_32_2,E2A_32_3,E2A_32_4,E2A_32_5,E2A_32_6,E2A_32_7,E2A_32_8,E2A_32_97,E2A_33_1,E2A_33_2,E2A_33_3,E2A_33_4,E2A_33_5,E2A_33_6,E2A_33_7,E2A_33_8,E2A_33_97,E2A_34_1,E2A_34_2,E2A_34_3,E2A_34_4,E2A_34_5,E2A_34_6,E2A_34_7,E2A_34_8,E2A_34_97,E2A_46_1,E2A_46_2,E2A_46_3,E2A_46_4,E2A_46_5,E2A_46_6,E2A_46_7
 
1:01 PM
well how do the numbers look?
 
Row 1 ends with ,E
Row 2 starts with A_31_6
This would be one row of data:
240000001,1,7,1,3,,,,,,,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,2,1,2,2,1,4,,4,1,,17,,17,18,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
 
That's more than 200 columns, and your headers are less than half of that
Something's not right
 
Those were samples
sorry for the confusion
 
FWIW, my general advice for "I got this weird data" is to contact whoever gave you the data. Don't assume they're sitting in their offices snickering or dozing, they might well be unaware that there is an issue in compiling or transmitting the data.
 
I checked the columns there are 4032, and responses were 4031 at least in the first row
@MisterMiyagi Ok that may be the best approach here
 
1:18 PM
PeterT's approach gives me non-NAN data just fine pastebin.com/raw/CQczFB3b
My general advice for "I got this weird data" is to share a program structured like this one. Show the libraries you're using, show the exact data you're reading, show exactly how you're reading it, show exactly what the output is. And it has to run, of course.
Share a file like that and 99.9% of the time we'll give you a fully working solution within ten minutes
 
got it makes sense thank you
 
 
1 hour later…
2:26 PM
@MisterMiyagi emphasis on this approach, I recently resolved a terrible data issue simply by going to the third party and saying "why?"
 
 
2 hours later…
3:58 PM
Is there a reason why mypy doesn't complain if a TypeVar only appears in a function definition once, like this?
T = TypeVar('T', bound=int)

def foo(x: T):
    print(x)
That's equivalent to x: int, right? So almost certainly a user error
 
@Aran-Fey might be wrong, but I think this is related to github.com/google/pytype/issues/704
 
@Aran-Fey You might need it in the body, no?
 
from what I get, both pytype and mypy complain or don't complain (as in, throw an error) for certain things. I don't use either so I'm just guessing
 
@MisterMiyagi Hmm, true. Still, I'm not using it in the body either, so... ¯\_(ツ)_/¯
 
I'm not following. What do you think it should be?
 
4:08 PM
🤷‍♂️
 
Wow, a single TypeVar can actually affect mypy's output (from Nordine's link):
def with_typevar(x: T):
    x.foobar()  # error: "T" has no attribute "foobar"

def without_typevar(x):
    x.foobar()  # no error

with_typevar(3)
without_typevar(3)
@MattDMo An error or warning telling you that your use of the TypeVar doesn't make sense
 
it's also mentioned in another issue: github.com/google/pytype/issues/379
 
oh, ok
 
I don't think pytype takes into account the function body at all when checking the typevar count.
both link I posted are a bit old though, but given their state, I don't think this is fixed yet
 
RS1
I came across code

```
def memo(f):
save = {}
def func(*args):
if args in save:
return save[args]
ret = f(*args)
save[args] = ret
return ret
return func

@memo
def divisors(n):
# ...
```

What is this @memo? Creating custom annotations? Can someone please point me to doc explaining this topic?
 
This is the question that sparked this btw. It's long and confusing, but maybe someone wants to take a look
 
RS1
@Kevin billion thanks!! I was searching for "annotation" ... in java its called annotations 😅
 
It can be tricky to search for language features that are just a symbol. Googling "Python @" will just show you python.org.
 
@RS1 if you came from java, a good query for finding language features comparison is "java [feature] in python". I tried it with the word "annotation" and the first 3 result had the word "decorator" in their link :D
 
@Kevin "python at symbol" ¯\_(ツ)_/¯
 
4:21 PM
@Kevin that's true. I recall I had a hard time last time I did that for regex symbol/whatever they are called
@Aran-Fey never thought of using "at symbol"...that's clever
 
RS1
@NordineLotfi yeah this is one way to be good at google ... did this earlier many times ... but it has to click in head at right time ...
 
5:09 PM
@NordineLotfi and Java annotations really have nothing to do with Python decorators.
they just look similar.
 
@AnttiHaapala--СлаваУкраїні that's true. I mean I never said they were the "one and the same". It's just, as long as you can "compare them" on a semantic, as in, language semantic level, you can probably find some similarities with it
it's like when people compare pointers vs variable, etc
 
Search engines are magical in a way. It doesn't matter if java annotations have anything to do with Python decorators. It only matters that lots of people believe they're connected.
 
exactly
 
Our tower of wisdom will be built atop the ignorance of others
And most likely it will fall over and sink into the swamp, but that should only happen two or three times max
 
if you think about it hard enough, you just have to switch the words used in a query to "synonyms", that are far or not too far from each other (or I guess X distance) and call that "similar". I can use the query "consciousness reasons" while another one I'd call "similar" would be "brain reasons"
depending on luck, position of the planet, and whoever at [your search engine here] is in the right mood, you can find what you seek, and more that you didn't ask either
 
5:14 PM
Remember to use smart sounding words, to convince the search engine that you're smart, and thus give you smart results
 
is building microservice architecture with Django a good idea or am I fooling myself?
Basically, we are converting monolithic codebase to microservices, its a Healthcare/E-commerce platform.
 
@Kevin as mentioned before:
 
@Kevin Every time we rebuild the tower we'll attach it to the base of the old tower, then eventually we'll have come full circle and one tower sinking into the swamp will cause another tower to emerge
I should've become an architect rather than a programmer.
 
Questions looking for punctuation-aware search engines seem to come up every quarter or so, maybe worth adding to the room rules as a suggestion.
May 6, 2020 at 18:51, by toonarmycaptain
Dropping in to say GitHub Codespaces looks cool, anyone planning on setting it up on their project, I'll gladly test drive it for you.
@toonarmycaptain what's your verdict? how are the licensing terms? how does it compare to e.g. Kaggle Notebooks or other similar things?
 
@Aran-Fey that gives me babel tower flashback
@smci I think the site is down, at least on my end :/
 
5:25 PM
@NordineLotfi Well it is/was non-https, which these days trips lots of filters and antimalware. These guys are saying it hasn't been up and stable since 5/2022
84
Q: SymbolHound: Search Stack Overflow for special characters

dncrane About See symbolhound.com SymbolHound is a search engine that doesn't ignore special characters. I was always frustrated that I couldn't search for symbols like >> and && using Google or the custom Stack Overflow search, so I made a search engine for programmers. It currently searches mostly St...

 
@smci I can't find the codebase, so I'm guessing it's closed source?
would be nice if it was open/public, so someone could port it to something simple like python
 
5:50 PM
@NordineLotfi this is pointers to oranges kind of comparison though.
 
@AnttiHaapala--СлаваУкраїні not really? I mean the "orange vs apple" argument works for certain things, but when it comes to comparing aspect of programming features, it doesn't always work. When you compare an apple or an orange, there isn't enough details to "compare". There the colors, smells, sizes, species, tastes...maybe 10 more if you really play with meanings but it's not as bountiful as programming aspects
if someone say "X and Y are similar" they don't actually mean it verbatim. They might mean a thousands things, maybe they say that because of the syntax, or maybe because of how it work internally, etc
both pointers and variables hold "data", and you can "reference" them in a certain way. This is also one of the aspects that people think of when they compare both of these, whether erroneous or not.
 
6:18 PM
This topic has escaped from under the rug again, huh
 
ah, that's my bad. I just wanted to answer in the way that seemed right to me, although it probably sounded wrong still
in any case, I heard it's autumn now but it's still relatively hot
 
@NordineLotfi no worries. If you want to discuss it, go ahead. But my personal opinion is that it won't lead anywhere
'tis pumpkin season. Prepare yourselves for pumpkin spice latte, pumpkin spice tea, and pumpkin spice pull requests
 
@Aran-Fey I agree.
@Aran-Fey ah, been a while since I ate pumpkin, guess I can do it now
 
pumpkin spice pumpkin?
 
you mean like a pumpkin with pumpkin spice inside or something else?
I was thinking of pumpkin pie spice, not sure if it's the same thing
 
6:28 PM
The joke is that "pumpkin spice" is just a marketing gag. It sells, so everything becomes "pumpkin spice", whether it makes sense or not
 
@Hakaishin how young are you again ;)
 
@Aran-Fey ooh, that make more sense yeah. That reminds me of the "chilly marmalade" marketing, where they just market it as "you can use it on everything", or at least, the cooks seems to market it as such so it sells
 
Well, except that the whole pumpkin spice stuff is intrinsically associated with Halloween coming up soon
"Soon" being the SO version of 6-8 weeks. Close enough.
 
 
1 hour later…
7:56 PM
hmm, dpaste.org doesn't work on my end, got a "522: connection timed out"
 
Not working for me, either. Seems to be deaded right now
 
Time to fork it and host your own :-)
Ooh, there's an issue on the github for the downnage github.com/DarrenOfficial/dpaste/issues/218
TLDR: "As of right now, it is still unknown what causes it."
docs.dpaste.org is still up. I guess that implies that their domain registration dues are all paid.
This is a perfect opportunity for KevPaste to enter the market. But oh no, if I rip off dpaste completely, then my website will also be down.
I wasn't planning on applying any original thought to this project. I practically got a cramp just thinking of a name.
 
8:23 PM
kpaste duh
I think it should only support KevinScript, too, to give it that touch of exclusivity. You might even be able to charge a little for the differentiation
 
it's funny because, when I was searching for why dpaste was down, I found this: dlang.org/blog/2017/01/30/project-highlight-dpaste
the link doesn't work anymore, but I guess there used to be a totally unrelated dpaste but only for the d language
 
The venerable language of D was presumably overrun by the generic dpaste that we came to know and love. At least kpaste has a few extra letters before it in the alphabet to build an ecosystem and let some other C successors come and go in the meantime
<tragic realisation that JoshScript might well be the last hold-out before the tide comes forth>
 
9:02 PM
KevPaste is preceded by KetPaste and KeuPaste, and will be succeeded by KewPaste, KexPaste, ... KfaPaste, KfbPaste, etc
Now let's apply cantor's diagonalization argument to prove the uncountability of all of PasteSpace
 
Unfortunately, it turns out that PasteSpace is not a proper vector space, due to the admixture of tabs
 
Perhaps it's for the best. I asked my domain name registrar if I could buy "[the complete decimal representation of the square root of two]Paste.com", and they hung up on me
 
9:32 PM
Seems that every time I mess around with typing, I arrive at the same conclusion: Nothing makes sense
 
where does the .title property come from here
unconfirmed_users = ['alice', 'Brian', 'Candice']
confirmed_users = []

while unconfirmed_users:
current_user = unconfirmed_users.pop()

print(f"Verifying user: {current_user.title()}")
 
It's a method of the str class
 
I'm learning python and I didn't know , Thanks.
 
.pop() doesn't just remove an item, it returns it to you. In this case, you chose to assign that to the name current_user, so now current_user is the string you popped, and you can call .title() on it
Stars in chat work a little differently to upvotes on the main site - please only star things that you think will be of general use to others in the room :)
Uhoh, github is now playing up for me
Yep, gone in Manchester, UK it seems. Not yet listed on their service page. First dpaste, now github. We'll be tying punchcards to pigeon's feet in no time if these events are related
It's back. Worst 2 minutes of my life.
 
10:11 PM
It's midnight my dude, what do you need github for right now :P
 
I wander our company github to find things to complain about
I don't get chance in the day. "what do you need github for right now" -> "Catharsis?"
Also, my the main library I develop is being used heavily in R atm at work, which is really strange to see. reticulate is pretty powerful, and I didn't have to do anything (thankfully) to support it
 
10:33 PM
@Aran-Fey I feel the same, although I don't know much about typing
@roganjosh I had github downtime this morning too I think
@roganjosh it seems to be really popular too: using "use python library with R" as a query yield a lot of links, dating back to 2020 that mention reticulate
 
10:49 PM
Well, an inflammatory opinion would be that R is in its death throes so it better adapt fast, but I've got 2 solvers now (of vastly different complexity) being linked into, and called from, R. I refuse to learn the language so downstream users are also kinda stuck on that point. It seemingly falls down with multiprocessing, though
 
11:40 PM
hmm, I think I fell into another mini rabbit hole: searching up what you said about reticulate falling down with multiprocessing led me to a bunch of github issues, all of which converge to: cran.r-project.org/web/packages/future/vignettes/…
 
11:55 PM
It doesn't surprise me. My refusal to even attempt R these days is part of the conversion to a sensible language, and "well, if you want to use this toolkit, you better swap to Python" works in my favour. I don't even use multiprocessing myself; not for a long time. But reticulate seems to have got... the dark side... excited in what they could try with reticulate
They'll come to the light in the end. We just need a ggplot replacement
Well, that and R Markdown. The latter is probably more important in the cases that are cropping up
 

« first day (4343 days earlier)      last day (623 days later) »