« first day (3735 days earlier)      last day (1216 days later) » 

3:24 AM
not reproducible/ not a specific question/ not focused/ debugging help/ pick a reason stackoverflow.com/questions/65589650/…
 
 
4 hours later…
7:38 AM
new year cbg folks!
 
new year cbg =)
 
8:09 AM
@roganjosh thanks man will do
 
 
2 hours later…
9:51 AM
cbg
 
Every year I'm surprised by the sheer number of holidays in late december and early january. I think in the past 1 and a half months, I wanted to go shopping on a holiday no less than 3 times.
"Oh, we're out of pasta again, should we go buy some?"
"Can't, shops are closed today"
"Again?!"
 
and that is a good thing :)
You might not like switzerland where Sunday shopping is basically not a thing. Besides 24/7 places
 
Our shops don't open on sundays either
 
10:10 AM
same here. I got really used to shopping on Sundays while living in the Netherlands, but it will probably never be a thing in Germany =/
 
I don't have a problem with sundays. Those happen every week, I can plan ahead for those. It's the irregular holidays that trip me up
 
cbg-ning
 
It's almost like some of these are specifically designed to catch people unawares. Take Easter for example. That's on the first sunday after the first full moon in spring. WTF
 
@Aran-Fey we had that for a short time; didn't catch on
@Aran-Fey I know in Germany there are a huge number of holidays around May
 
We should abolish holidays, then I wouldn't have this problem
 
10:22 AM
We should abolish work.
 
But that wouldn't solve my problem, I can't go shopping if nobody's at work :P
 
10:37 AM
the obvious solution is to make your own pasta
 
@inspectorG4dget Definitely groanworthy.
@Aran-Fey You really think that people would just sit around listlessly waiting for Amazon's robots to deliver? There'd be a transition back to vocations. But I appreciate that'd be a little too far outside the box for everyone to think it achievable.
Call me provocative :P
Just watched a brilliant 30-minute video by James Powell. youtube.com/watch?v=wbYG9KTxwdE Almost anything by James is worth paying attention to.
 
That title though... haven't the faintest idea what that video is gonna be about
 
10:56 AM
It's a comprehensive deep dive (with asides) into why it's impossible to create a decent proxy object in Python. Dense material extremely competently presented.
 
Hmm, I guess I should watch that... I did write a library that creates proxy objects...
 
Yes, but did you write a decent one? ;)
 
Apparently not ¯\_(ツ)_/¯
 
11:11 AM
Also holidays are such a nuissance if you work part time. I lost out on like 3 fridays this holiday season because I have free on friday :( I wish they would just add all the holidays to my vacation account and I could spend them how I please, makes much more sense
 
I think it's more about "you can't be expected (->allowed) to work on a holiday because holidays are important"
 
cbg
Can a file that's just opened in a "with" statement be appended later in the code?
 
@CupOfJava as long as execution is inside the "with" statement and the name is visible, sure
 
holiday morning cbg
 
what's with all the holidays!
cbg
 
11:20 AM
@CupOfJava it's a but unclear what you are trying to do
 
Do you mind if I post the code? it's about 6 lines.
 
@CupOfJava in that case go ahead
 
do you want to write to the end of an open file? or do you want to switch an r/w/... mode file to append mode?
 
I have a bad feeling about this though :P
i.e. using f outside the with block
(but we'll cross that bridge soon)
 
total = 0
with open("C:/test.py") as file:
    contents = file.read()
    count = contents.count("current")
    total += count
    if total == 2:
    	contents.replace('current', 'ready', 1)
sorry, 7 lines
 
11:21 AM
@CupOfJava if we haven't pointed you to the code formatting guide yet: it's here
thanks
 
sorry
 
So what's your question?
@MisterMiyagi ah, I just had an epiphany
 
I tried to write to the file with the replaced content but the file isn't writable
 
@CupOfJava did you intend to write the contents back again?
if you do a file.read() anyway, the simplest solution is to open the file again for writing.
 
@CupOfJava how you did that is crucial
When the with block ends the file is closed automatically. As Miyagi said you can just open it again in write/append mode depend on what you want to do.
If you want to replace contents in the file that's writing, not appending. Appending would not touch existing content.
 
11:25 AM
I put file.write(d) right under the replace and the replace was d =
io.UnsupportedOperation: not writable
 
with open("C:/test.py") as file:
    contents = file.read()
if contents.count("current") == 2:
    with open("C:/test.py", "w") as file:
        file.write(
            contents.replace('current', 'ready', 1)
        )
 
7 lines, it checks out
 
@AndrasDeak Do tell
 
@MisterMiyagi the holiday today. It's Epiphany.
 
This was my fix but I like yours better
 
11:30 AM
:51306103 using a with block in one place but not the other is weird. Just use it always.
 
That makes sense
thank you for the help
 
@AndrasDeak holiday translations are weird :/
 
That's interesting. I didn't know that was a holiday.
 
Germans are crazy about holidays
 
I get it, sometimes I pretend its a holiday to justify buying myself ice cream
holidays are great
 
11:43 AM
Holidays are stupid in nowadays age, especially because in most of the western world they are Christian holidays, which just doesn't make sense anymore in our multiculture/multireligious/atheist world. Better just give everybody more vacation, so that everybody can take vacation when it's their favorite holiday
 
@AndrasDeak South-Germans mostly, at least as far as today is concerned.
 
Wait what is today?
I know it's Christmas in the orthodox calendar, but I assume Germany doesn't care about that.
 
three of our federal states do
 
huh
 
sorry, my random facts of the day aren't up to speed this year :/
 
11:48 AM
@Hakaishin If you keep going west from the western world you'll eventually find yourself in a place where they don't celebrate Christian holidays
And if you keep going west from there you'll fall off the edge ;) XD
 
12:17 PM
@MisterMiyagi thats actually awesome whi h ones?
 
12:34 PM
Hi
 
@Hakaishin >Baden-Württemberg, Bayern und Sachsen-Anhalt [source]
 
I have a question about pytest
 
go ahead and ask. even if it doesn't look that way, this is actually the python-chatroom
 
assuming I have list of of strings ("Test1","Test2")
there are some actions I want to perform on each one of them
 
What library would one suggest as I would like to write a Python script for validate html pages I write on my local computer. I would like to have the output of the validation to be saved to Python variable.
 
12:42 PM
but, count each one of them as test
I saw some threads but not sure about the right answer:
https://stackoverflow.com/a/19071904/11705021
https://stackoverflow.com/a/61735109/11705021
https://stackoverflow.com/questions/21764473/how-can-i-repeat-each-test-multiple-times-in-a-py-test-run
 
@arielma pytest.mark.parametrize sounds good
@JaakkoSeppälä validate in what sense?
 
Yes, I think I'll try it and update
 
@arielma not sure if it would be counted separately but that's exactly what you seem to be looking for.
Or at least as I understood your question
 
In sense that I would like to save the output of the address validator.w3.org/#validate_by_input when I type the corresponding html page to the text field and press Check.
 
12:57 PM
@JaakkoSeppälä I suspect you could and should use their API
 
@holdenweb work is obsolete anyway!
 
in which case you probably only need requests
 
Cbg Everyone. I hope everyone is doing well.
I have been reading online now and see that the gTTS package has been not working properly for the past few weeks or so.
It has been giving an error as follows:
Unable to find token seed! Did translate.google.com change?
Does anyone know why the package has been doing this? Online articles said that Google may have changed the way that the translations are done, but another article said that the devs are still trying to figure out the problem.
 
Okay. I try it.
 
I have not come across an article that explains how to sort the issue out as yet, but if anyone knows what should be done, please let me know.
 
2:03 PM
@Destroyer-byte this issue suggests it should already be fixed
So update the library and see
 
morning cabbages, folks!
anyone know why this fails? (py3.8.5)
print(f"{n:=int(input('Enter a number to factorialize: '))} = {' * '.join(map(str, range(n, 0, -1)))} (its sum which is functools.reduce(operator.mul, range(n,0,-1)))")
 
and now you know why not to do that
I don't think it's ethical to help debug that mess :P
 
but but but... I wanna troll this question
 
Ah, a noble cause. So what's the error?
I can already see missing {} around the functools.reduce part
 
NameError: name 'n' is not defined
 
2:17 PM
I suspect the n lives inside the f-string's first format field, but that's just a hunch. Easy enough to test.
>>> f'{n:=1} {n}'
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-13-69a3be8a7617> in <module>
----> 1 f'{n:=1} {n}'

NameError: name 'n' is not defined
 
@AndrasDeak good catch, but that wasn't the root issue
oh damn! that's really unfortunate
so I did n=0 before the f-string, and now I get an invalid format specifier (probably in the f"{n:=int(input(...))}. Really interesting how scoping works here
 
print(f"{(n:=int(input('Enter a number to factorialize: ')), '= ' + ' * '.join(map(str, range(n, 0, -1))) + ' ( its sum which is ' + str(functools.reduce(operator.mul, range(n,0,-1))) + ' )')[1]}")
I can't even express how much "its sum" annoys me in that
also "5 = 5 * 4 * 3 * 2 * 1" ugh
I'll just delvote it
 
my eyes
what have you posted there
 
homework solution :P
 
oh, phew. okay, carry on :P
okay, i scrolled up and got the context. that's surprisingly evil
 
2:24 PM
I'm so sad that I'll probably need to hack this with globals()
print(f"{globals().__setitem__('n', int(input('Enter a number to factorialize: ')))} = {' * '.join(map(str, range(n, 0, -1)))} (its sum which is {functools.reduce(operator.mul, range(n,0,-1))})")
heheheheheheeheheheh
 
But then you get None = ...
 
ahh, fml! Small change:
print(f"{globals().__setitem__('n', int(input('Enter a number to factorialize: ')))}\b\b\b\b\b{n} = {' * '.join(map(str, range(n, 0, -1)))} (its sum which is {functools.reduce(operator.mul, range(n,0,-1))})")
I'm really bummed that I can't use an asspression in an f-string
in other news, does anyone know how to join tableA with tableB on A.a = B.b where A.a is an integer and B.b is a jsonb, which in this case is just json.dumps(5) # or some other python int?
 
2:41 PM
convert the datatype of one column and then join?
@inspectorG4dget NameError: name 'functools' is not defined
 
well, I did assume as import functools
 
that's one line too many!
 
/rolls-eyes fiiiine... I'll add __import__('functools') in there
@ParitoshSingh that's what I'm trying to do... unsuccessfully. Any chance you could show me some example code that I can learn from?
print(f"{globals().__setitem__('n', int(input('Enter a number to factorialize: ')))}\b\b\b\b\b{n} = {' * '.join(map(str, range(n, 0, -1)))} (its sum which is {__import__('functools').reduce(__import__('operator').mul, range(n,0,-1))})")
 
eyy! nice
import pandas as pd
import json
a = list("abc")
b = list(range(3))
c = list("xyz")
d = [json.dumps(i) for i in range(3)]

df1 = pd.DataFrame({"a": a,
                    "b": b})
df2 = pd.DataFrame({"c": c,
                    "d": d})

df2_copy = df2.astype({"d": "int"})
out = pd.merge(df1, df2_copy, left_on="b", right_on="d")
@inspectorG4dget here's some kind of quick example, sorry if it's a bit rushed
 
ooh! hang on. I was trying to do the join in postgres to avoid having to pull wayy too much data into python
 
2:54 PM
ohh
hmm
i wont be able to cook up postgres examples though, i dont have it installed*
 
omfg! CAST(...) was what I've been missing for days now. Thank you so yamming much :D
 
np :)
 
3:39 PM
As an alternative to globals(), consider lambda when you need to bind a value to a name without using assignment statements or walruses
For example, Andras' f'{n:=1} {n}' could be (lambda n: f"{n}{n}")(1)
So the factorial code might be written like print((lambda n: f"{n} = {' * '.join(map(str, range(n, 0, -1)))} (its sum which is {functools.reduce(operator.mul, range(n,0,-1))})")(int(input('Enter a number to factorialize: '))))
I do think a walrus-based approach is possible, if you're willing to use str.format rather than f strings. Then you don't have to deal with scope weirdness
For example "{}{}".format(n:=1,n)
If we're optimizing for unreadability, I typically favor lambda, because the reader rarely expects that the first expression that executes is the one that appears last in the code. Just make sure to use an unhelpful variable name.
Underscores are a fine choice. Permutations of I and l are good in sans-serif environments.
 
wowzers! We need some sort of obfuscation/golf community for this sort of thing :)
 
3:54 PM
@Kevin then you should base85-encode the prompt text
 
Wisdom
 
Hi
regards @pytest.mark.parametrize
I see in all the examples that the input parameter being assigned there
in my case, I can only calculate it inside the test
How can I still use it?
 
Bah, all the fun obfuscatory codecs like rot13 and base64 aren't supported by bytes.decode.
int.to_bytes(31404743066920765524867568508698136469670396792570276002724362223575355439648, 32, "big").decode() isn't bad though
Unless your goal is to eliminate all string literals from your program, in which case replacing a literal with an expression that contains a literal isn't terribly useful
 
@arielma it's a decorator, so it has to run before your decorated function runs. So no.
Or perhaps that's not the right way to look at it. It's a decorator so it works outside the decorated function.
Either way I don't think you can use it directly.
Can't you supply parametrized arguments from which you compute things in the test? Although note that test purists will say that your test is too complicated.
 
4:11 PM
hey folks! A while ago I came across a way to log all called functions and time spent computing them for python scripts. I think it was a python script itself that you call prior to calling your own, like python -m <unknown_script.py> <my_script.py>. I can't remember the name or any relevant search terms to find it anymore. Does anyone have a clue what I could be looking for? Sorry for being so vague...
 
"profiling"
You might be looking for cProfile or a line profiler. My preference is snakeviz that eats the output of cProfile.
 
well that took half a hot second to find cProfile after searching for profiling. That's exactly what I meant! :)
 
Yeah, python -m cProfile yourscriptname.py gives you a table of function times
 
 
1 hour later…
5:33 PM
@arielma Explain "I can only calculate it inside the test" please.
 
5:46 PM
Morning cbg
Second, @cs95's very long 11-screenfuls answer to Dynamic evaluate expression from formula in pandas? needs some editing and summarizing. It's just way too long an inaccessible to newbies, overload. All they need to know is: "1) use df.eval, although 2) you could use df.query"
...ok, generally pd.eval() rather than df.eval() itself. So that's 1) pd.eval() 2) df.eval(), 3) df.query()
 
6:17 PM
@AndrasDeak- Thanks Andras. I will have a look into that.
Andras, thanks a lot 👍 You really helped.
I ran a pip command which made it work.
pip install -U gtts-token
 
Hello all, how can I read a CSV file with n 2D arrays, the values of each 2D array are separated by a simple space, and the 2D arrays are separated by a line, and load these to a list of 2D arrays?
 
@Marco when you say "array" do you mean a numpy array of a list of lists?
In both cases the answer is "yes" but the "how" will differ
 
Marco, can you send a small portion of the csv contents, like two or three lines?
 
@Destroyer-byte glad it did
 
Thanks a lot Andras 👍
 
6:24 PM
Hi All
 
@AndrasDeak I think Numpy Array is better
 
I have question regards this thread:
https://stackoverflow.com/questions/56754769/how-to-run-a-pytest-test-for-each-item-in-a-list-of-arguments
 
@Destroyer-byte ok
 
I have similar case, and I want to show my code for your comments
 
6:25 PM
@Marco np.loadtxt or np.genfromtxt should do it then
Ah, no, because you have "n" 2d arrays in a file. Is there any separator in between? If they are just dumped below one another you can read them once and reshape/split the result
 
@AndrasDeak the 2D arrays are separated by a simple blank line
 
OK, then a single numpy call won't work
 
@Destroyer-byte a very simple example:

1 2 3 4
5 6 7 8

10 20 30 40
50 60 70 80
 
Oh I see.
 
I'd be tempted to read the file in memory, split on '\n\n', and then handle those as in-memory files with io.StringIO
 
6:28 PM
`
import dataikuapi
import pytest

def get_scenario_list(params):
    client = dataikuapi.DSSClient(params['host'], params['api'])
    client._session.verify = False
    project = client.get_project(params['project'])

    scenarios = project.list_scenarios()
    for i in scenarios:
        yield i


@pytest.mark.parametrize('scenario', get_scenario_list())
def test_check_scenario_exist(scenario):
    test_scenario = False
    if scenario["name"].startswith("TEST"):
            test_scenario = True
 
@AndrasDeak hmm
 
should it work?
 
@AndrasDeak how?
 
Is there some sane method of installing pip on linux that does not involve running script downloaded from bootstrap.pypa.io ?
 
Marco, is 1 2 3 4 a single line of data or does it run onto the next line- basically, is 1 2 3 4 one line of data or is 1 2 3 4 5 6 7 8 a line of data?
 
6:36 PM
1 2 3 4
5 6 7 8
(A 2D ARRAY)

10 20 30 40
50 60 70 80
(OTHER 2D ARRAY)
 
👍
I'm trying to see if I can puzzle something out.
 
@smci it's a missing manual type post which admittedly isn't a great fit for stack overflow's QnA format. It was useful to document some of the features for posterity, but will seldom make a good dupe target. Really mostly useful as a drop in replacement to the docs, which is where that stuff should've gone anyway. I just rather contribute here than there
 
@Marco the one uncertain part is whether numpy importing functions work with StringIO. If it does, you need with open('data.txt') as f: contents = f.read() and then blocks = contents.strip().split('\n\n') and then for block in blocks: fake_file = StringIO(block) which you then plug in np.loadtxt/np.genfromtxt
 
7:10 PM
@AndrasDeak Thanks, I will test it, but the final part of using np.loadtxt / np.genfromtxt I didn't get it right.
@Destroyer-byte ok, thanks.
 
Hi, today one of colleagues introduced Jupyter to me. He said it is far easier and will be more convenient for our to team to use it, instead of the way I code in python using my n++. He suggested to download anaconda and then I will have jupyter on my system. What are the benefits of this jupyter and anaconda? Will it harm my existing python installations if I install it on my system as well?
 
@Marco
how many lines of data does the entire file have?
 
7:27 PM
@Marco that's the part where you look up the documentation
@enthu if you have python already then you can just pip install jupyter I think. Running jupyter will spawn a web server after you which you can write and execute code in the browser, a lot like how Wolfram Mathematica works. As for whether this would benefit you personally depends on a lot of things and I can't comment because I don't really use it.
 
@AndrasDeak thanks indeed, what about anaconda? is it kind of ide?
 
@enthu anaconda is a widely-used package manager + virtual environment manager for Python (also R, plus other languages). It allows you to set up and maintain separate venvs with (say) py3.8, py3.7, py2.7 etc., and keep each of their dependencies and updating separate. This is useful and non-trivial, as often in a large environment you can get comflicting dependencies, or updating one package will break it or its dependencies will break others, iften unrecoverably.
 
Yeah I use Anaconda.
I use the spyder ide within anaconda.
There's various other tools as well.
Jupyter Notebook is one of those tools.
 
@Destroyer-byte useful to distinguish between IDE, notebook, package manager, virtualenv manager. Different types of tools.
 
@Marco, you wanted a way to load the data as one dimensional arrays- I have figured out a way to load the data and get them to be in a single array, however there are two elements in one array separated by a comma.
@smci indeed it is.
[['1 2 3 4', '5 6 7 8'], ['10 20 30 40', '50 60 70 80']]
That's what I have at the moment.
 
7:47 PM
@Destroyer-byte like pypi? I have R and python on my system, installing it will not disturb those installations? sorry I am not an expert user though.
 
what about pypi?
No worries, even my side enthu, I am also a beginner. I was introduced to Python last year.
 
@AndrasDeak I installed with pip on powershell, environment looks like an ide, but i can not find a run button to run my existing codes!
 
@Marco, I managed to turn this
0      1 2 3 4
1      5 6 7 8
2  10 20 30 40
3  50 60 70 80
into this                       Column 1
0          [ 1 2 3 4 5 6 7 8 ]
1  [ 10 20 30 40 50 60 70 80 ]
 
@Destroyer-byte many thanks... I code for a while and develop the things I need with no deep understanding as people have here. I feel shy sometimes here, people do big things and I ask simple questions.
 
Yeah me as well enthu. I am actually studying IT- I have started my studying last year, and have another three more years to go, including this year.
Yeah, the individuals within this room are very skilled.
 
7:54 PM
@AndrasDeak, ok, thanks, I'm still testing, your code worked, but I'm not able to save each 2D array into a list of 2D arrays.
 
@Marco I will send the code I have- There may be a chance that it gives you a slight idea
 
@Destroyer-byte actually I am a civil engineer with some years of experience. I love coding, more than a normal graduate of civil engineering though. sometimes I think people may get bored with these simple questions! sorry room, btw!
 
@Destroyer-byte Thanks, sorry, I couldn't reply to your previous message about the number of lines of each file, it actually varies according to my data set. How was your last code?
 
Wow, civil engineer, that's so cool. Laurel, the people here are kind and friendly.
@Marco, no worries.
My last code I sent for you to see.
Unfortunately I have to rush offline now.
 
@Destroyer-byte thank you very much, I will test it!!
 
7:58 PM
We are having a power cut at 10.p.m.
 
@Destroyer-byte Ok, good night!
 
@Marco, cool- do let me know tomorrow, if it worked or assisted in any way.
Goodnight Marco!
Goodnight Room!
 
@Destroyer-byte Ok, thanks.
 
@Destroyer-byte good night
 
😃👍
Goodnight enthu.
 
8:00 PM
@Marco you have a loop, and in the loop you create a 2d array in each iteration. To collect them in a list, define an empty list before the loop and .append each 2d array to it
 
@Marco- the previous code has one or two variable errors- the above one is fine.
👍
 
@Destroyer-byte ok, thank you!
 
anyone saw my code by any chance? :)
 
@AndrasDeak ok, thanks, I am testing it.
 
8:18 PM
@Marco and if every 2d array has the same shape you can call np.array on your list of arrays, and you'll end up with a 3d array whose first index corresponds to the enumeration of 2d arrays. Depending on your use case this might be beneficial (it often is)
@Destroyer-byte sorry for not noticing this sooner, but your formatting is broken and that's too much code for chat. I'm going to move both of these messages. You should post that code to a code paste site and link it here. And for future reference, see our code formatting guide to chat for shorter snippets.
 
@cs95 Right. Your answer is 11 screens long but doesn't actually answer this fairly simple case of a dynamic formula df['formula'] column which varies on each row...
 
...So I went and figured out the solution and posted it. Essentially, use pd.eval() inside df.apply(..., axis=1), then use a lambda function on each row, and pd.eval(..., local_dict=row.to_dict()) to pass in the dict of variable values on that row.
 
@AndrasDeak yes, all 2d arrays has the same shape
@AndrasDeak how can I create this list of arrays to load in it all the 2d arrays?
@AndrasDeak yes, I think it will end up with a 3d array
 
@Marco your list of 2d arrays that you already have is "this list of arrays"
you only have to add 1 line after the loop
 
8:33 PM
@AndrasDeak I am not figuring it out how to append 2d arrays to this list of arrays, where each element of this list is a 2d array
 
recbg
 
@Marco Do you know how to append integers to a list in a loop?
 
yes, but in your example would be a 1d list, I think
 
If you know how to append integers to a list in a loop: you do the same thing except it's not an integer you're appending at a time, but a 2d array.
 
@AndrasDeak I think I managed to solve it
 
8:41 PM
great!
@Marco please read out code formatting guide to chat and practice in the sandbox if necessary
What you wrote works, but that's more cumbersome than using a list. Both work, choose whichever works for you.
 
arrays = np.empty((1024,40,40))
i = 0
with open('matrixfile.csv') as f:
    contents = f.read()
    blocks = contents.strip().split('\n\n')
    for block in blocks:
        fake_file = StringIO(block)
        arrays[i] = np.loadtxt(fake_file)
        i = i + 1
Here it is, formatted, sometimes I forget how to format it, sorry.
It's just CTRL+K
On the code
 
jupyter reminds me wolfram mathematica...
and also it is amazing that I can have my old python still working in my powershell command and all the anaconda features (for instance newer version of python, ide, etc) are available in the anaconda navigator.
Installing the anaconda did not disturb my already installed python. I was worried about this. It has its own powershell I think which calls its own python installed!
 
no worries
 
@AndrasDeak I understand, it's bad the way I did it?
 
@Marco no, as I said it's fine. It's just more work to do it this way. But it uses less memory than what I suggested.
arrays = []
for block in blocks:
    ...
    arrays.append(np.loadtxt(fake_file))
arrays = np.array(arrays)
 
8:49 PM
@AndrasDeak, great, ok.
Thanks!!!
 
no problem
 
9:02 PM
HI guys, anyone knows how can I add children attributes in AWS? They have a weird structure like: id: {
DataType: "String",
StringValue: taskId,
}, but what if I want an attribute that is a "dicioanry"?
Can't find the documentation of this anywhere
 
AWS is a whole ecosystem. You'll need to be a lot more specific
 
Will this work ins AWS?
"MessageAttributes": {
"headers.id": {
"DataType": "String",
"StringValue": "9fc61039-bec6-481c-904e-6caaa101b64d"
},
"headers.task": {
"DataType": "String",
"StringValue": "config.celery.debug_task"
}
},
my django app read the KEY headers and search ID and task from inside+
But I can't send a json as an attribute
so I thought this is done by "headers.attribute_name"
but not sure
 
Have you chosen just to ignore me?
 
I think I'm being more specific
 
Presumably this is some central management console command then? Because I can log in to AWS and have S3, Redshift and CloudWatch as just the first 3 services in the list
 
9:13 PM
I think the way of handling attributes in AWS is the same across all services
 
In which case, I can't help you sorry. I don't know the first thing about management of AWS, only using some of their services
 
9:51 PM
@cs95 I edited it to at least put section headings on it, please edit it further as needs. But we still need to do chainsaw surgery on its length, and ultimately prune down 90% of the SO answer and move it to pandas doc, either User Guide or less desirably Cookbook....
...But really that question needs a couple of motivating examples of formulas, in the first paragraph, to guide the "What different example types of formulas are there, and why do users care which command they use?". No new user is going to read an essay on multiple ways to do the same thing.
 
 
1 hour later…
11:06 PM
@smci it does, though? "pd.eval can evaluate arithmetic expressions which can consist of variables and/or literals" and below that is an example of what the OP is looking to do. Granted it might make more sense rephrased in the context of df.eval or query.
 
11:39 PM
@inspectorG4dget FWIW I don't think the eventual comment was particularly necessary, and I'm not exactly known for my acts of mercy on main. It was an interesting exercise for you, but that result is probably complete garbage in the eyes of the OP. Are they going to be a professional programmer? Probably not. But this seems a bit mean to me.
<Attempts to close smashed glass door of the glass house>
 
@roganjosh the traditional point is to give an answer that they either can't use, or if they do the teacher will know they didn't write it themselves
 
anyone have any advice on how to ooptimize this algoithm? I can't find any good resources on it. Basically the point of this algorithm is to break an image into overlapping patches, do some math on the data in each patch, then merge them back together by taking the max value
```
 
@cheesemas46 please see our formatting guide and also our rules particularly in relation to posting longer snippets of code off-site and linking here
 
data = currentData - bkgData
    tileY =12
    tileX =12
    h,w = data.shape

    DETECTED = np.zeros(data.shape).astype(np.float32)
    for curY in range(tileY//2, h-tileY//2,tileY//2):
        for curX in range(tileX//2, w-tileX//2,tileX//2):
            # Get one of the patches of data
            S = data[curY-tileY//2:curY+tileY//2,curX-tileX//2:curX+tileX//2]
            # comput stdev, median
            rms_bot_75 = rms(np.sort(S,axis=None)[:int((tileX*tileY)*.75)])
            std_dev = np.std(S)
I think the key to optimizing this is to get around using the nested loop somehow but I cant figure out a way to patch/merge the data efficiently
 
11:56 PM
@AndrasDeak I think I've just become weary of main. I guess it's nice (?) that people still have time to entertain that trope. As blunt as I am on main, it did actually just come across as an epeen to me
 
my only issue is including an actual way to compute the factorial :P
 

« first day (3735 days earlier)      last day (1216 days later) »