« first day (3147 days earlier)      last day (1802 days later) » 
00:00 - 14:0014:00 - 00:00

12:46 AM
@piRSquared That doesn't sound like a real use-case to me. As I think you acknowledged above
 
 
4 hours later…
5:04 AM
cabbage
 
5:22 AM
I had a problem in trying to create a progress bar for python when using shutil.copy , i browsed a bit and got this wonderful package called "Winutils" it leverages windows's copy dialog when using the copy function. Its amazinggggg.. This is why I love python :-D
 
Hello world!
 
I know people here are much smarter than me but In case any of us fellow mortals have this requirement feel free to use "Winutils" package
@JROS Hi
 
I feel like a pleb for not using packages lul
 
What do you mean "Not using packages"
 
Oh, i was thinking you meant add-ons, but i have very few packs in most of my programs
 
5:27 AM
So , If you need to use dataframes you dont use Pandas and instead of that you use default list and dict?
Packages will save you a lot of time.
 
Ive heard alot about pandas lately, ill have to take a look at it
 
wow
 
then again what im programming currently is very basic level
 
You must be one heck of a coder to write your own implementation of things
oh.. okay
 
yes ive been very lazy
most of what i do is using no 3rd party packs anyways
i gen get around with defualt packs
can*
sad cat profile pic sums up my experience with trying to do things without packs XD
 
5:32 AM
Nice.. Good for you .. I am just lazy, I wanted to implement a progressbar , I searched around on SO and found a 90line code with threading and whatnot for a basic monochromatic progressbar , Instead I choose this winutils package , literally one line of code with the awesome windows copy dialog so saved me close to probably half and hour.
@JROS ROFL....
 
cbg
 
oh i made a custom progress bar myself using \b and \r, that took me bout 2 hours to find out that it dosent work in console rip
test
oh damn code formatting works here too
 
cbg
 
 
1 hour later…
6:59 AM
cbg
 
Hi everyone
I have a doubt regarding matplotlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_excel(r'C:\Users\rssld\Desktop\data2.xlsx')
corr = data.corr()
fig = plt.figure()
ax = fig.add_subplot(111)
cax = ax.matshow(corr, cmap = 'coolwarm', vmin = -1, vmax = 1)
Can someone explain me the last line?
Here is what I have understood so far
cmap is for colour map
it is like a spectrum and vmin and vmax are the lowermost and highermost limits for that spectrum?
I couldn't get a proper documentation regarding this and the ? thing that we do to get additional info about a command didn't help either
Any help would be appreciated guys
 
7:28 AM
@RaphX are you having trouble understanding the documentation? matplotlib.org/3.1.0/api/_as_gen/…
 
I didn't find that , I actually googled using matshow
Thanks ! @tripleee
 
sure
 
recbg
 
Just a follow up question since its not there in the documentation, what are the default values of vmax and vmin?@tripleee
If they are 1 and 0 what does -1 represent for vmin?
 
7:36 AM
no first-hand experience, sorry, just googled the function name and found the doco
"By default, the colormap covers the complete value range of the supplied data."
i.e. if you have values from -123 to 467 it will use that range (but you might want to tell it that the full range is e.g. -500 to +500)
 
Yeah I got that but what are the actual limits is what I was asking
 
@RaphX None
 
is there a difference between scopes and namespaces? I see these two words interchangeably used in python, but can't really grasp the difference between these two
 
@DeveshKumarSingh pretty big difference, if I'm not mistaken
 
Scope I know is something inside a function, or a block of code, and variables defined within it cannot be accessed outside it, but what is a namespace then
 
7:46 AM
You mean we can specify vmax as large as we want and vmin as small as we want ? @Arne
 
it defaults to whatever makes sense for your data and you can override it with any values you like, yes
 
@RaphX Oh yeah, not what I meant but I think you're correct. What I meant is that the default value of those two parameters is literally None
 
for a very layman approach to name spaces, think of what modules are doing when you import numpy as np. every function there is contained in np.something
 
@DeveshKumarSingh there is no such thing as a block of code in python. functions and classes have their own scope, that's it
 
Got it thanks @Arne and @tripleee
 
7:48 AM
if you know the scale is 0 to 100 but you only have values from 49 to 51 the default plot will have 49 as the bottom of the range and 51 as the top and so the plot will look like you have data all over the range when in fact of course all the dots are close together near the center
so you can explictly tell it to draw a bigger plot which reflects the real range, not just the points actually attested in the data
 
I think I should read about it before asking more questions here
 
or actually zoom it to completely a region outside the actual data if you wanted to
 
im looking for a term so i can better google my problem. Could use the assistance. basically, i want to write out an incrementing counter whenever a key changes.
 
@DeveshKumarSingh it's fine, those concepts get muddled a lot. I also don't have a good definition of namespaces off the top of my head
 
Thanks again, its clear now @tr
@tripleee
 
7:51 AM
no problem, good luck with your project
@ParitoshSingh on that level, sounds like you should encapsulate this in a class, perhaps backed by a database with autoincrement
 
lst = list('aabbccabca')
grouper = 0
start = lst[0]
res = []
for item in lst:
    if start != item:
        grouper += 1
    res.append(grouper)

print(res)
[0, 0, 1, 2, 3, 4, 4, 5, 6, 6]

assert len(res) == len(lst)
 
In particular, I have no idea what's so great about them to be included so prominently in pep 20
 
say, something like this. My question is, can i do this vectorized? also, what is a good term for "res" list here?
 
@Arne Namespaces are one honking great idea -- let's do more of those! You mean this ?
 
@Arne I'm guessing they just happened to be topical at the time
 
7:53 AM
trying to go through the first google hit I found of SW SO: softwareengineering.stackexchange.com/questions/273302/…
 
@tripleee oh, uh, nah i just need to create this column on an existing dataframe. Except that speed is important and the list could be pretty big, i am not given much context there.
 
nice you work with pandas on a daily basis
 
me? no, i generally avoid it as much as i can :P
 
@DeveshKumarSingh yeah, that one
@tripleee ahh, "historical reasons", the ol' reliable of explaining anything around software =D
 
8:13 AM
So I guess I might have been wrong in saying that there is a big difference between them.
 
@Arne let me go though it thanks :)
 
Still not 100% on board though, since they still throw the word "namespace" around in their answers without really defining it
 
sorry, jumping in, but it makes sense though
variables in a namespace are tied to the namespace, and cannot be directly accessed outside it.
that's just like defining their scope of use.
having said that, if we talk about terminology, i have no idea about the specific definition of namespace :P
 
so .. is a namespace the scope of a module?
 
uh, no. uhm, think more of the variables inside the module
actually, let me do a quick google before i continue
seems good.
 
8:23 AM
to give more context, this confusion was trigged by the question here: stackoverflow.com/questions/56355202/…
 
Dec 19 '18 at 15:20, by Arne
Has anyone here ever stumbled over a page python-course.eu? It's as far as I can see, horribly bad. I only read two articles so far, one on slots and the other on packages.
I thought the page looked familiar. The last time I read articles in it, I didn't like it very much
 
@ParitoshSingh list or df column? There's probably a smart pandas way but the naive numpy would be (col[1:] != col[:-1]).cumsum() and you probably have to restore the leading 0
 
@ParitoshSingh I think this is what you want
import numpy as np

arr = np.array(lst)
counter = np.full(len(arr), 0)
counter[1:] = np.where((arr[1:] != arr[0]), 1, 0).cumsum()
Gah, Kevin'd by Andras by seconds
 
The best kind of Kevining
@Arne I used to use MATLAB where everything is one big yamming global namespace. Namespaces are awesome. And their use non-trivial.
 
in that case I'll just be thankful that it's one of those problems that I've never had to experience
@ParitoshSingh Yeah, seems good. I'll take this definition for now =)
 
8:37 AM
Spyder uses the same principle basically. Really useful in some cases and causing confusing issues to debug in others. For example, if you copy/paste some line of code from SO into the console and don't realise it tramples on a builtin name, all of your subsequent scripts that use that builtin now won't work
 
If only we had java namespace habits :PP
 
AFAIK namespaces are everything with .name access
 
From what I could gather, namespaces contain names and scope uses namespaces to look up values to objects?
 
8:51 AM
I was too optimistic here... Anyone want to earn some points explaining the metacls.__call__ -> cls.__new__ -> cls.__init__ hierarchy or do I have to do it myself?
Ah, never mind, a proper answer just popped up.
 
guys quick question
i'll be converting all my forms to WTForms for CSRF protection
but i was wondering is it better to use
Bootstrap or flask-bootstrap and why ?
 
I don't think it really makes much difference
You can still set the class of form fields to boostrap classes
 
yes using { % Jinja macros % }
but i guess it's kinda annoying to write " Jinja macros" all the time , maybe it's not worth it
 
Also note that you don't need WTForms for CSRF protection btw
 
@Aran-Fey You come up with pretty interesting questions, this one and the bases one, but I had a question, are these questions something related to a specific scenario, or these concepts needed to work with day to day python Because a lot of these things are not really covered in many tutorials so perhaps it's something you stumble upon when you were working on something perhaps
 
9:01 AM
I mean, there's plenty of things that WTForms will help with, such as validation but you can just use flask-csrf specifically for csrf and you can add <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> in your forms
 
@DeveshKumarSingh They're definitely not day-to-day concepts... they're mostly interesting little quirks I discover while reading/answering SO questions or sometimes while coding
 
is there some reliable way to clean up (async) iterables when aborting for loops? the only thing I could come up with are some ugly AsyncContextManager[AsyncIterator[T]] stacks
 
@Aran-Fey Aaah okay, that makes sense, I thought I missed all this going through the tutorials :)
 
cbg
 
recbg
@roganjosh Aye, i had settled for temp = df['col0'].values[1:] != df['col0'].values[:-1] and then i had done an result = np.zeros(len(df['col0']), dtype = np.int32) before filling it. not familiar with np.full
i guess that should be good enough to hold up
then did a cumsum on temp
curious though, does an array with this output have a name?
 
9:18 AM
np.full was only for the sake of getting the correct shape of the output so that we didn't have to push the leading 0 back in
I'm not aware of a name for it
 
@roganjosh thank you! so much
 
@AndrasDeak ah yep, pretty much ended up going for something like that. thank you!
 
no problem
 
@ParitoshSingh actually, np.full is a worse way of doing it :P I'm making it do exactly what zeros does. Oops.
 
hehe. also, am i being overly paranoid with the .values call here? i should just drop them huh
 
9:25 AM
I don't know if it makes a difference here. There's something I wanna test, though.
 
in my crappy small df, the timeit showed no diff.
making a bigger df though, sec
%timeit "temp = df['col0'][1:] != df['col0'][:-1]"
11 ns ± 1.63 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)

%timeit "temp = df['col0'].values[1:] != df['col0'].values[:-1]"
13 ns ± 0.356 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)
len(df['col0'])
Out[110]: 320000
looks like .values is slower. not by too much but slower.
@Arne i've run into them only once before, and it was in context of lambdas and map filter reduce It helped me at the time. I suppose if you're looking for indepth explanations, it's definitely not the right place.
Slightly unrelated, but it does look like we can't make blanket statements about .values. The operation can make one faster than the other.
%timeit "np.diff(df['col1'].values)"
10.7 ns ± 1.39 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)

%timeit "np.diff(df['col1'])"
12.8 ns ± 0.208 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)
on a int column, same df.
 
@ParitoshSingh Are you looking to replace the original values or create a new column? I think I've missed that part
 
i'll be making a new column
i think the main portion is dealt with though. the speed won't matter this much at this point
the original approach was using iteration
So im sure whatever we use here will be a big improvement for them :P
 
Is this faster than creating temp?
lst = np.random.choice(list('aabbccabca'), 10000)

df = pd.DataFrame({'a': lst})

df['b'] = 0
df['b'].loc[1:] = np.where(df['a'].values[1:] != df['a'][0], 1, 0).cumsum()
 
i can test, sec
 
9:40 AM
cbg
 
cbg
 
%timeit "df['b'] = 0; df['b'].loc[1:] = np.where(df['a'].values[1:] != df['a'][0], 1, 0).cumsum()"
12.9 ns ± 0.233 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)

%timeit "temp = df['b'][1:] != df['b'][:-1]; result[1:] = np.cumsum(temp); df['b'] = result"
12.9 ns ± 0.282 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)
However, i am not sure if this is the test you wanted.
in this setup, the dataframe only lacks the b column in the first iteration i think?
%timeit "df = pd.DataFrame({'a': lst}); df['b'] = 0; df['b'].loc[1:] = np.where(df['a'].values[1:] != df['a'][0], 1, 0).cumsum()"
12.9 ns ± 1.3 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)

%timeit "df = pd.DataFrame({'a': lst}); temp = df['b'][1:] != df['b'][:-1]; result[1:] = np.cumsum(temp); df['b'] = result"
12.9 ns ± 0.419 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)
 
Yeah, that's what I was curious about, in terms of trying np.where rather than having the comparison in pandas
 
looks like absolutely no difference haha
unless i messed up
 
No, I think that answers my question :)
Although, I don't understand why dtype is ignored in np.where(df['a'].values[1:] != df['a'][0], 1, 0).cumsum(dtype=np.int32)
 
9:50 AM
it isnt? atleast for me
 
Ah, nm, the dtype is set by df['b'] = 0 and we're just replacing [1:] so it must be cast to the original column dtype
 
yep, that makes sense.
 
closed
 
By me :P
 
9:52 AM
@DeveshKumarSingh next time if a question is missing the generic tag, add it. Gold badgers can single-handedly close dupes if the question is tagged correctly.
 
thanks guys, you are quick
@AndrasDeak Okay thanks
 
don't do it to recently closed questions though, those should only be edited if the edit makes them eligible for reopening
 
@AndrasDeak I thought it was with the , but it wasn't, edited right after the close, anyways, still closed since the amount of closers
 
Yes. You'd see the gold badge next to your name in the close banner if it were hammered.
@ParitoshSingh they are superfluous, you can apply elementwise operations on Series as well as arrays
@roganjosh the where is also superfluous
it's the equivalent of if cond == True: ...
without the unexpected bugs
 
Well, the timings show this to be the case here, but I think there are instances such as with datetimes where this doesn't hold
 
9:58 AM
Timings don't tell you about superfluousness. You are passing it a bool numpy array and want to get 1 and 0.
 
So I'm always curious about making the comparison strictly in numpy rather than relying on pandas. Nothing lost by trying it
 
for np.diff, it seems like explicitly using .values edged out. i wonder if that is because im using a numpy operation? but then again, series has a diff operation too.
 
That's just bool_array.astype(int) but since you're summing up anyway you should use the bools themselves.
@ParitoshSingh yes, I suspect there's a Series.diff implemented differently (cython?)
 
could be, that would explain the difference in any case
Also, my "habit" if i can even call it that, of using .values came from a very weird bug i encountered once around using np.mean
 
probably an antipattern on your side
 
10:00 AM
Which makes me consiously favour .values when the dataframe is big.
 
an XY problem, to be precise
 
i dont think so, not in this case. it's actually another library doing something weird internally. i asked about it on SO but never got an answer
sec
 
.values will give you a copy of the underlying data if the types are inhomogeneous, maybe always
that's especially bad if the dataframe is big
 
import numpy as np
import pandas as pd

size_to_test = 100_000_000 #it goes bad
#size_to_test = 10_100_100 #acceptable with this

a = np.random.uniform(low = 5.0, high = 6.0, size = (size_to_test))

df = pd.DataFrame(a, dtype = "float32")
mean_pandas = df[0].mean()

mean_numpy = df[0].values.mean()

print(mean_pandas, mean_numpy)
print(f"difference is {mean_pandas - mean_numpy}")
#1.3421772718429565 5.5000114
#difference is -4.15783417224884
there is some different calculation for what really should have been the same operation, if i dont use .values
 
>>> mean_pandas
5.4999657

>>> a.mean()
5.499967695728799

>>> mean_numpy
5.4999657

>>> mean_pandas - mean_numpy
0.0
by the way you should drop the whitespace around kwarg =, it looks very unPEP8ful ;)
 
10:11 AM
haha aye, the no-whitespace around kwarg is a tough battle i keep fighting every single day :P
i learnt that as a habit before finding out the PEP guidelines on it.
and yep, so apparently anaconda comes bundled with a library called bottleneck
 
I've taught myself to use spaces between args, it's not that hard
 
and bottleneck is apparently used for "quicker" numpy calculations sometimes.
in this case, to the detriment of any innocent pandas user on anaconda who doesn't know better.
 
@ParitoshSingh just type annotate every single kwarg, then you're within pep8 guidelines again
i bet Andras appreciates that a lot
lol
 
haha, i mean, that's one option :P
 
The silence is deafening
 
10:18 AM
pep8 is quaking: def Function ( Argument , * ExtraArgs , Value = None ) : pass
 
Well, I give up looking for the question/answer I was looking for on why we might wanna use np.where instead of letting pandas handle the datetime. If jpp hadn't answered so many questions, I might have had some hope, but I'm not trawling 195 answers in the hope that the question even had the datetime tag
 
which is unfortunately, very very valid syntax
@roganjosh if you know the score of the answer it shouldn't be too hard to find relatively in a list of answers
 
python.org/dev/peps/pep-0008 is more of a style guide and coding conventions so if the syntax is valid but doesn't look good to the eye, python won't complain
 
yes, I know
 
@connectyourcharger Well, it was over a year ago so the score could be anywhere now and it wasn't a particularly interesting question but the results in the answer got ever-more-interesting so it probably didn't get huge attention at the time either
 
10:20 AM
ah
I can look for you if you want, I've got spare time
what was the question called?
if you remember
 
Well if I remembered that then I'd be right at it :P
 
it was related to datetime and np.where?
and who was the user?
 
But I think the search would be fruitless; I appreciate the offer though. It was a pandas question about datetime comparisons; numpy only came up in a side test to see whether it would beat pandas. The user is jpp. Honestly, though, with what I've given you to go off, you'd be asking me "is this the one?" repeatedly
 
I can't find anything for that user
Are you sure it exists?
 
FWIW, I did go through quite a number of the Q/As myself
 
Nope. As I said, it will be fruitless
 
those are his only two answers containing pandas, np.where, and datetime
 
@ParitoshSingh there's an auto-installed package that reduces precision for pandas methods??
@DeveshKumarSingh wow, thanks
@ParitoshSingh I googled "pandas bottleneck precision" and apparently I've already seen this question: stackoverflow.com/questions/53042250/…
Oh, I have a comment on the question, again not being able to repro :) Then I closed it, had no idea it took off afterward
 
10:55 AM
I'm wondering if I should open an issue with pandas about the bottleneck thing, ultimately it's a float32 shortcoming
They might want to know about the difference compared to numpy, though...
 
@AndrasDeak yeah, that question is the only reason i was able to have a "suspect" to work with. It was an absolute nightmare, because at first the error differences were tiny enough to pass by unnoticed
 
Why are you even using single-precision? :P
 
haha, it was a mix of convenience and no choice :P There was too much data for it to fit in memory in one go if i used float64
(or, you might say, not enough ram. i suppose that would be a pretty fair assessment too)
 
11:18 AM
Considering that bees have been observed to "solve" the travelling salesman problem, I can't understand why they are so hopeless at getting out of my house. I've had to release 6 in the last 2 days as they repeatedly fly into the only panel on my window that isn't open :(
 
maybe the reward for your house "node" is really high
 
they want the sweet stuff
 
I'll give them a quick lecture each time I release them
That, or just into my garden on the main road and start yelling about cost functions to maximise impact
 
hope you like tight fitting jackets :)
 
I'm doing my bit for humanity, we need the bees! I'll have a watertight defense for my actions
 
11:32 AM
what's the issue ?
 
@roganjosh apparently - wasps are useful or something as well
 
they are useful for killing with fire
 
noo, leave the poor things be.
 
@JonClements Look, we have to have sensible limits here.
 
-inf and +inf? :p
 
11:40 AM
^ Clearly no respect for the sanctity of a beer garden on a sunny weekend
 
oh... you just tip a bit of coke or something that's really sweet into the table's ashtray or something and they can have that? :p
then none of 'em worry about your beer/whatever...
 
bees doing coke...
 
that'd be amazing to watch... but just to clarify... coca-cola like stuff :)
 
Would be ok if there wasn't also a Kopparberg. And they generally seem to want to torment us, regardless of any gifts we may provide
 
12:08 PM
hey, anyone here have much experience with configparser and INI files?
 
@roganjosh mind you - it is amusing (in a way) how when the window's open these things can fly in and then just look they've got completely bonkers flying into everything
 
@JonClements I don't know how bees perceive glass tbh since I assume it is different in different spectra. But it's been quite windy here the last 2 days and they don't seem to have evolved to detect fresh air flow as a potential escape
Possibly it looks entirely different to them depending on whether the sun is on the inside or the outside of the glass
 
there's no doubt something in that... for instance - you/I would know it's glass because we know it's err, well glass...
there's no doubt YT videos of people walking into non-open glass doors and doing themselves mischieve but... then you know how foolish you've been and just open the door rather than keep trying
 
If there's a lot of visible light coming through but some of the UV and IR is reflected this would probably just mean that the glass has a bit of a tint
they can still see through and would not have evolved to handle transparent obstacles
 
@Andras ahh... so that'd reflect as something to not try to go through but the rest is clear?
 
12:14 PM
Hmm? Sorry, you lost me there :)
The human analogue is a sheet of glass that reflects a portion of red light. You would probably see the glass blue or green or whatever the complement of red is.
But it would still be transparent
 
So presumably the glass from the outside must be visible as a real barrier, but on the inside it then becomes transparent because certain wavelengths have been reflected away
 
@roganjosh no
 
I'm losing myself as well... what I took from that was... if everything I see to me is completely transparent, but there's a tint "somewhere" - might be I just avoid the tint and try to walk fly through the rest or something?
 
Transparency = light from the outside gets inside.
 
Then how are they so adept at getting in to a house but not so at getting out? Or is this a case that we're only perceiving their efforts once they're actually in the house?
 
12:16 PM
the fact that some light is reflected on the outside only means that 1. that light is missing on the inside, and 2. on the outside you see that reflection stronger
@roganjosh yes, imagine a pool of random walkers. Some will get in, and once they're in it's hard to randomly walk out.
It's a bit more complicated probably: they see through the glass, they think they can leave there, so they just try doing that without realizing they should look elsewhere. If you're in a tunnel and see a light you won't try to go sideways to get out.
 
well... I'd think what the hell's going on and look sideways but that's because I'm human I guess
 
yup
@JonClements by tint I meant an overall colour to the entire window pane
 
(well - a puppy obviously - but I'll bring myself down to your level for this sake of argument :p)
 
appreciated :P
 
That was my comment about detecting fresh air flow, which I would imagine a lot of creatures can establish would lead to an exit
So they must rely solely on light cues I guess
 
12:20 PM
It can even be a combination of the two, but if you see birght light right ahead of you, why would you go elsewhere?
 
Because I'm repeatedly bashing my head against the same place :P
 
I know for a fact that mosquitoes rely on smell+IR+visible light to find their prey depending on distance
 
- name: enable verbose mode
  ini_file: dest=/etc/setting.conf section=DEFAULT option=verbose value=True backup=yes
  tags: configuration
If i want to change another option in the config, will i have to create another name section ?
in ansible
 
@roganjosh yeah... I think @Andras is right... but you'd have thought while they're not going to be philosophers or whatever, they'd have at least as much memory retention to just go "nope - that didn't work - let's try something else thing time"
 
I think getting out of a house via the window is equivalent to a cave escape evolutionary scenario
 
12:23 PM
try and try till you get it, dang it!
 
this has all reminded me of imgur.com/gallery/Ma3ivtg
 
I'm going to take a wild stab at that since they don't really live that long - then it doesn't really matter as you're going to be replaced by others anyway kind of thing... they then repeat the same and so on and so forth...
 
@JonClements or perhaps they are philosophers and this is part of bee tradition to reach Nirvana and I'm denying them their trial
 
and i just realised that i didnt know till now that bees could collide.
the bee movie was a lie all along! cries in a corner
 
@Paritosh you do know how to get out of the corner right? You're not going to keep running into the furniture or walls or something... we've only recently had this room re-done and all that... :p
 
12:32 PM
crying intensifies
 
poking holes in the drywall with his horn
And alicorn is a pain to get out of fabric.
 
despite a fascinating discussion... I've gotta get back to work... rbrb for now guys
 
rbrb
 
rbrb, Jon
 
oh poop... that wall doesn't work, going to try it again... nope... going to try that other wall... nope... ow ow ow! must be close - going to try that first wall again... :p
 
12:35 PM
Follow the scent of the rhubarb fields wafting in through the open door :)
 
:p - rbrb
"rhubarb fields" - very close to sounding like a weird version of a Beatle's track :p
 
You'll remember me, when the west wind moves, upon the fields of rhubarb
(I'm aware that's not a Beatle's track btw :P )
 
nope, but also "that's not the shape of my heart" (I'm aware it's not the same track you're talking about as well :p)
 
Huh, immediately followed by "you'll forget the sun in his jealous sky". Read: drop the visual cues
 
1:00 PM
And, for some reason, I happened to overlook the significance of it being sung by Sting. 3 counts of contextual relevance, I'm pretty pleased with that as I head out for a bit :)
back shortly, rbrb for a bit
 
hah. rbrb
 
1:23 PM
Hello, I don't understand the output here : >>> data = {"description": "Eu test\n\nTest unicode – "}
>>> json.dumps(data)
'{"description": "Eu test\\n\\nTest unicode \\u2013 "}'
I was expecting '{"description": "Eu test\\n\\nTest unicode \u2013 "}'
 
i cant tell the difference. im growing old :(
 
Where does come from the second backslah in front of the unicode backslash
 
What you see is a repr of a string. Try printing the string.
>>> print(json.dumps(data))
{"description": "Eu test\n\nTest unicode \u2013 "}
it's a string that contains control characters, namely \n and \u2013
and if you print that string:
>>> print("Eu test\n\nTest unicode \u2013 ")
Eu test

Test unicode –
that's what it should be
though come to think of it this might not answer your question
> As permitted, though not required, by the RFC, this module’s serializer sets ensure_ascii=True by default, thus escaping the output so that the resulting strings only contain ASCII characters.
>>> json.dumps(data)
'{"description": "Eu test\\n\\nTest unicode \\u2013 "}'
>>> json.dumps(data, ensure_ascii=False)
'{"description": "Eu test\\n\\nTest unicode – "}'
sorry, I have nothing else to add
 
yes I know about ensure_ascii, i was confuse about the double \ for unicode. I felt like i understood your answer but now I am confuse why printing the JSON would not show an additional \ in front of \n
JSON isn't suppose to escape it ?
 
the escaping is due to str, not json
 
1:31 PM
prints "parse" the strings. same as \n would become a blank new line in a print, a \\n becomes a \n because the "escaping character" was an instruction during parsing.
 
ho yes
thanks i was so confuse
thank you all
 
no problem
 
is there any way to make async lambdas?
 
async gulps
i dont even know what that means
 
def -> lambda
async def -> ???
 
1:33 PM
 
I'd have guessed that the reasoning is "just use a proper function/coroutine"
 
i dont understand async though, so i cant play or hack around with it even if i wanted to.
 
aw man, sometimes async really is some crippled bizarro world compared to sync :/
thanks guys
 
i suppose we might have to await the day im forced to learn async.
 
1:36 PM
I promise you a bright future
 
sounds like a difficult task
 
that got a chuckle out of me.
 
@ParitoshSingh its just generators all the way down
"just"
 
I can barely wrap my head around sending stuff to generators
 
it helps not to think of them as generators when you use .send or .throw
or always to think of .__next__() as .send(None)
 
1:39 PM
nope, latter doesn't help :P
 
@MisterMiyagi oh! that actually makes something "click" so to speak. I havent read anything up on async except broad strokes of how it allows you to do other things and work off of results only when you get them. The generator is definitely more "familiar unfamiliar" turf comparted to async.
 
you may want to try reading this: stackoverflow.com/questions/49005651/…
I am open for suggestions
 
that's a kilo of an answer
 
it's the abridged version, actually
 
Unrelated, did you say you were a physicist?
 
1:43 PM
I may have indicated that, yes
 
neat, thanks
 
why, how many of us are on here?
 
among regulars, probably just you and me
 
 
not sure about piR's background
yeah, he was maths+finance
 
1:57 PM
oh lookie, somebody who legitimately knows how async/await works. Quick, take a picture
 
I'm was originally studying math/physics and dreamed to be an astrophysicist. Life would lead me on a different path. If I didn't have to worry about feeding my family. I'd pick it up again.
 
ah, right!
 
I did finance on a suggestion from the girlfriend who would become my wife (-:
 
We need more physicists in here so I can gain their physics powers through osmosis
 
00:00 - 14:0014:00 - 00:00

« first day (3147 days earlier)      last day (1802 days later) »