« first day (3517 days earlier)      last day (1417 days later) » 
00:00 - 19:0019:00 - 00:00

7:08 PM
hmm...I wonder if nuitka uses numba, I've been playing with numba the last few years and like its capabilities so far
 
numba is great
 
quick Q peeps. trying to change string format/desc/upper etc within a few columns in my dataframe via a for loop....seemingly simple task but im at a roadblock
 
Does the .str accessor not suffice?
assuming we're talking about pandas dataframes
 
the values within the columns are already string, so one error i get when i try to iterate .str.upper() is "'str' object has no attribute 'str'
 
Why are you trying to iterate it?
 
7:16 PM
@AndrasDeak is it suitable for general purpose work, or just numerics/numpy? It's been a while since I looked at it, and the docs were pretty vague back then.
 
df['col_upperified'] = df['original_column'].str.upper()
 
ya so that works column by column
 
i have a dataframe with 225 columns
 
@jamest so...loop over columns? I don't understand your situation. Perhaps an MCVE would help.
 
7:17 PM
and wanted to for loop so that str.upper() iterates through all
ah sorry...newish at explaining my python code
loop over columns . exactly
 
So do that.
for col_name in df.columns:
    df[col_name] = df[col_name].str.upper()  # overwrites the original column
    # or whatever
 
@AndrasDeak aw, come on. You're a phycisist, you have to know such things. It's just computers. How hard can it be, amirite?
 
@MisterMiyagi I think its real strength is being able to sidestep the python interpreter altogether with jit(nopython=True) (a.k.a. njit()). It's probably harder to do that when you have dicts and stuff.
My hunch is that it works best for numerical problems, numpy or not. If you want generic JIT with restricted functionality you might as well use pypy, right?
 
PyPy is great, until you actually want to do something with it.
 
thanks Andras for helping with my poorly explained Q!
 
7:21 PM
Plus, I'm mostly interested in not paying the price for all the vodoo magic runtime mutation hackz that my code just does not do. PyPy is fast, but it's still regular, ugly Python.
At the same time, Cython's type model is too restricted for my evil schemes.
 
@jamest no worries. It takes practice to ask. But you do have to practice ;) Imagine that you're talking to someone who has no idea what you want to do (which happens to be the truth). A rubber duck helps.
 
does anyone have a recommendation for packaging tool + namespace packages? (Other than not doing namespace packages)
Used flit for most projects lately, but their namespace-package PR is stuck for a while.
 
@AndrasDeak yeah, its great for my pure analysis style programs but not on the data flow, wrangling, and other applications (which are mostly batch so less of a speed requirement anyway)
 
wim
7:51 PM
namespace packages seems really half-baked idea. I recommend to use entry-points instead.
 
afternoon cabbage
 
8:09 PM
@wim I've found them useful for splitting a framework across several independent repos, without needing users to know about that. entry-points seem better for supporting arbitrary, third-party plugins.
 
wim
@MisterMiyagi ok in theory but not working well in practice. many parts of Python ecosystem seem to have forgotten about namespace packages and either don't handle them properly or even worse just assume they don't exist
this is even true for some implementation in stdlib itself e.g. importlib.resources
 
@wim can't deny that the ecosystem does hardly care, flit is basically the same case. :D As long as namespace packages are working for what we need them for, we'll stay a +1 on people actually using them.
 
wim
inhales love the smell of freshly chopped questions
what do you gain from splitting framework across repos?
 
8:25 PM
a headache?
 
wim
flit's opinionated here for sure. but it's a good opinion, I think ("there should be one package name per package")
other use-cases are not important enough to exist, or have perfectly good analogies that can fit within the one-package-name-per-package paradigm
 
@wim Mostly more independent versioning and development. We have some pretty stable core parts used by everything, plus some faster moving experimental parts with limited usage.
Splitting our projects horizontally has already been a great quality boost. It largely prevents muddled responsibilities and people taking hack'y shortcuts.
 
wim
8:48 PM
why namespace package though? if they weren't namespace packaged there would be circular dependency?
 
to have them all in one namespace, really
 
wim
what blocks something like this from roomba? is it the answer, or the comment(s), or both? roomba forecaster is not clear here..
my interpretation is that if there was the answer but no comments, OR the comments but no answer, it would roomba. but not sure if that's correct.
 
Did you just downvote one, or both, of them?
 
aren't dupes exempt from roomba?
 
Ah, I missed that. Yeah, I think dupes are safe because they're a signpost to the actual answer
 
wim
8:59 PM
dupes are only exempt if they have non-negative score I think
 
Then it would be a pointless effort to dupe questions these days because so many of the posts have downvotes
 
wim
hmm, I disagree
there are good dupes that framed the underlying problem in a different way
and bad dupes that were just lazy / user didn't search
actual roomba rules are complicated stackoverflow.com/help/roomba but the post(s) score(s) definitely taken into account in some ways
 
Doesn't the question title (which should be unique, but I saw that constraint broken once somehow) cast the net wider to funnel people to the same answer?
 
wim
I don't know, that particular one is suspicious because there is no traceback so we can't tell if it's syntax error from print or syntax error from indentation.
arguably, it should have been closed as unclear, but I'm asking about roomba rules not about that Q in particular.
 
@MisterMiyagi multiple kinds of roomba
30-day/1-year/9-day roomba
 
wim
9:06 PM
^ yes
so to clarify my question, what blocked this from 1-year roomba
 
9-day is "non-dupe closed crap". 30-day is "crap tumbleweed". 1-year is "meh tumbleweed"
@wim 1. has answer so 30-day and 1-year don't apply. 2. Closed as dupe so 9-day doesn't apply.
if it's a problematic question we can just delete it right here and now...
 
wim
any answer blocks 1-year?
 
yes, just open the link you posted
@wim the IDE drew squiggles under the last few prints as well. It will be a 2 vs 3 problem, which is in agreement with OP's dubious "syntax error" naming.
even 2 comments will block 1-year roomba...
 
wim
ahh. you're right
 
it's really there for hopeless tumbleweeds
 
wim
9:11 PM
@AndrasDeak we need a comment roomba before the question roomba ... :D
twiddles the knobs on the unwelcoming terminator...
 
"has 1 or 0 comments". Well, I've thrown some poop into the roomba, it seems. I wouldn't be surprised if I've kept hundreds of questions open from that condition :'(
 
wim
you need inspector-gadget style "comment that expires in 24 hours"
 
Me, or SO? :P
On a serious note, I feel that one condition means I have actually seriously borked SO's roomba
 
9:30 PM
meh
People leave comments all the time. That roomba rule just means that non-closed questions with non-negative score mostly don't get roombad. Which is fine.
ah, it's actually "0 score or less".
Still not a huge deal. Tumbleweeds are not a problem. And closed non-dupes get deleted much easier.
 
wim
some great pics and video of the starship RUD here teslarati.com/spacex-starship-explosion-explained-elon-musk
 
wim
9:54 PM
@AndrasDeak it took a couple of weeks but flagging worked, fyi
 
great!
 
Wow, nice. That must have been an escalation to employees...
 
wim
yes, it would explain the ~3 weeks delay. I'm kind of surprised tbh. I thought if a mod can't do anything nothing will happen.
 
No, escalation to employees is very much a thing. It's just that mods don't seem to be crazy active these days, and there aren't many employees left.
 
10:29 PM
Ah, my favorite Python people. How are you doing?
 
explicit and flat
 
better than implicit and nested, I always say
@wim I got an accept vote reversal today... :P are we ok or is there something we need to talk about?
 
Does anyone know if it's possible to make sphinx display class/function definitions in the toctree? Basically if I have a file like this
Properties
==========

.. autoclass:: WeakProperty
And a toctree like
.. toctree::
    :maxdepth: 2

    properties.rst
I want to see a tree with bullet point "Properties" which has a sub-bullet point "WeakProperty"
 
10:46 PM
It's been a long time since I was editing sphinx docs everyday...
 
doesn't sound like fun
 
but it's honest work
 
one of these days sphinx is gonna make me quit python
 
I don't recall seeing objects showing up in the TOC, just headings, subheadings, sub-subheadings...
Maybe modules with automodule...
 
Yeah, I'm not surprised that it doesn't work out of the box. I just can't think of a way to accomplish it without monkeypatching some sphinx internals (yet again)
 
11:00 PM
Maybe an extension is apropos for your use-case: sphinx-doc.org/en/master/extdev/index.html#dev-extensions
Or perhaps you should manually create your TOC.
I saw that done a lot.
 
I'll need to research it, but I doubt there's a mechanism that lets me insert links to arbitrary things (i.e. non-headings) into toctrees
How could I manually create it?
 
Well, yeah. But I'm not sure how to insert a link to a class/function definition into a toctree. AFAIK they can only link to documents?
 
No insertions - entirely manual...
no toctree
 
11:06 PM
That's a table though, not a tree
 
Yep. The main one I'm thinking about was in a table with two columns that looked like a toctree, but each link was individually edited and curated.
not elegant, but it worked.
 
The thing is that I'd need to maintain the table and a regular toctree, because I need the toctree for the "previous"/"next" links to work. That seems like a pain to maintain
Maybe I should just add some text + a heading to each function/class
 
That's what I did. I hated doing anything manually that was easily automated.
 
nothing's easily automated with sphinx :(
 
11:27 PM
Maybe "automated" is the wrong word. You can get a lot of really good, well-structured documentation written in a DRY manner with sphinx.
And I want to say "with minimal configuration..."
 
11:40 PM
I admit, sphinx is pretty good at some of the stuff it does
I need to get some sleep, good night
 
11:51 PM
rhubarb
 
00:00 - 19:0019:00 - 00:00

« first day (3517 days earlier)      last day (1417 days later) »