« first day (3658 days earlier)      last day (1273 days later) » 

12:07 AM
@Skyler: sure thing, just for next time, good to state more context.
More shocking Python SEO wars/coder-school misinformation: my #4 Google hit for "python f-string round-down float" is Kite - Your programming copilot: "How to truncate a float in Python" wrongly says that .2f truncates rather than rounds a float.
 
 
1 hour later…
1:23 AM
This is a good kata: Efficiently find all the Pythagorean triplets where all numbers less than 1000. I was also wondering about approximate big-O complexity of each approach. Tree-based generation of primitive PTs, then searching for multipliers k, is probably optimal.
 
hello
somebody here ?
 
@laticoda What's your question? (You can always post, if there are few here people will see it in their morning and respond then)
 
hi
i walk on github and google to find Websocket + notifications examples working with Quart.

I want my server to pop up notifications to targeted users when for example if they received a message, or if a player is being attacked, or if something has been modified in database.

What i have found for now doesn't help me : too short or giant example, nothing really pedagogic and pragmatic.
 
 
1 hour later…
2:53 AM
cbg, so where can I find the "ask core devs" on YouTube (discuss.python.org/t/…)
nvm its posted on a different channel, for anyone else interested youtube.com/watch?v=gXMdfBTcOfQ
 
 
3 hours later…
AAB
6:07 AM
Hi all,
need some advice
I use scrapy to get some product info from a few websites
I need help on how I should store this information
given that the user is going to search by specific product name
Is it better to store this info in elasticsearch rather MySQL and regex to search and get results.
This is a personal project to just learn a few things.
Which would be the better choice?
Also when I do store the documents/rows in a respective database is using uuid for each product a good way to proceed? or I can use product name + vendor name?
 
@roganjosh - you've created a monster gist.github.com/ptmcg/20d1076e24b259aa8418f7088f670fd8
 
6:30 AM
Fortunately, I use my powers for Good, not Evil (at least, so far)
@AAB - for a personal project, and to just get something working, I would start by storing the information in a very simple structure to start off with, like sqlite or a CSV file - something easy to browse with an editor or simple viewer (like this one for sqlite). I've not worked with elasticsearch, so I can't say how easy it is to get data in or to browse what you've got in it.
And for a personal project, just go ahead and try product+vendor for a while, then maybe add a uuid primary key and see how things get better/worse. Trying and seeing how different alternatives work is right in line with your goal to "learn a few things".
Once you have some data collected, I've found Jupyter Notebook to be a nice environment for trying different Python expressions to select and join data - easier to just try changes than using command line edit in the interactive Python interpreter.
 
 
3 hours later…
9:12 AM
can anyone check and let me know if argparse.ArgumentParser(allow_abbrev=False) works fine 3.9.0?
the same code works as expected in 3.6.9
 
why can't you check it?
 
import argparse
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument('-S',action='store_true',help='Save to directory')
parser.parse_args()
sorry that came of as being rude, I did check it and this how it differs in mine
>python delete_1.py -S

>python delete_1.py -SS


>python3 temp.py -S
>python3 temp.py -SS
usage: temp.py [-h] [-S]
temp.py: error: unrecognized arguments: -SS
the first two lines are from 3.9, the second is from 3.6.9
 
ah, so "check" -> "confirm"
 
the 3.6.9 is on a ubuntu vm, but same code in both
yes, choice of words
not my first language :)
 
no problem, I might get around it after lunch if noone is faster
 
9:18 AM
thanks
 
AAB
@PaulMcG thanks I have tried storing the data as JSON file. I will see how UUID or product Name + vendor name works on MySQL or SQlite.
 
10:27 AM
Hi there guys. Anyone here fluent with Regular Expressions? I got a problem with my regex, and I simply cannot spot the flaw in the expression. The RegEx focused chatroom seems pretty dead, so I thought I'd try my luck here. Thanks in advance!
The RegEx is going to be used in a Python program though, so in that way it's relevant.
And to note, the expression has positive lookbehind, capturing group and a negative lookahead paired with another positive lookbehind, if I'm on the right path.
 
@Matrix166 You can just post your query here. There's pythex.org which might be helpful.
 
@sha
So, I'm trying to match certain urls. I'll write down the two cases.
www.examplesite.com/city-atlanta/
www.examplesite.com/city-atlanta/contacts

The one thing that is consistent in every url is everything up to the '-'. So every url has 'www.examplesite.com/city-'
What I don't want are the urls with 'contacts', I just want to skip those urls.

My regex that is still matching the urls with contacts.
(?<=www.)(.*)(?=\/)(?!\/contacts\/)
 
@ChrisP you should wait 48h before posting a question here: sopython.com/chatroom
 
And naturally the urls have the last backslash, so the urls do look like: www.examplesite.com/city-atlanta/contacts/
I mean slash, not backslash.
 
why use an unreadable and complicated regex instead of a while loop and a simple if statement?
 
10:39 AM
Hakaishin, because I am crawling scrapy. I'm using a sitemap crawler, that loops through every url in a sitemap. The sitemap_rules function is limited to using regex. Of course I could just crawl each one of the urls and then just skip/remove the one's I don't want to process further, but that causes useless traffic for the end site and my crawler.
crawling with scrapy*
 
10:52 AM
So I'm probably just blind for the simple flaw in my regex. I'm not too good with it but I've got by so far.
 
user12867493
For some reason, I can't use pip even though I downloaded it with Python.
 
user12867493
And typing python in command prompt brings me to the Microsoft Store page for 3.8.
 
11:21 AM
@Matrix166 so you want all urls that end with city-something/?
 
@python_learner Yep, correct.
The info I need are in that page, I have nothing useful over at city-something/contacts.
 
r"www.examplesite.com/city-.*/(?!\w)" you can try that
this will fail to capture something like www.examplesite.com/city-atlanta/xyzabc which may or may not be what you want
 
Hmm, let me try it out
Yeah, it does match the ones with "contacts" :/
I only want the ones with www.examplesite.com/city-[insertcityname]/ .
@python_learner
 
it should match only that
 
Hmm. Did you apply any regex rules to your regex?
 
11:30 AM
can you paste the line where you use the regex?
 
sitemap_rules = [
('www.attendo.fi/yksikot/attendo.*/(?!\w)', 'parse')]
That's the real URL I'm crawling, but it's formatted the same.
 
you need the r before the quote
 
Oh shizzle, a second
 
r"www.examplesite.com/city-.*/(?!\w)"
 
The crawler is running, I'm back with results in a second
Yep, still matches the ones with contacts (yhteystiedot)
https://www.attendo.fi/yksikot/attendo-jaspis/yhteystiedot/
 
11:38 AM
I am sorry :( I have to go now, will ping you later if I can find a regex
 
No worries dude, thank for the help. I already figured out a workaround crawling method for it (other than sitemap). Have a nice day! @python_learner
thanks*
 
you too
 
try attendo-[^/]*/(?!\w)
 
@Aran-Fey Thanks, trying.
Yep, that's it! No more 'yhteystiedot'
Thank you so much. So the part that fixed it was [^/], it seems?
 
yes, the .* you had matched the -japis/yhtehstiedot part of the url
 
11:47 AM
Ah. Thank you so much! Is there any way I can give you upvotes/respect from the chat?
 
nope, don't worry about it
 
Alrighty. I'm back off to finish the crawler. Cheers, and have a nice day! :) Also thanks for the effort @python_learner ,whenever you get to read this.
 
12:09 PM
Anyone feeling Flasky at the moment to help me with this question I posted yesterday? https://stackoverflow.com/questions/64448100/how-to-extract-values-from-the-wtform-fields-in-python

I don't know how to extract values that users enter in the form field.
 
12:30 PM
anybody able to identify why this line wouldnt be working appropriately I am trying to validate this data entry dpaste.com/8D3TN5P3W using a custom validator dpaste.com/EZ9L64CB9 and dpaste.com/G5FN9GTJN and when entering the correct selection aka 1 Hour or 1,5 Hours it raises an error... cannot figure why I have also tried it with dpaste.com/DX6CPSZV9
and checked the type of both the data and the comparison both of which are strings and cannot figure why it isn't functioning... The idea is to only allow 1 Hour and 1,5 Hours selection
but right now not allowing any
 
12:52 PM
Wasnt comparison was operator changed from or to and and works well
 
erm...
 
o.o
 
chaning it to and will just accept anything.
 
just realized
on testing 0-0
 
self.lengthofclass.data != '1 Hour' or '1,5 Hours' should be either self.lengthofclass.data != '1 Hour' or self.lengthofclass.data != '1,5 Hours' or self.lengthofclass.data not in ('1 Hour', '1,5 Hours')
 
1:00 PM
cbg
 
First took a look into seaborn after using matplotlib for a while and I gotta say matplotlib is extremely hard to use besides basic plots lol
Studying statistics in school -> boxplot
Looking into seaborn -> boxenplot() :O sorcery
Seaborn makes making charts easy and much more flexible for the average user
So beautiful these charts :')
 
1:53 PM
morning cabbages, folks. Late this morning because I had to put out a fire even before I started the day
 
Inspector, potato?
What caught alight?
 
all good, melons.
So here's a sample of the cross section of my life right now:
living with gf, work from home, running my personal media server, writing a textbook reader application for a friend
a friend gave me some media to add to my server. The attempted USB HDD connection caused the raid array to die, and the server wouldn't boot back up because of how the raid array died. So at about the 30min late-to-work mark I decided to power down and head into "the office" (the second bedroom with desks)
so nothing earth shatteringly bad, but I'm still trying to figure out what the yams happened there. The sad thing is that this server controls my music, so I'm music-less right now
(yes, I know I can spotify myself on this computer/phone... but I want my gear to work!!!) :P
 
I'm glad all is banana. Wow, artichoke. But honestly, I had a look at your's and a few other peoples' profile and website over these days, and I do hope to become as good as you guys One Day. And don't worry about the stressful times, everything will ease out eventually.
oof, sprouts Insepector, wait, so the Hard Drive is corrupted?
 
ah, thanks. I'm not too worried (just frustrated that this took 90min of my morning). Btw, I can't speak for the others here, but I'm very much the village idiot (I'm actually asking my boss for a change to that title). One of the reasons I hang out here is that the people here are fantastic teachers, and I learn something new from them every day
I don't think the HDD is corrupted. I think it's more that the raid array (software raid) didn't mount the drives in the correct order, which is causing some issues. I'll try again at lunch
 
Yeah Inspector, I take it you're the person who also likes to get things done during the morning vibe.
Laurel, what is the time at your place?
 
2:06 PM
I don't like idle time. I personally find it very difficult to sit still and do nothing ("waa! I'm not being productive")
it's 10.06h here. How about yourself?
 
Yeah, everyone here on the chat is really accommodating. They give me new insight every day. I am glad to be here. Even me, I also cannot sit around and do nothing.
It is 4:07p.m.
where are you from Inspector?
Well, honestly speaking though, I really do relax when it's holiday time. Laurel, I relax a lot.
This year we closing university on the 23rd December.
 
ahh, I subscribe to the mentality of "work while you work, and play while you play; and always finish work before you play"
 
HI Jaya.
Inspector, that's too good! Precise explanation.
 
shall I ask doubts here
 
2:11 PM
@Destroyer-byte ethnically from India (family's still in Chennai). Identify with and live in Canada. How about yourself?
@Jayashree: by all means. Just ask your question, and anyone who is able to help will usually speak up. Also, you seem new here - you might benefit from reading the room rules
 
Wow, I asked because I had a feeling you were from India, I wanted to confirm it. I am from South Africa Durban. I lived here my whole life (18 Years).
Jaya, you may ask all questions in mind.
 
@Destroyer-byte right on! I sadly know nothing about Durban. What are the top three things I should know?
 
I was actually doing a bit of reading online. About AI and stuff. I wanted to know, just a normal question (I'm not too sure how to phrase it), How does one get a machine, to respond to code- or better so- How does code control a machine? Like, are there drivers or devices or something else to make code control machine?
 
by "machine", do you mean "computer" or something more like a robotic arm?
 
Laurel, Canada is a beautiful place from all the images I've seen, Durban- hmmm, top three things I'd say is 1.) Food, 2.) Nature (Seaside, etc), 3.) Since you're India Born, I take it you're religious, therefore places of Worship.
yeah, like that.
 
2:18 PM
@Destroyer-byte another south afrian lol havent been back in 7 years now
 
I'm not particularly religious myself, but I do appreciate the cultural aspects of bringing people together
 
I was actually so interested and it kept ringing in my head- howw?? I saw humanoids and stuff, and like how is that possible. What converts our code and neural network into signals that makes an actual machine walk, etc
Kwss, that's cool!
where are you based currently?
 
Spain
 
Durban sounds nice. And with a half a million people, that sounds kinda like Ottawa,Canada
 
Wow Kwss. That's so cool.
Laural Inspector. Yeah Durban is nice.
IT is really fascinating.
Have you guys done IT from school days?
or were introduced to it in University?
I am going offline for a bit.
Rhubarb Inspector. Rhubarb Kwss. It was nice talking to you guys.👍
 
2:34 PM
@Destroyer-byte very little in school. Switched from biology to computer science in undergrad. Stuck with it in grad school
 
2:50 PM
Does anyone know what the integer returned by the following line means?

open('essay.txt', 'w').write('eyyyy')
oh seems to be the length of the written text
 
Yep, you figured it out. For the record, the official text:
>>> help(my_file.write)
Help on built-in function write:

write(text, /) method of _io.TextIOWrapper instance
    Write string to stream.
    Returns the number of characters written (which is always equal to
    the length of the string).
As usual I will now rant about the difficulty of finding information about the fie type(s) on the online docs
I know exactly what I'm looking for and it still took me ten minutes to locate TextIOBase.write
And I'm still a little salty that you can do help(file.write) in 2.7 but not in 3.x
I have to actually create a file instance with open, it's just not right
 
3:14 PM
@PaulMcG Nice passing of the blame of monster-creation, there :P
"Could you give me some hints on how that works please?" --> "Fine I'll just build a V2.0 with 3x more talons and some acid for blood. Look what you've done!" :P
 
3:42 PM
I am reminded of the webcomic Girl Genius, which takes place in a setting where you can't throw a rock without hitting three mad scientists. At the slightest provocation one of them will be inspired to create a doomsday object, simply to see if they can
You'll be spending a lazy saturday at the cafe, complaining to your friend about the static cling of clothes straight out of the dryer. Someone in the background says "ah ha!" and dashes off. Three hours later half of downtown has been engulfed in an electro-punk katamari.
 
3:55 PM
ah ha! dashes off
 
Well this is going to be a tense few hours...
 
It's a PG-13 comic and has about two off-screen deaths per decade. Unfortunately, our own reality is not PG-13, so somebody should probably go foil MisterMiyagi's plans
 
4:19 PM
@roganjosh Did you try running it? It has different output.
 
I have indeed :) There's something a little ominous watching it run
And it comes complete with ghost sounds OOo,OoO,ooO,Ooo,oOo,OOO,ooo,oo
 
Oh bust, it gives it away!
 
Ack, I missed the reference. That's totally on me; brain is slightly disengaged
 
 
1 hour later…
5:29 PM
is there a dupe target for using if...else inside a loop, instead of for...else with an if inside?
 
if...else inside a loop is not necessarily bad
 
I think MM is referring to the indentation error
 
If you are referring to the common antipattern resembling the following, I wish there was a target:
#querent's actual design

for item in seq:
    if item == x:
        return "found"
    else:
        return "not found"


#querent's desired design

for item in seq:
    if item == x:
        return "found"
else:
    return "not found"
 
Kevin's crystal ball might be on point
I think we have a canon for that
 
Although the desired design doesn't necessarily require an else unless they're using break instead of return
 
5:32 PM
I had no idea this is what Miyagi meant
 
Oh, my interpretation was the typo version:
for item in x:
    if item == 'this':
        print('hello')

else:
    print('bye')
 
but that would be the other way around compared to what he said
 
Oh my, I feel bad for wearing out everyone's crystal ball now. Kevin is spot-on.
 
Indeed. I've re-read and your/Kevin's interpretation seems closest
 
hands out imaginary cookies to all participants anyways
 
5:36 PM
/me imagining eating cookies << actually eating cookies
 
"A dupe for using X instead of Y" could be interpreted to either mean "a dupe where the asker incorrectly uses X when they should be using Y" or "a dupe where the answerer recommends using X instead of the asker's original Y" so roganjosh's interpretation is valid in my book
 
Wait, Kevin is half-spot on. There's a break, not a return in the if.
 
This chatroom uses cookies. By participating in the discussion you are agreeing to our use of your cookies.
 
I suspected your specific use case had a break, but the dupe target in my own heart uses return, so I selfishly posited that one instead
 
The value proposition of closing many dupes by rule of thumb might trump that of closing some dupes accurately.
 
5:43 PM
The value of even bothering to find dupes at all to most dupes is questionable to me
Most are now "I did a code but it doesn't work. Please help" and until recently I would dupe them if the body of the question actually was a blatant dupe. That's not a useful signpost and I could easily just close as too-broad
 
For me, a good post-hammering is as satisfying as, and as useful as, popping bubble wrap
 
I am still holding on to the romantic notion of SO being full of Renaissance Men interested in solving their problems by understanding the most general case known to mankind.
Give or take gender neutral terms.
 
@roganjosh except you can single-handedly close a dupe and delete it all the same ;)
although too broad gets roombaed more easily
 
My preferred gender is "perfectly reflective hovering orb" but I guess I'm a renaissance one-of-those, sure
 
@AndrasDeak you might be able to single-handedly close a dupe. <cries>
 
5:50 PM
Welcome to room/6, Renaissance Others, Renaissance Women, Renaissance Men and Renaissance Orbs.
 
Guys, what diameter should by orbsona be? I want it to reflect some underlying property of reality, like the planck length, but I want to be big enough to be visible and small enough to fit through doorways.
is there, like... A planck-mole or something, that would probably be a meter or so...
Nope, a mol of planck lengths is about 1e-12 meters, so that's no good
 
light-nanosecond perhaps? (thinking of Grace Hopper)
 
The historical definition of a second, and by extension the current definition of an atomic second, relates to the duration of the rotation of the earth, so it won't be meaningful when I go on interstellar journeys. Even converting from base units to nano units is culturally dependent because I can't assume all aliens use base 10.
 
I thought orbsonas generally pulsate when communicating etc. so wouldn't you have to be at a perfect resting state ("dead" - whatever that means here - in a perfect vacuum) for anyone to be able to recognise it as some unit?
 
6:08 PM
I abruptly return to hibernation state whenever I want to end an awkward conversation, so the science team has plenty of time to measure me with calipers then
Me: So how's the wife?
Him: divorced from me, same as last year.
Me: Oh, right... My cosmic energy stores are low, let's talk later. [My surface turns matte gray and I clunk unceremoniously onto the ground]
 
Ah, that is convenient. At least you're able to animate during discussion rather than it be questionable for the observer that they're just seeing an innocent bubble blown by an alienling + hallucinating a voice.
But then again, it does call into question what they'd learn from this strange examination that reveals your diameter is based on universal constants... rather than just asking "what the hell are you?" and you explaining
 
True, it would be hard to be both "frustratingly oblique" and "makes small talk at barbecues"
 
6:23 PM
cbg all, bugrit.
 
Unless it's obvious that I'm trolling the officials. The guys at area 51 keep asking me how my surface is impenetrable to conventional weapons, and I tell them that's a boring question and phase through the floor. They find me a week later 90 miles away at a craps table in Vegas.
 
@holdenweb cbg
 
eventually they give up on containment/interrogation and just follow me around with a van full of spectrometers and stuff
 
brief cbg all - what fun have I been missing out on?
 
Perfectly spherical fun, the best kind
 
6:27 PM
if we anger him it will also be in a vacuum
 
@AndrasDeak well once @roganjosh gets "their rear in gear" and gets a gold badge :p
 
@JonClements and I'm delving into Python obfuscation
 
because...?
 
it was there
 
PEP 622 seems to be considerably ahead of you on that one ...
 
6:30 PM
The snark! it burns!
 
I learned today it's now been split into three further PEPs, and today someone added a PEP to use ? as the dummy variable.
 
I would prefer ?? to reduce ambiguity
 
@Kevin seems Omnath didn't last long :)
 
I'm guessing this is from former Ruby-ers? Aren't bool methods in ruby ?-terminated?
 
Ruby has ! to indicate in place, and ? that it should be boolean
 
6:33 PM
@JonClements Yeah, it's too bad. I've been fond of the character since his original card.
Hopefully the ban doesn't decrease his chance of getting yet another version with yet another color combination. I suppose it didn't stop Jace or Teferi...
 
@PaulMcG so something like: something = 'bob' then something.upcase returns a new uppercase string, but something.upcase! is in place
 
I only looked at ruby for a week or so, but didn't care for the ()-less method calls (among other things that escape me atm).
 
Parentheses are optional* in lambda calculus, which is basically the granddaddy of functions, so they should be optional in programming languages too :^)
(*provided the result is unambiguous)
One horrifying consequence of this is that print "Hello, World!" would go back to being valid syntax
 
I like somethings about Ruby but somethings I don't - but that's the same with most languages after you've written in a lot over a decent portion of time I guess
 
@JonClements I suspect it's unlikely to happen :/ How's the pup, anyway? Not seen much of you recently
 
6:47 PM
@roganjosh the pup's been rather unwell with a virus that's going around or something... he's on the mend though, although more tired than they should be...
ahh yes... I remember what bugged me about ruby that made me ponder things about it... implicitly implied return values
 
Yes ^^^
 
Oh dear... I hope you return to full power shortly.
 
Oh no :( Glad to hear you're on the mend, though. I prescribe caffeine and I was almost a doctor of the non-medical kind, but you can trust me
 
def f(x)
  x + 2
end
so since the x + 2 is the last statement, if you do f 2 your result is 4
and does f 2 even look like a call anywhere!!!?
 
If me and the boys wanted a lambda, we'd've written a lambda
 
6:51 PM
seems a weird mix between VB and Haskell
@roganjosh did the blue potatoes survive? :p
 
On the other side of the aisle, I was bothered by lua the other day because expression statements are illegal. 2+2 is not a valid lua program, for instance.
 
irb(main):001:0> def f(x)
irb(main):002:1>   x + 2
irb(main):003:1> end
=> :f
irb(main):004:0> f 2
=> 4
 
I messed up on the blue potatoes. I forgot to add extra soil for literally just a couple of days when it was really nice weather and they started growing at a crazy rate (that's not a good thing for potatoes, you're supposed to chase their attempts at sprouting leaves by burying them a bit more each time)
 
that just seems - I don't know - so weird
 
You can imagine my furstration using a repl that refuses to evaluate an expression unless it's inside a print call
 
6:53 PM
@JonClements f f 2 ?
 
irb(main):005:0> f f 2
=> 6
 
> 2+2
stdin:1: unexpected symbol near '2'
> print(2+2)
4
>
 
Hard to imagine how that parser is not ambiguous, but... ruby has been around a while.
 
@roganjosh yeah, the "you're doing so well - don't worry... deeper you must go for your efforts!"
@PaulMcG You still can do f(2)...
 
I wonder if f(2) bothers rubyists the way while(True): bothers me
 
7:12 PM
that's interesting. Does Ruby have a concept of named params like python does? If so, would this (ugliness) actually work? print 1 2 'sdf' sep=' | '
 
@Kevin how about while 1: ?
 
Eurgh
 
@inspectorG4dget from what I remember you have to def(a:, b:, c:) or something like that
and then you actually have to use ()'s
 
@JonClements see, now that gets to me. I appreciate the artisticness of how Ruby lets you say the same thing in many different ways, but that's exactly what I think code shouldn't do
 
So...
irb(main):032:0> def f(a:, b:, c:)
irb(main):033:1>   a + b + c
irb(main):034:1> end
irb(main):036:0> f(b:2, c:1, a:5)
=> 8
but you can also do:
irb(main):038:0> f b:2, c:1, a:5
=> 8
 
7:27 PM
I guess the absence of ()'s allows you to write code like top_50_orders = clip 50 sort max 'order_total' filter 'date > today-30' query "select * from customer_orders"
 
7:38 PM
If query, filter, sort, and clip returned suitably callable objects, you could do proper SELECT/FILTER/SORT/CLIP process ordering: top_50_orders = query "select * from customer_orders" filter 'date > today-30' sort max 'order_total' clip 50
Back to our fluent API discussions from the other day
 
7:51 PM
Or in littletable-ese: top_50_orders = customer_orders.where(date=Table.gt(today-30)).sort("order_total desc")[:50]
 
@PaulMcG reverse fluent? Tneulf?
 
@PaulMcG I am quite curious to understand the use-case that motivated you to build littletable. It seems the design philosophy (spanning Pandas and SQLite) understands the existing tools and, for that to be the case, you have a decent-enough grasp on both of those yourself. Is it a specific segment of SO questions or some real-life experience that motivated you?
I can see it on IoT devices but, for example, an RPi is powerful enough to deal with pd.DataFrames (to an extent). I'm curious to give it a whirl, but I can't quite find where I could do it in an actual application and justify not using either Pandas/SQLite (that I already "know"). Or maybe I'm not the target audience
 
8:07 PM
A couple of factors. 1. At the time, I was trying to learn ORMs, so I started by trying to write one. 2. I have long disliked the split in db APIs that treat the table and DataSet objects as returned from select as different things, so littletable returns new Tables (yes, bad on memory bloat, but remember it's called little table). 3. Growing annoyance with those responding to "how do I process a CSV?" questions with "Just install pandas and then...".
To my knowledge it has only gotten one real usage in the wild, that of keeping a simple fast-access product catalog for a niche web service. Refreshed from a static CSV file once per hour or once per day. Nothing you couldn't do with SQLite, but you can skip the table column design and just start throwing records into a Table.
 
Ok, on point (2) I might see a use-case for me in this kind of situation where I'm pulling raw data via an ORM and then immediately converting to a DF. I suspect the ORM is far too embedded at that point for littletable to be something other than a curiosity... but I might actually have an application in mind for it based on that
 
So because where returns a new Table, you can immediately call sort or other Table methods on it. Since Table is a wrapper around a list, indexing and slicing are available, and they give you a new Table. Table indexes can help you do joins and pivots, and also support syntax like employees.by.emp_id["12345"] to give the matching employee (if emp_id is indexed uniquely), and employees.by.postal_code["12345"] will give you a new Table containing just the matching employees
 
Actually, I have a use-case in mind. It's crystallising in my mind so I won't elaborate but I might be putting it through its paces soon :)
 
I've been playing with different data sets. The 'iris' data set is easy and fast to work with. Also poked at some geonames data sets and some Federal Election Commission donors list data sets. It's not terrible in speed up to about 1 or 2 million objects in the Table.
 
@PaulMcG does the "single match" case not return a Table?
 
8:17 PM
If the index is unique, it returns a single object or raises KeyError (like a dict). If the index is not unique, it always returns a Table, whether n, 1, or 0 matches (like a defaultdict(list) might).
 
sP_
Hey all, had a quick dumb question - what's the python equivalent of java's data models? When I say data model in Java, I mean these - javapractices.com/topic/TopicAction.do?Id=187. Looking for examples or topics to look into. TIA!
 
@PaulMcG So you have to know your, uh schema? to know whether tab.by.col[thing] returns a table or other?
 
Yes. Typically, the choice of col will be a hint
 
I see
 
@sP_ dataclasses perhaps?
or namedtuple looks a little closer (though you can define a dataclass to be "frozen")
 
sP_
8:33 PM
@PaulMcG Thanks for the pointers, dataclasses seems to be what I was looking for. I'll read about these.
 
@roganjosh Even if you end up not using it, it might be an easy prototyping step to help get your head around the app and the data, and then convert to SQLite or some other.
 
@PaulMcG The problem that I have is that prototypes might necessarily have to include the infrastructure to do more, in order to be an MVP. Where I potentially see it fitting, for me, is in a chain of API calls where the data is transient but does need modification, and it be usable there. I still suspect I'm not the target audience but I do want to give it a try
 
9:02 PM
I want to edit the tag for a Python library I work on, `hy`, but I don't have enough rep to do it outright and I can't add my edit to the queue because "the queue is full" (why on earth is it finite?). Could somebody with 20k+ rep change the excerpt to `Hy is a Lisp dialect that's embedded in Python.` and the long description to
- http://hylang.org
- https://github.com/hylang/hy
- https://pypi.org/project/hy
Uh, without the backticks. Those were supposed to be markup.
 
@Kodiologist hy
 
Indeed.
 
@Kodiologist Done. You should probably expand that tag wiki eventually with some description.
 
That was fast. Thanks!
 
No problem
 

« first day (3658 days earlier)      last day (1273 days later) »