« first day (2890 days earlier)      last day (2056 days later) » 

12:37 AM
@JonClements haven't seen this one before. I wrote an answer, but with numpy.
 
 
6 hours later…
6:08 AM
hello guys
array(1) {
["dataset"]=>
string(5843) "{"kpi":"UKG_H","filepath":[{"CU":18731,"UKG_H":8.29,"Date":"04\/01\/2014"},{"CU":20073,"UKG_H":9.25,"Date":"04\/02\/2014"}], "inputvals":"111"}" }
how to create such type of output in python?? because we cant have a list as a key in dictionary then how to create such an output
i managed to do after the string(5843) part...
 
@gadia-aayush do you really need a one-element list there? Can't you just use the string "dataset"? Anyway lists are not hashable and we don't have frozenlists, so perhaps you could use a tuple instead
 
yes i actually need a one element list
yes lists are unhashable thats why i was thinking what method can i use
 
something other than lists
 
then what should i do sir?
 
I have only the one suggestion
 
6:22 AM
please sir
 
I already gave it to you, you merely need to read it
 
tuples ?
 
while we recently discussed here how tuples are not immutable lists, in this situation I'm not sure you have another choice
 
yes
okay let me try
 
rhubarb for a longer while
 
6:59 AM
Cbg
 
7:28 AM
cabbage
 
8:17 AM
Hey guys, silly quetion but I can't think if the correct phrasing to find the answer to this question, which certainly has been asked before.

If i define a class like so:
>>> class test():
... def __init__(self,name):
... self.name = name
...
it would return the following:

>>> test('bob')
<__main__.test object at 0x0353B2D0>
Would should I add to get this output?
>>> test('bob')
<Bob>
I though it was something with def __unicode__ but I can't find it anywhere.. :/
 
this is done by __repr__ if i am not mistaken
 
Ah, yes! that's the one:

>>> class test():
... def __init__(self,name):
... self.name = name
... def __repr__(self):
... return "<Class: {}>".format(self.name)
...
>>> test('bob')
<Class: bob>

Thanks Chillie!
 
8:48 AM
@MitchellvanZuylen I'd have googled "customize string representation of class"
Or "change how class is printed"
Turns out there are quite a few duplicate questions about this topic... hammer time!
 
@Aran-Fey Why not go directly to python docs for something like this?
 
Honestly, I'm not sure how I'd find the relevant section in the docs if I didn't know where to look for it
 
closed
 
Thanks
 
Hmm, what happens when you award a bounty to a community wiki answer? Does the rep just go *poof*?
 
unclear lacks minimal understanding stackoverflow.com/questions/52328503/… Kill it with fire
@Aran-Fey Does it even let you do that?
 
I've seen old meta posts about such things being possible, but I don't know if anything's changed
FWIW, there is a "start bounty" button on community wiki questions
 
9:17 AM
11
Q: Can a community wiki answer win the bounty?

dlamblinIn a cruel twist, the person with the leading answer for my bountied question has turned his post into a community wiki answer by editing it a lot. Is he still going to win the reputation for the bounty? Also, it's not actually a substantially new answer. Had I liked it 11 months ago, I wouldn'...

 
Good, good. I'll be sending some rep Kevin's way, then
 
How does Community Wiki mode affect bounties?

Bounties are not affected by community wiki mode. When you award a bounty to an answer marked community wiki, the reputation bonus will be awarded to the user who posted the original revision of the answer.
@Aran-Fey I assume that if the rules have changed they'd change the FAQ post.
 
Oh, it's from that post. I was too lazy to read that one :D
 
10:00 AM
Hello guys, another implementation question. Which of the following do you prefer to read (py 27, I already see the f-strings comment, I'd have prefered this too) :

val = "_" + str(some_val)
or
val = "_{}".format(some_val)
 
Before you edited, I'd say format. After the edit: definitely format.
 
Well, thanks for your input. :p
 
I just deal with non-ascii all the time and actually cry whenever I see str() in 2.7.
 
10:27 AM
@Chillie There's so much Python 2 code out there that cannot handle non-ASCII stuff properly. But the people using it think it works ok because they only ever use it on pure ASCII. Then when they try to port it to Python 3 Bad Things happen. So of course they think Py 3 is bad, rather than realising that their code is broken.
But to be fair, it is easy to mess up Unicode in Py 2 if you don't have a good understanding of the various issues.
 
10:44 AM
Absolutely. I just reread the python docs unicode howto every couple of months to be sure, because it's so nice when you know how to deal with encodings properly.
 
Hey guys how do you do exception handling?
I have multiple nested function calls.
I want the whole stuff fail if any function fails.
Should I have try-except in each function, in except of each function just raise exception with appropriate message, and let top most function
handle exception and log it? Something like below:
import logging

logger = logging.getLogger()

#init()->fun()->fun1()->raises exception()

def init():
    try:  #each function has full code wrapped in try-except
        bool1 = fun()
        print("Success:",bool1)
    except Exception as err:
        logger.exception(err) #logging in topmost function
        print("Failure!!!")

def fun1():
    try:  #each function has full code wrapped in try-except
        raise AssertionError("Error in fun1!!!") #forcing dummy exception
    except:
        raise #raising exception
Outputs:
Error inf fun1!!!
Traceback (most recent call last):
  File "D:\Mahesh\workspaces\ignioworkspace6\PyExp\lang_exp\log_exc_handling.py", line 7, in init
    bool1 = exec_func()
  File "D:\Mahesh\workspaces\ignioworkspace6\PyExp\lang_exp\log_exc_handling.py", line 29, in exec_func
    fun1()
  File "D:\Mahesh\workspaces\ignioworkspace6\PyExp\lang_exp\log_exc_handling.py", line 15, in fun1
    raise AssertionError("Error inf fun1!!!")
AssertionError: Error inf fun1!!!
Failure!!!
Is above fine?
 
11:09 AM
@Mahesha999 You can do that if you need the low level functions to modify the exception message or exceptipn type. Otherwise, don't bother catching exceptions in the lowlevel functions, just let them bubble up. The general strategy is that code should only catch exceptions that it knows how to handle, otherwise it should let them bubble up to the level that does know how to handle them.
 
And also log in the top level function?
 
@Mahesha999 If your low level functions can deal with their exceptions then they can also log them, rather than letting the top level do all the work. But since you want the whole thing to fail if any exception happens, you might as well let the top level do all the logging.
 
12:09 PM
also should I have class level logger or instance level logger.
I feel it should be class level logger.
So should I always do `ClassName.logger = logging.getLogget("classname")`
and then afterwards always do
`ClassName.logger.info()`,`ClassName.logger.error()`?
anyone? :|
 
Do you gain anything from instance-level loggers?
 
I dont think so
But point is, then if I have to use static logger inside instance methods, do I have to use class name always?
that is,
ClassName.logger.info('message')
?
In java, I can use static variables directly inside instance methods.
 
No, self.logger.info will access the same method.
 
yeah...
but I need to have some prefix anyway, class name or self...right?
also is it the convention / standard / correct practice?
 
@Mahesha999 In Python, you can read from or mutate class attributes with the self syntax. But if you try to assign to them that way, it won't work, it'll just create an instance attribute in that instance that shadows the class attribute.
@Mahesha999 Yep, inside a method, you have to have a prefix. It's only in assignments outside the method definitions that you can drop the prefix.
If you want to be specific & explicit, use the class name. Using self is more flexible. It lets you switch to using an instance attribute instead of a class attribute without having to rewrite a bunch of code. And it lets you put the class attribute in a parent class if you want.
 
12:57 PM
Is anyone awake?
 
How do I check if I'm awake?
 
Great! I am going to post my question.
f = 567
 def f():
     f = 566
     print(f)
My que is very simple: after running f() I get 566and whenever I type f to view global f I get <function f at 0x0000022FDFE02E18>; how to access the value of the global f?
 
Your function and variable have the same name... It's going to cause you some problems
 
i was having trouble in sending form data by pycurl
 
:43937909 In terms of name resolution, there's no distinction between "a variable assigned to at the global scope" and "a function defined at the global scope". the f function has completely overwritten the integer that used to be accessible by that name.
 
1:08 PM
import pycurl

from urllib.parse import urlencode

c = pycurl.Curl()

c.setopt(c.URL, url)

post_data = dataset

postfields = urlencode(post_data)

c.setopt(c.POSTFIELDS, postfields)

c.perform()
this is returning nothing, i am sending my data in dataset variable...
 
@Kevin Thank you! Got it. I didn't know that.
 
\o cbg
 
Sam
1:46 PM
For any Flask devs... Should I favour defining the SQL schema of a website in a single file or split my models out within the relevant blueprints? I can see benefits in either method
 
I would document the general architecture of my database, and split the functions as normal functions in different files depending on what they do.
 
@Sam are you talking SQL or ORM-style models?
 
Sam
@RobertGrant ORM-style models.
@davidism I'm guessing github.com/pallets/flask/tree/master/examples/tutorial/flaskr. is your most up-to-date structural tutorial?
 
howdy
 
2:01 PM
howdodidoda?
 
Sam
Hello :)
@IMCoins soo, are you saying you'd define your schema in a centralised place?
 
I do. Like in a README.md or in the docstrings of your main function.
 
Sam
Wait what? I'm not sure we are on the same page
I mean as in... do you have a single models.py file which creates ALL of the applications models.. or, do you have models.py within blueprints which define blueprint specific models
 
You meant defining the creation of your database in a single function ?
 
Sam
yup
 
2:13 PM
I thought you were talking documentation wise, sorry. Well, then...
For me, you have 2 choices.
Either make a very long function and comment the code blocks to explain what they do.
Or (my prefered way)
Divide your new_database() functions into lots of functions that would each explain what they do, such as "create_user_table", "create_room_table", "link_tables(user_table, room_table)".
 
Sam
github.com/miguelgrinberg/microblog/blob/master/app/models.py. this seems the most occuring way. Single models file. Although I can imagine that file exploding for large apps
 
Why would you do...
class User(UserMixin, PaginatedAPIMixin, db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(64), index=True, unique=True)
Instead of doing:
class User(UserMixin, PaginatedAPIMixin, db.Model):
    def __init__(self):
        id = db.Column(db.Integer, primary_key=True)
        username = db.Column(db.String(64), index=True, unique=True)
 
Sam
beats me
Common practice maybe?
 
There must be a good reason, hence my question. :p
 
2:28 PM
putting those variable declarations inside __init__ means that they won't be visible outside of __init__
>>> class Fred:
...     x = 23
...
>>> class Barney:
...     def __init__(self):
...             y = 42
...
>>> Fred.x
23
>>> Fred().x
23
>>> Barney.y
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'Barney' has no attribute 'y'
>>> Barney().y
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Barney' object has no attribute 'y'
... Unless the ORM has some secret magic that lets it pluck names out of scopes that would otherwise be inaccessible. Wouldn't put it past them.
 
Barney().y would work if you self.y but i guess that wasn't your point :P
 
In my experience, user-defined classes intended to be used with an ORM usually declare their column names at the class level. Making them attributes by using self would be unusual.
 
I obvioulsy didn't put the self by lazyness, but it seems obvious that you would need to place it there.
I was wondering if that was somewhat more efficient of whatever.
 
I do
 self.logger.info("Sending Data To Client",response_data)
it gives me
TypeError: not all arguments converted during string formatting python
self.logger.info("Sending Data To Client"+response_data)
it works!!! why?
I do
 
@IMCoins It's not a matter of efficiency, they do different things
 
Sam
2:43 PM
I like this ORM
 
You should do "Sending Data To Client\n{}".format(response_data) in my opinion.
 
>>> class Fred:
...     x = []
...
>>> a = Fred()
>>> b = Fred()
>>> a.x.append(1)
>>> print(b.x)
[1]
>>>
>>>
>>> class Barney:
...     def __init__(self):
...             self.x = []
...
>>> c = Barney()
>>> d = Barney()
>>> c.x.append(2)
>>> print(d.x)
[]
 
Interesting. :)
 
@IMCoins yep, but why it fails?
 
Sam
Is it only expecting one argument?
 
2:45 PM
Does it fail with format ? You just used the , comma, not format() function.
 
@Mahesha999 You can't assume that all information-writing functions have the same interface as print(). In other words, maybe logger.info can't take an unlimited number of arguments.
 
Sam
self.logger.info("Sending Data To Client"+response_data) is calling with a single argument. Your former is calling with 2 arguments.
 
Logger.info(msg, *args, **kwargs)
Logs a message with level INFO on this logger. The arguments are interpreted as for debug().
 
@Chillie That's assuming that he's using the built-in logger module. We don't know if that's the case.
 
That is fair. @Mahesha999 are you using a custom logger or the one from the python library?
 
2:49 PM
Nope no custom logger
 
Not sure if that means "Nope, no, I'm using a custom logger", or "Nope, I am using no custom logger because I'm using the regular logger module"
In any case at this point I'd like to see an MCVE
 
Grrr. 4 answers in under 4 minutes to an obvious, easily searchable dupe: stackoverflow.com/questions/52333994/… The newbie has an excuse, but the other 3 don't, IMHO.
 
Nope, I am not using custom logger.
Normal logger from logging package
sorry for unclear late reply
:\
 
I agree with the MCVE, we also need to know what's in the response_data.
 
recbg
 
DSM
2:56 PM
Friday Cabbage for Finland and everywhere else too!
 
response_data is plain string
 
ahoy
does anyone here use -> github.com/peritus/bumpversion
I'm having a fun time trying to figure out how to preserve certain markup characters like the pound sign
 
DSM
Stupid sudden idea: what if we used ' quotes for bytestrings, " quotes for raw strings, and curly quotes for unicode strings?
 
the search and replace uses the string formatter pretty much. When I use the pound in my replace section, it just mangles everything up and breaks the replacement
anger is rising
 
Add %s where you want to put response_data and your error will disapear.
 
3:00 PM
Now that I actually read the logging documentation, I'm now completely sure that you can't just pass consecutive strings as arguments and expect them to be concatenated in the output.
> The msg is the message format string, and the args are the arguments which are merged into msg using the string formatting operator.
Here's an mcve, courtesy of my crystal ball
import logging
logging.basicConfig(filename="thelog.txt", level=logging.INFO)
logger = logging.getLogger("mylog")
response_data = "Hello"
logger.info("Sending Data To Client",response_data)
As IMCoins suggest, the quickest fix is to add format specifiers to the first argument of info()
 
Hi @DSM We have both kinds of waves here. Electro and magnetic physics.stackexchange.com/a/342622/123208
 
DSM
Heh.
 
Cbg
I'm on my mobile and there's no edit button this question for me.stackoverflow.com/q/52334338/4799172 is there a pending edit to be approved? I don't see why the link would be missing in that case though : /
 
@roganjosh there is...
 
@roganjosh Yes, there's a pending edit. I'm also on my phone, but I see a button.
 
3:06 PM
Strange. I've not noticed it missing before, I guess they've changed something else...
It's back now it's been approved, I should have taken a SS for meta. Oops, too slow
 
Now approved. But it's hard for me to see the "before" version in side by side mode, so I'm not sure how good the edit was. So feel free to make any necessary improvements.
 
just grammar fixes :\
 
I darent tackle content fixes on my phone :) I just wanted to add the pandas tag
 
I know they're modifying the edit interface at the moment, after complaints on SO meta. But AFAIK that should only affect the tag quick edit button, which is only accessable if you have 10k+
 
Collateral damage :)
 
3:13 PM
Could be.
 
Which is strange considering how conscientious and convenient all the other UI changes have been...
 
In the spirit of fairness all must suffer
 
SO, the great, welcoming leveller
 
I have a doctor's note that says I shouldn't suffer
 
Given the anecdotal quality of doctor's handwriting... are you sure it's not advising you to not "surf"?
 
3:20 PM
Or maybe it says you shouldn't eat butter...
 
Optimistic of you to assume that the intended message has even one letter in common with my interpretation
 
That leaves us with ai and cbgkjmqpwvyxz
Wow, your message had no cbg. :3
 
yeah....seems like my problem is pretty much configparser and ini files where pound is ignored. Doesn't look like I can use this tool to preserve markup characters with pound
time to think of something else
 
Be like DSM, hire a n intern minion, and get them to write/adapt that code you wanted.
 
they just left
 
3:30 PM
Get new ones?
 
3:48 PM
If you don't first repair the intern-hole that the previous one used to escape, the new ones won't hang around for long.
 
 
1 hour later…
4:51 PM
Now three comments deep trying to convince an OP that lists aren't arrays and sets aren't arrays and strings aren't arrays.
 
mmm, Dunning-Kruger is kicking in on stackoverflow.com/questions/52335559/…. I'm being asked to answer but I can't understand it more than "do this, and do this". What's actually happening with the nested with opening the file in write mode?
 
5:10 PM
I'm pretty baffled about the interaction of multiple instances of a file opened in "w' mode myself. I just ran:
with open("deleteme.txt", "w") as a:
    a.write("a")
    with open("deleteme.txt", "w") as b:
        b.write("b")
    a.write("c")
... And the file contains "ac". I don't understand how that's possible. The "a" I can accept, since maybe it hadn't been flushed to the file by the time the second open call truncated the file. But why isn't "b" in the file?
If I add a .flush() call after every write, the file contains "bc", which makes sense to me
 
wim
you know about tell ?
 
So you're saying that b was written to the file, but then c was written to the file on top of b? Hmm
 
wim
>>> with open("deleteme.txt", "w") as a:
...     a.write("a")
...     print(a.tell())
...     with open("deleteme.txt", "w") as b:
...         b.write("b")
...         print(b.tell())
...         print(a.tell())
...     a.write("c")
...     print(a.tell())
...
1
1
1
2
 
I prefer the concise with open(inp, 'w') as a and b: :P
 
wim
@Kevin you might have windows weirdness. exporting PYTHONUNBUFFERED=1 might change behaviour too.
there's a race condition here if you're buffering
 
5:24 PM
... Do OSes other than Windows not buffer their write calls?
 
wim
they do, but it's not a within python thing it's a user environment thing
 
So it seems like the life cycle of the file in Need Help Converting Tweet Data to JSON text file is:
- The first `open` is called. The file is truncated.
- json.dump is called inside the `try` inside the loop. If the total amount of data written exceeds the file object's buffer, the data is written to the file.
- The loop ends.
- The second `open` is called. The file is truncated.
- json.dump is called. The last object assigned to `tweet` is written to the file object's buffer.
- The second `open`'s with block ends. The last object assigned to `tweet` is flushed to the file.
- The first `open`'s with block is called. If any data is remaining in the first file object's buffer, it is flushed
Since the OP says that they can only see one tweet's worth of data*, it's safe to assume that the first file object did flush its data before the second file object opened
(*assuming that's what "I have a blank document with data for a single tweet" means)
cc @roganjosh
 
That makes sense to me
 
is there dark theme of stackoverflow???
 
DSM
New users lost in a quicksand of confusion. That's pretty dark.
 
5:30 PM
Oops, s/The first open's with block is called/The first open's with block ends/.
Thought I got that during composition, must've been a regression
 
Thanks for that. I don't feel I'm in a position to answer the actual question and I have a feeling it's beyond what they wanted. I'd prefer someone with better knowledge answers instead of me in case there are questions, but I do appreciate and understand the narrative @Kevin
 
FWIW I don't think the downvote brigade is going to show up if you post a barebones "try deleting that last with, that should fix it" answer
 
I wonder if it merits its own question? I was drawing blanks trying to understand
 
If you handwave away all the stuff about flushing then the technical explanation is "the second open() call erases everything written before it"
 
Eh, I'm leaving it open. I learned something, that's my bottom line. My comment fixes the issue but I'm really not fussed if it gets converted into an answer by someone else. I don't want to field questions on it.
 
wim
5:41 PM
post your answer, collect your +25 points, and delete your comment.
you are not obliged to field further questions on the answer.
this is a Q&A site, not a Q&chat site
 
I just noticed a nice self-answered question. I guess we should add it to our collection. stackoverflow.com/questions/52335970/…
 
I can't do that because if they have follow-ups, I probably can't answer them. Follow-ups are not unreasonable in many circumstances and the last thing I want to do is speculate.
 
wim
just delete your comment then. let someone else answer.
 
This doesn't feel like a follow-uppy question to me
 
Well, speculate on something that I know others are in a better position to answer.
@wim gone
 
wim
5:46 PM
@PM2Ring I was going to whine that an exception message like DeprecationWarning: invalid escape sequence would be enough context for a user to determine they were using an invalid escape sequence and it was causing deprecation warnings
But then I remembered this question managed more than 300 upvotes
 
@wim although, my comment never actually barred anyone from answering. It was also the response to my comment that initiated this discussion. As a commenter I acknowledged that it was beyond me to answer properly.
 
I have cut the Gordian Knot by writing an answer.
 
DSM
I get votes every few days because I read an error message as an English sentence.
 
@wim Maybe, but people doing that sort of stuff may not even realise that they're creating escape sequences, whether it's in a regex, or a Windows path. So that Q&A will be a useful dupe target.
 
My highest voted answer contains no information that a reasonable person couldn't work out with an empty sheet of paper and 20 minutes of thought
pencil optional. You could also fold the paper into a swan.
 
5:51 PM
stackoverflow.com/questions/34862378/… 22K views. For shame, before I understood SO properly :/
 
wim
I wonder if CPython would accept a PR to always parse docstrings as raw strings
 
For the typical newbie, especially if they've never programmed before, error messages can be pretty inscrutable, they may as well be written in Martian.
 
wim
it's always a bug if a docstring has a single backslash and it's not a raw string, isn't it?
 
That 4 year old comment has 90 upvotes
 
@wim Why do you say that? Docstrings can contain just about anything. Don't forget about doctests.
 
wim
5:59 PM
doctest are the best case of the bug, because the failing test makes you realise you have a bug
other cases, you just end up with a corrupted docstring..
 
6:22 PM
Thanks. Getting tough to beat the stray answers these days :)
 
Now on comment 4 of trying to convince the OP that array isn't a built-in type
 
Which question is this?
 
He deleted all of the code in his question that imported anything or created a variable, I think he's trying to hide his tracks
To be fair a commenter did say his code was too long. Erasing half of it is... Not the ideal response, but it is a response.
 
"Exception AttributeError: "'NoneType' object has no attribute 'path'" is now redundant?
 
wim
just ignore the tag "arrays" and get on with your life
 
6:31 PM
Either that or they clobbered os with their existing code
 
anyone experienced with sqlalchemy? I've got a feeling I'm reaching a point I should never ever reach. (20k+ character long error message)
But it boils down to: "sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly" followed by (during handling....) "sqlalchemy.exc.InvalidRequestError: Can't reconnect until invalid transaction is rolled back"
 
wim
someone clever rewrote the xkcd antigravity comic and made the guy get a syntax error with print "Hello, world!", but I can't find the parody now
anyone know where it was? was it posted in here perhaps?
 
Doesn't ring a bell
 
Shouldn't those errors never happen at the same time?
Or is this common and should I manually reconnect?
 
Given xkcd's spartan art style, you could probably photoshop a new version of the parody faster than you could find the original one
 
6:35 PM
@paul23 only passing knowledge of sqlalchemy but it might be useful to say what database you're actually connecting to
mysql, postgres, sqlite?
nm, psycopg2 so postgres
 
the internal error "psycopg2.OperationalError" would be a hint: but it's postgres. And the transaction is just a single sending.
And yes the pg server is physically located somewhere else, so I can expect an operational error (however this error seems to pop up regularly, like every 2-3 days our server runs).
 
... I guess I appreciate their honesty? stackoverflow.com/questions/52337618/…
"I didn't feel like fixing the indentation". Well, ok.
 
I'm at PyConUK; feel free to ping me on the conference slack channels if you want to chat!
 
@wim Vaguely rings a bell. It might be in here: forums.xkcd.com/viewtopic.php?f=2&t=22741
 
wim
6:52 PM
217 pages .. hmm.. nah
Deleting duplicates in a list of lists using a criteria <-- seeing this kind of thing over and over makes me think maybe python could do with an "accumulating" dict classmethod or something
...that coupled with the fact that so many people go to an inferior itertools.groupby solution
something like defaultdict(list).accumulate_from_pairs(iterable) but with a better name
 
aggregate() has long been on my wish list
 
7:15 PM
The more I read about Non relational database like mongoDB, the more I think about black magic.
 
it's all JSON
I'm more used to protobufs, though
 
7:29 PM
@MooingRawr But at least it's Web scale ;)
 
What did I just read PM ? kinda funny :D
 
I guess I should have put a NSFW warning on that...
 
but you really should have put is a web scale tag on it :D it scales .
 
wim
7:45 PM
thanks to that flagger for giving me a LOL
..maybe this feature not so bad after all
@MooingRawr which part of NoSQL is seeming like black magic to you?
 
@MooingRawr you just have to learn the correct incantations
 
8:03 PM
@wim didn't understand how it was stored, or how it function until I literally had to google "MongoDB" example. Every site I read, just describe the overall concept, but wouldn't go into the details of how things are laid out and retrieved and what not
 
wim
8:17 PM
thoughts on closing numpy question to non-numpy dupe?
@MooingRawr but which part "black magic"? do you think a python dict is black magic? do you think elasticsearch is black magic?
genuinely asking because I am wondering if mongo does something magical that I wasn't aware about
 
I didn't think MongoDB was essentially just a Python Dict like solution
I honestly thought it was just some sort of CSV excel reading solution where u append data to the row as u go along lol
that's the black magic part, cuz no one was given a reference of example until I SO [MongoDB] to see if I can get my hands on an example db.
 
9:01 PM
When using matplotlib.animation.FuncAnimation how does one clear the figure with each frame so that only what is plotted in each specific frame shows, rather than everything up to that point? I have a small script with a sample gif on my github page: github.com/dodge-ttu/Miscellaneous if anyone has time to take a look
What I'm shooting for now is just a single rotating triangle rather than a triangle that has been rotated and plotted over itself many time if that makes sense
 
@PM2Ring i have at the moment no access to numpy, so if i want a 3x3 board i guess a list of lists is the way to go?
 
9:33 PM
@Null "no access to numpy"?
@W.Dodge I suggest mutating the underlying data for a single axes rather than plotting ever newer axes. Should be much faster too.
 
well, actually, NOW i have :43943949 i reinstall python
it was 32bit anyway so i had to do it someday
my cmd did not recognize the command "pip" :(
 
That's why you use python -m pip
3.7 now?
 
it was already 3.7
but 32bit
 
Good.
 
now 64bit, and dont ask me whats the big difference, bigger number=better lol haha, (joking)
if one had a 2.x project, could it be converted to 3.7 using a script? or is it a little bit more complicated than just replacing strings?
is scipy beneficial for programming games?
 
9:50 PM
Laurel; I've been looking for a Python filea in one of my many folders, turns out random mouse clicks helps get stuff found ;)
 
@Null 2to3 does the brainless work
@Null not really, unless for physics
 
ok thanks @AndrasDeak
 
10:36 PM
Anyone know how to avoid double forward slashes graying out code in SO markdown?
It's greying out anytime I try to post integer division
 
Try inserting <!-- language: lang-python --> before your code block
 
That did it, thanks!
 
10:52 PM
When matlab syntax highlighting wasn't a thing yet (despite years of begging) we would hack comment highlighting with %// this is a comment
 
There is no dupe target for "nested list to panda dataframe": re this
 
panda
 

« first day (2890 days earlier)      last day (2056 days later) »