« first day (2686 days earlier)      last day (2487 days later) » 
00:00 - 20:0020:00 - 00:00

Cabbage.
Does anyone have any good resources for probability theory? :(
what kind of probability theory. You can get very deep into measure theory which looks like real analysis... and the class was called advanced probability. Or, you just want to know how to calculate odds with dependencies and bayes theorem and stuff?
00:23
Mostly the theory of expectation, risk, etc, involved with probabilistic ML models
Yes, this includes Bayes Theorem
Well when you find it, let me know as well
01:17
Hello, smart people.
I'm unable to reproduce what I'm about to describe with a minimal example, but hopefully someone can tell me what might be going on.
df = pd.DataFrame([datetime.datetime(year=2017, month=1, day=1)])
df.columns=["date1"]
df["delta"] = datetime.datetime.today()-df["date1"]
df
Out[41]:
      date1                    delta
0 2017-01-01 417 days 01:16:57.412777
I'm basically doing the above, but the resulting delta column fails at least one time, the result has nothing to do with what it should be.
I'm doing it as the output of np.where
I even tried making the same computation specifically for that row and the result comes out correct, but it doesn't in the Series output by np.where.
Does anyone know what might be happening and how can I fix it?
 
1 hour later…
 
3 hours later…
wim
wim
05:10
@vaultah ahaha, same happened to me. 100% correct and "only" 295/300 score. Maybe they are also taking your reaction time into account...?
does anyone know how to implement a mm1k queue in python
i have what i think should be one, but the stats collected at the end show numbers that are off and I have no idea what's goin on
 
1 hour later…
06:40
cbg
 
1 hour later…
08:05
I am learning prepared statements in Python. I have been getting the error not all arguments converted during string formatting if I run my query this way cur.execute(sql_seacrh,(cell)). I went on dev.mysql.com/doc/connector-python/en/… and found that I had to add a , just after cell and then the program executed fine. So my question is Why that extra comma? What purpose does it serve?
(x) is the same thing as x, the parentheses are useless. But (x,) is a single-element tuple containing x.
>>> type((3))
<class 'int'>
>>> type((3,))
<class 'tuple'>
Thanks, yeah I got it. I remember that now from a tuple tutorial. I had no idea that we got to represent those parameters in tuple
08:26
@JWizard Depending on your DBAPI driver in use any old sequence will do.
And some might allow using named placeholders and dictionaries.
08:41
@IljaEverilä I will try dictionaries to see if they work, I am using mysqlclient. Thanks for pointing out that.
@IljaEverilä But is I were to use dictionary instead of tuple, what would be my "key" and "pair" according to this statement?--->cur.execute(sql_seacrh,(cell,)). And what are the performance implications of doing that?
That depends on your DBAPI in use. Some use the pyformat style, some use named (see python.org/dev/peps/pep-0249/#paramstyle). I'd wager any performance implications are negligible compared to actually executing the statement...
Cabbage. I found tons of duplicates along the lines of "Trying to read row-index as string in pd.read_csv" / "error “The label ... is not in the [index]”. It's a real mess, what should we do? The clearest version IMO (and which also mentions the open pandas issue and workaround) seems to be this recent one How to read index data as string with pandas.read_csv()?
@IljaEverilä I am on it, let me check
MySQLdb is somewhat old afaic, so my bet is on it supporting pyformat (or no mapping style at all).
Hi there.
Is it possible to have a direct link to IDEone for Python?
When you go there the first time, it opens up for Java.
For some kids, I'd like to provide a direct link
@IljaEverilä I am seeing it supports both pyformat and format
 
2 hours later…
11:08
@GitGud well what are you filtering for in np.where? If your problem only exists inside a call to np.where and your example doesn't contain np.where, it's not complete; is it?
@ZackTarr nice pressure work there
11:22
(not you necessarily, just a general remark)
Cabbage
11:53
cbg
12:08
@Aran-Fey what is your opinion about adding a custom MetaPathFinder to sys.meta_path for doing that task of creating and importing multiple modules dynamically against overriding import? Just came to know this can also be done, was just guessing what you might think about this...Started exploring import system docs.python.org/3/reference/import.html
``` hello I have a question```
Can someone please help me setup postgresql and use it with psycopg2?
It's the third time I'm trying to use it and getting sick of everything in the world!
does anyone see my msgs?
@yukashimahuksay everyone does, relax
Thanks god!
should I make a private chat now?
12:10
ask here then?
Read the room rules and see if you may. If you may, sure.
hello
i have a question, My first list is
odict_values(['23.0', '227.16', '37.17', '324.0'])
and my sencond list is
dict_values(['Fussball4,Multisensor_1OG,Temperatur [°C]', 'Fussball3,Boiler,Helligkeit [Lux]', 'Fussball1,Einspeisung,Spannung L2 [V]', 'Fussball2,Einspeisung,Leistung [W]')
how can i merge them together in orther to get first element of the first list with first element in the second list
@AhmyOhlin "together" how? Are you looking for zip?
But I'm so mad now and I've been looking for postgres and psycopg2 docs for 3 hours now and whatever I do doesn't work and I'm really extremely exhausted of reading any docs and I'm completely frustrated!
>>> lst1 = [1,2,3]; lst2 = ['a','b','c']
>>> list(zip(lst1,lst2))
[(1, 'a'), (2, 'b'), (3, 'c')]
12:13
is there no way that I can get some very kind person to help me without reading any more docs and rules etc?
@yukashimahuksay Nope.
i want a final list like this :
'Fussball4,Multisensor_1OG,Temperatur [°C], 23.0'
such a pity............................................................................‌​.................................................................
:(
@AndrasDeak Thanks
i will test it
@AhmyOhlin so you want to append to each item of the second "list" the corresponding item from the first list
You can loop over zip(lst2,lst1) in a list comprehension (or a proper for loop) and construct your strings there.
12:17
recbg
33
A: pyvenv not working because ensurepip is not available

Louis MIt seems that it was a locale problem. Solved by executing: export LC_ALL="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8" sudo dpkg-reconfigure locales found on this thread Python locale error: unsupported locale setting

amazing :D
cbg, nice
@yukashimahuksay: Pluralsight Mentors. Maybe you need some money, though
12:39
    i got this error maybe because the structure of my lists is different to standard list
    final_list = list(zip(list_val_storage,list_val))
TypeError: 'State' object is not callable



    list1 [{'value': '23.1'}, {'value': '227.16'}, {'value': '37.17'}, {'value': '307.0'}]

    list2 [{'index': 'Fussball5', 'device': 'Boiler', 'measure': 'Spannung L3 [V]', 'timestamp': '2018-02-22 13:35:17'}, {'index': 'Fussball3', 'device': 'Boiler', 'measure': 'Helligkeit [Lux]', 'timestamp': '2018-02-22 13:35:17'}, {'index': 'Fussball1', 'device': 'Einspeisung', 'measure': 'Spannung L2 [V]', 'time
final_list = list(zip(list1,list2)) doesnt work in this case
@AndrasDeak
Guys anyone here with Django rest experience? I have this question if anyone can help me that will be helpful.
https://stackoverflow.com/questions/48927439/drf-django-url-filter-relatedfielderror
anu
anu
>>> l1
[{'value': '23.1'}, {'value': '227.16'}, {'value': '37.17'}, {'value': '307.0'}]
>>> l2
[{'device': 'Boiler', 'index': 'Fussball5', 'timestamp': '2018-02-22 13:35:17', 'measure': 'Spannung L3 [V]'}, {'device': 'Boiler', 'index': 'Fussball3', 'timestamp': '2018-02-22 13:35:17', 'measure': 'Helligkeit [Lux]'}, {'device': 'Einspeisung', 'index': 'Fussball1', 'timestamp': '2018-02-22 13:35:17', 'measure': 'Spannung L2 [V]'}, {'device': 'Einspeisung', 'index': 'Fussball2', 'timestamp': '2018-02-22 13:35:17', 'measure': 'Leistung [W]'}, {'device': 'Multisensor_1OG', 'index': 'Fussball4', '
works fine. @AhmyOhlin
Hi, I am using json.loads to load json data into a dict. I am getting the data from an API however, the data is not reliable and sometimes I get a JSONDecodeError. Is there a way to partially load json data upto the point where it is intact
anu
anu
if the object API response payload is not a well formed JSON why would want to accept that ? Wouldn't it be better to discard the payload and try again ?
Or perhaps establish a connection that can handle delivery more reliably
12:55
I am looking to form a data frame using some of the values in the returned JSON. Then, if the attribute is not present I could replace it with a nan in the output
anu
anu
I don't think json module has the ability to handle that. And it makes sense why it would not allow that.
I should mention I am escaping unicode characters from the API response and
that probably corrupts the json when unicode data is in the body of the json resp.content.decode('unicode_escape')
anu
anu
You can probably handle this within the try-except block, by making the json well-formed again in the except block and running it through json.load() again.
you could probably make the json well-formed again by making sure that the ",],} are paired up
and proceed from there. atleast then json.load() will work
Why would you escape unicode characters ?
Personally, I would change the encoding after I get my response. json.load() has a way to do that
@Mahesha999 If you can figure out how to do it, go ahead. But I've found the import machinery to be a gigantic mess, and have always had to resort to overriding __import__ to get anything done
13:14
@anu Thanks
@Aran-Fey yeah exploring it gives similar feeling to me...will spend more time on it to to decide upon if I can do it
@anu when i do the code i got
final_list = zip(l1,l2)
final_list <zip object at 0x757fff80>
13:42
@AhmyOhlin What does print(list) display for you?
@Aran-Fey Is your name Aran?
Expected response: "That's weird, when I do print(list) it shows <State object at 0x1234abcd> instead of <class list>". At some point earlier in your code you did list = something and now you can't use the built-in list type to convert things to lists. You should pick a different variable name for that assignment.
13:57
@yukashimahuksay Nope :) It does have 4 letters though.
♫ Near a tree by a river / There's a hole in the ground / Where an old man of Aran / Walks around and around ♫
Code analysis tool reported 400 warnings last week, I solved 100 of them, and now it reports 600 warnings. This joke is less funny when it actually happens.
Ah it's because I changed the configuration options to scan the entire code base instead of just the module I care about
No problem, I'll just change it back, and... 481 warnings :-I
user6568562
Cbg
DSM
DSM
Thursday morning cabbage for all.
Hello everyone, new to SO and chat here. Does anyone know any fuzzy logic libraries for Python? I know there is scikit-fuzzy but anything else I find seem to not be updated anymore. Not looking for using a specific one, just searching all fuzzy logic related libraries in use for my thesis next year.
i dont have variable list
i have these variables: final_list, l1 and l2
@Kevin
DSM
DSM
14:13
@MooingRawr: :'-(
So close, I feel robbed ;(
@AhmyOhlin That doesn't answer my question.
DSM
DSM
@Kevin: AO doesn't seem to have made a list call there, though. I think Anu is 2 and AO is 3.
If by "I don't have variable list" you mean "I'm getting NameError: name 'list' is not defined when I try to do print(list)", then your environment is screwed up way worse than I thought
DSM
DSM
Oops, I see it now in the original transcript, I was only looking at the last one, my mistake.
14:15
If by "I don't have variable list" you mean "I'm pretty sure that I never overwrote list so I'm not going to bother to check", please bother to check
DSM
DSM
@MooingRawr: puck and stone. Bad day.
list_val = [{'value': '23.8'}, {'value': '329.0'}]

list_val_storage = [{'device': 'Multisensor_1OG', 'index': 'Fussball4', 'timestamp': '2018-02-22 15:14:07', 'measure': 'Temperatur [°C]'}, {'device': 'Boiler', 'index': 'Fussball3', 'timestamp': '2018-02-22 15:14:07', 'measure': 'Helligkeit [Lux]'}]

final_list = zip(list_val_storage,list_val)

this is the result what i got
final_list <zip object at 0x7587d9b8>
@DSM didn't know you watch stone, but yeah while other shine (like dancing), our famous teams fell short :(
@AhmyOhlin Right, because zip returns a zip object and not a list in 3.X. If you want a list, you need to do ` = list(zip(...`
And if, when you do that, you get TypeError: 'State' object is not callable, that's because you overwrote list with a State instance.
Traceback (most recent call last):
File "/home/pi/pw-raspberry/python/automatically_einbindung3.py", line 93, in <module>
final_list = list(zip(list_val_storage,list_val))
TypeError: 'State' object is not callable
DSM
DSM
14:20
@MooingRawr: I'm worried now, though, because this is a lot of pressure on the men's hockey team now. I mean, there always is, but still.
@DSM I feel kinda blah about not sending our best, rather we are sending our young and oldies, while the Euro teams sent their league player (I think). I still have faith in us :D plus we are used to the pressure or we should be.
@AhmyOhlin Now do print(list) and tell me what it says
DSM
DSM
@Kevin: like usual, you've already spoiled the outcome of this mystery. ;-)
list(zip(list_val_storage,list_val))
print(list)

i got the same error kevin
list_val [{'value': '23.7'}, {'value': '329.0'}]
list_val_storage [{'measure': 'Helligkeit [Lux]', 'index': 'Fussball3', 'timestamp': '2018-02-22 15:22:53', 'device': 'Boiler'}, {'measure': 'Temperatur [°C]', 'index': 'Fussball4', 'timestamp': '2018-02-22 15:22:53', 'device': 'Multisensor_1OG'}]
Traceback (most recent call last):
File "/home/pi/pw-raspberry/python/automatically_einbindung3.py", line 93, in <module>
list(zip(list_val_storage,list_val))
DSM
DSM
.. I think Kevin meant to print(list) before the line where your program crashes. Otherwise you're not going to see the result, right?
14:25
Jimmies entering maximum overrustle mode
DSM
DSM
I remember once asking someone to print something for debugging purposes in comments and he said something like "I added it and it didn't help". I had to take a few moments to compose myself.
8
i feel stupide now lol

print("list_val", list_val)
print("list_val_storage", list_val_storage)
print("list",list)
list(zip(list_val_storage,list_val))
Output:

list_val [{'value': '23.5'}, {'value': '296.0'}]
list_val_storage [{'timestamp': '2018-02-22 15:29:03', 'index': 'Fussball3', 'device': 'Boiler', 'measure': 'Helligkeit [Lux]'}, {'timestamp': '2018-02-22 15:29:03', 'index': 'Fussball4', 'device': 'Multisensor_1OG', 'measure': 'Temperatur [°C]'}]
list <state sensor.stecker_energy=58.53; new_entity_id=sensor.stecker_energy, unit_of_measurement=kWh, node_id=2, value_id=7205759407649587
DSM
DSM
37 mins ago, by Kevin
Expected response: "That's weird, when I do print(list) it shows <State object at 0x1234abcd> instead of <class list>". At some point earlier in your code you did list = something and now you can't use the built-in list type to convert things to lists. You should pick a different variable name for that assignment.
^ psychic debugging ftw
Lesson: everyone should listen to me always
list gives me values from the api i dont know why. could you explain this kevin please
14:32
At some point earlier in your code you did list = something and now you can't use the built-in list type to convert things to lists.
This is the third time I have explained it.
ahhhh now i understand what do you mean
DSM
DSM
ha ha (actually laughing)
The third time it really is true!
im really sorry. you are right Kevin. python expert
It doesn't take an expert to solve a builtin-overshadowing issue. You can do it with 24 hours of experience with the language. You just need to read error messages, understand what they mean, and test the actual state of your program against what you expect the state to be.
@DSM You mean like on this question last night? (see second comment and 1st edit) :P
14:43
Lesson learned.

final_list [({'device': 'Multisensor_1OG', 'index': 'Fussball4', 'measure': 'Temperatur [°C]', 'timestamp': '2018-02-22 15:38:19'}, {'value': '23.5'}), ({'device': 'Boiler', 'index': 'Fussball3', 'measure': 'Helligkeit [Lux]', 'timestamp': '2018-02-22 15:38:19'}, {'value': '296.0'})]

Now it works but  not as i expected. i want to dump it in json file. this why i need this form:

final_list [({'device': 'Multisensor_1OG', 'index': 'Fussball4', 'measure': 'Temperatur [°C]', 'timestamp': '2018-02-22 15:38:19','value': '23.5'}), ({'device': 'Boiler', 'index': 'Fussball3', 'mea
@Kevin The regulars always follow the Star Lord :D For you guide us through the darkness, that you may or may not lead us into in the first place.
final_list = [({}, {})]
i need that the list should be implented in the same {} like this : final_list = [({})]
14:51
cbg all
@DSM That is about the time you provide a link to Eric Lippert's blog post on debugging and let them figure it out themselves.
my JSON file looks wired :

{
    "zwave": [
        [
            {
                "timestamp": "2018-02-22 15:54:16",
                "measure": "Helligkeit [Lux]",
                "device": "Boiler",
                "index": "Fussball3"
            },
            {
                "value": "23.5"
            }
        ],
        [
            {
                "timestamp": "2018-02-22 15:54:16",
                "measure": "Temperatur [\u00b0C]",
                "device": "Multisensor_1OG",
                "index": "Fussball4"
You should be able to solve this yourself if you take your time and think carefully. Fly, little bird
DSM
DSM
@AhmyOhlin: you keep finding new ways to explain that you want two dictionaries merged. I'm going to suggest you google for "python merge dictionaries" and try things for a while. (Kevin'd, of course.)
15:07
Maybe OP is hoping the third time is the charm :D
15:26
looks like a job for map reduce
It works but it should be better soloution to store data from two different dictionnaries than what i did
Yes Kevin I will solve it myself.
DSM: The problem is that i worked with two dictionaries but only with the value side mydict.values() and i have to dump them both in Json as one entity {}!
i tried at the first to loop the both dictionary with for loop and append the values in a list to store it later in JSON but i dosnt wok. i searched on internet and i found that i have to store first every dict in a list then i can put them together in one list.
my code was before like this:
try: #does the data structure exist yet? Let's try opening the file...
15:45
@AhmyOhlin We're all clear on the fact that you need to have a single dictionary in your output. It was suggested that you search for "python merge dictionaries", did you try that?
DSM
DSM
16:12
♫ boom clap ♫ tak bije me serce ♫
кбг кпст
@DSM what language is that o.o google tells me Polish
Visual Studio is reporting that I have an assembly conflict but it doesn't say which assemblies are conflicting and I have fifty of them and I only got three messages worth of help out of the C# room before the topic changed to one of the regulars' medical issues and now everyone's too depressed to give me free tech support
heh that reminds me I wanted to go into C# to ask about SpeechSynthesizer.speakasync and if I can make it speak 2 lines at the same time without threading.
but now that you've reported about the state of the room I think I will hold off a bit
nice, I dodged some bullets by simply not being here :P
16:21
cbg AD, hope it's sun shines and rainbows where you're at
oh... would you like to join me into listening to Kefka's boss battle music (it just shuffled on). maybe it would fit your weather theme then.
no thanks :P
it's a nice combination of gentle snowfall and evening darkness
ahh so peaceful, got it .... and time to stay here more now that I just found 2 people with 5+ rep answering low effort questions.
so have you been watching the Olympics ?
DSM
DSM
16:29
Hungarians only care about the halfpipe.
MCVE: https://gist.github.com/codeguru42/9760d38d4f4ff891d045b53c1a0a64d9
`actual` is a `MagicMock` object and not the string that I expect. What am I doing wrong here?
DSM
DSM
Try bar.func()?
yah...that's what I meant...
wait...
hehehe :D
DSM
DSM
16:32
.. yep. :-)
DSM
DSM
NameError. Not quite at MCVE level yet.
okay...let me work on it...
IntelliJ's scratch file feature is freaking awesome!
I can run my MCVE without creating a new project or using a different editor.
huh o.o
Try Ctrl-Alt-Shift-Insert
if you don't know about it...
@DSM Can you take a look again. Output is included now.
16:38
<- I don't use IntelliJ sorry, I will just go google what you are talking about
Not even PyCharm?
DSM
DSM
@Code-Apprentice: you keep making the same typo. func != foo, and your new code doesn't even call your foo function.
I'm already a JetBrains fan boy. And they continue to amaze me with new features all the time.
Nope, I just use sublime text for Python...
@DSM ack...I mean to call foo(bar) actually
which in turn calls bar.func().
DSM
DSM
16:41
And if you'd done that, it would work.
aaaand...that works
DSM got his Kevin hat on :D
but the real code that I'm trying to mimic doesn't work ;-(
maybe more typos ?
DSM
DSM
If it's the same symptom, there's probably a similar typo somewhere. They're hard to spot when most actions on a MagicMock produce another MagicMock unless you specifically override it.
BTW, why are you using the mock package? As opposed to unittest.mock.MagicMock, I mean.
16:44
because that's what IntelliJ suggested from the Alt-Enter menu
from unittest.mock import MagicMock gives me red squigglies under the MagicMock
DSM
DSM
What version of Python are you using?
oh...probably because this project is py2
/cringe
DSM
DSM
Everything is spiralling out of control!
Quick someone hit the emergency Python 2 button.
we have a plan in the near future to port to py3
but that is completely out of my control
you know how it is, right? The customer uses py2, so we code in py2 kicking and screaming the whole way.
DSM
DSM
16:48
Anyway, I'll break my "don't answer py2 questions" policy enough to repeat that unexpected mocks are typically either typos or a failure to specify a return value deep enough (e.g. you set x.return_value but really you wanted the return value of that to return something, etc.)
yah...the real code has deeper nesting of objects. I took the M of MCVE too far it seems.
and I now have a regression to something I thought I fixed yesterday.
Gotta write test tests to make sure that your tests are correctly written
DSM
DSM
I should start preparing for adventure. It's warm today in LargeCanadianCity, and not raining, but it's a little grey.. still, should try to take advantage of my day off. Might go shopping for knockoffs at a certain mall before they get rid of them all (@MooingRawr :-)
"warm today in LargeCanadianCity" == 40F?
DSM
DSM
16:53
~32F, if my math is right.
My drive in it was 36F or basically 1 or 2 C
I was being optimistic
DSM
DSM
Warm enough you don't need gloves or a toque and don't really even need to zip up your jacket, at any rate.
21F here...and that's an hour after arriving at work
That is warm imo... :\ Also @DSM, have fun at the malls, they aren't pack at this time for this day. I'm sure you can stroll around with not as many people
Heh, I was thinking of taking my lunch at Mall Ville :D but I don't know If I want to drive like 10 minutes to have food court lunch
16:55
@DSM Thanks for your help. I was missing a correctly placed return_value.
My other option is expensive Japanese (which I had yesterday), Thai Express, Subways, or the generic food... :\
generic food sounds like what fake human lookalikes eat with their human mouths
I brought Stouffers Lasagna for lunch today.
DSM
DSM
There's a thought, I could have Chinese or Indian today and get the meat I can't eat tomorrow. :-/
I'm going to have Hungarian soon
16:57
Time to google what Hungarians have :D
In other news, have you seen the high school students protesting in the US the last few days? I'm saddened that they have become victims of a mudslinging campaign, including the accusation that some of them are paid actors.
Paprikash time!
I was thinking Thai or Chinese for lunch today, since I can't find anyone to go for lunch with, (can't justify going to a restaurant or starting my car without a companion.
One boy had a great comeback: "If you say me in our school production of Fiddler on the Roof, you would know that no one would pay me to act."
DSM
DSM
@Code-Apprentice: fancy! I keep lasagna cooked by the famous chef Boyardee at the office, myself.
16:59
@MooingRawr one example that Westerners tend to like is paprikás csirke, but in this case it'll be rizses hús
@DSM stouffers is my goto for a small variety of frozen meals.
DSM
DSM
@Code-Apprentice: there are always people whose response to tragedy is to curtail civil rights, but that's not a subject for this chatroom.
it's basically Hungarian pork stew buffed up with rice
looks really good. oh man, it's 12, I still have one more hour till I usually get my lunch. But topic of food is making me hungry.
@DSM all right. I'll set the politics aside and find other places to discuss it ;-)
17:01
rizses hús cries for some pickles, so it's almost on topic here
@AndrasDeak DO you make spaetzle? I've never gotten it right.
@AndrasDeak saves for later
ohhh cooking time with AD ?I would love to watch / taste the food
:D
we're high tech when it comes to nokedli (Hungarian spaetzle): tupperwebshop.hu/tupperware-kerek-nokedli-szaggato.html
(we have a cheaper device but it has the same operational principles)
17:07
@AndrasDeak I've improvised with a colander and scraper to similar effect - I think I just over/under cooked or messed up the mixture somehow.
Lunchtime rbrb
17:26
@AndrasDeak Eat well :)
I've just answered a Python 2 problem. I feel unwell now...
3
@toonarmycaptain thanks, I have!
 
1 hour later…
18:41
Is the room quiet because stack overflow is down, or is that just a coincidence
coincidence.
also SO isn't down for me o.o
Nor me.
I was getting "Oops! Something bad happened" for a couple minutes there
Oh wait... now it's down for me
It's like a wave :\
I have a few pages not wanting to load quickly. Like it hangs then loads. But no "Oops!.." yet
18:46
intermittent loads here too
but I have things to do so it's not entirely a bad thing
I have an answer 80% composed and I need to get some requirement clarifications from the OP
they noticed their unrelated typo and couldn't delete, so they decided to DDOS the server instead
3
That's one way to avoid getting downvoted...
Thatd be a bold move. Attack a website full of people that could attach you right back.
What's the word for an object that only exists so you can signal some kind of state by returning it?
18:54
flag?
Indicator?
Ehh flag kind of implies that you can bitwise-or multiples of them together
or "signal" which you yourself used?
response ?
18:56
Sentinal value?
Sentinel. That's it.
I discarded that possibility :(
Indicator is what I have seen. Have never heard the term Sentinel.
I mostly see sentinel in a similar use as flag, something you input rather than obtain on the output
> In computer programming, a sentinel value (also referred to as a flag value, trip value, rogue value, signal value, or dummy data)[1] is a special value in the context of an algorithm which uses its presence as a condition of termination, typically in a loop or recursive algorithm.
Ok, I guess that's not what I wanted.
19:06
if we can use cabbage to greet people we can use Sentinel to signal things :D
sentinel often refers to a value which determines when a while loop terminates
like when you enter a list of positive numbers with a -1 to indicate the end of the list
The use case I'm imagining is: you want to be able to inspect a function's return value to determine whether it succeeded or not. But the function can return any kind of object on a success, so you can't just return False or None or -1 on a failure. So you create FAILED = object() in the global scope and have the function return FAILED, and the caller can check for failure by doing if returned_value is FAILED
@Kevin Can you give an example...Kevin'd
And for some reason you don't want to return a (success_boolean, actual_value) tuple, or raise a FailedException
You could use exceptions
Come on, Kevin!
19:13
Giving alternate suggestions is kind of besides the point anyway. That's like replying to "what's the name for the tool that mountain climbers use to drive metal hooks into ice walls?" with "why not just use a helicopter to skip the climb entirely?"
@Kevin that is a sentinel
but not as its function for signalling output, but as its function for PRESET_SPECIAL_VALUE
sentinel = object()
def foo(maybe_None=sentinel): pass
this is a sentinel, but then yours is a sentinel in this sense
it's a sentinel flag :P
@Kevin noted
Although there is merit in considering whether I could refactor my answer so that it doesn't need a sentinel, and therefore I wouldn't have to tell the OP what a sentinel is.
@Kevin the difference is that coding is often about getting the end result with the least amount of pain...pretty much the opposite mindset of mountain climbers.
I'm keeping it for now because if left is complete: is amusingly expressive
19:26
Okay.. Ive been doing good so far but still have yet to get the question ban lifted off of my account. Ive gained like 300 rep since they put it on there. Any clue when Ill be able to ask a question again? I have one for the AHK community but cannot ask :(
IIRC The exact parameters for lifting a question ban are not publicly disclosed.
that ^
you get a free pass every 6 months but I'm pretty sure we've already discussed your case here before
I can't say I'm fond of the policy, but maybe they have a good reason, which they are also not disclosing.
And I dont think I can improve my questions since they truly are trash.
Oh well. Guess Ill wait until the 6 month question and just hope I dont get down voted.
19:29
sorry, I must be confusing your case with that of someone else
Dec 27 '17 at 17:52, by Andras Deak
@ZackTarr even question-banned accounts get a chance every 6 months to try and post something valuable
maybe not
Six months is a lot of prep time. Be like Batman and use your prep time wisely.
You're right. We have had this exact discussion. However irritated again about it today haha.
Stack Overflow's policy of "optimize for pearls, not sand" can lead to difficult experiences for those that are sorted into the sand bucket
Very true Kevin, I should have no issue having one heck of an MCVE by then haha.
Exactly! Once you are placed in the ban it feels like you cant get out. And even their verbiage of If that question is positively received, you may be able to continue asking questions; if not, then the ban will be reinstated. makes it sound like a good chance you will not be able to continue asking.
@Kevin the simple reason is that the worst offenders are exactly the kind of people who will try to game the system. Security by obscurity works in this case
19:36
I'm just not sure that it actually has that much impact. If system gamer A sees "lift your question ban by editing and improving your existing questions", and system gamer B sees "lift your question ban by receiving at least two upvotes apiece for 60% of your existing questions", then does B really have a huge advantage over A?
I just found it super annoying that they banned me out of no where. Like my last question was not a bad one. Then after that one they I guess looked into my other questions and banned me over questions from 2 years ago.
@Kevin B' might be inclined to create sock puppets with which to upvote their crappy posts
@AndrasDeak kevin'd me on that one. :^)
@ZackTarr no warnings whatsoever? That doesn't exactly sound like the system as described
So what's stopping A from doing the same? He might have to create five sock puppets instead of two because he's not sure how many points he needs, but he can probably guess that it will work if he throws enough accounts at it
19:38
From what I can recall, no. But I use to have my school account tied here and might have gotten an email. But nothing from the main site.
I tend to believe that fuzzy criteria are less of an incentive for abuse
"get your act together" vs "get 5 upvotes on downvoted posts" is pretty different as a message
I don't disagree. But is it enough of a disincentive to justify leaving in the dark all of the ethcially upstanding users that just happen to be bad at asking questions?
we'll never know
Therein lies my uncertainty
the real issue isn't the secrecy, but the crappy system
19:42
If you cant improve your old questions and the only way to lift the banishment is to improve old questions. Do you just shack up outside of the kindom and live with the understanding of your an outsider now?
there are occasional signs on meta that people get banned under weird circumstances and recovery is sometimes weirdly difficult. That's what should be fixed, really
DSM
DSM
I'm on record as thinking that for anything but troll behaviour (the sort of stuff I'd immediately flag and possibly write a custom bore to the mods), question bans should expire after a few months. It's simply too hard to dig yourself out of the pit.
@ZackTarr Honestly? I think most users in that situation give up and make a new account, and hope the mods don't notice.
@ZackTarr as I've probably said already, the 6-month free question is probably there to let you alleviate the ban with high-quality questions
the question is whether that works as advertised
@DSM They kind of have that with the 6 month question. But if you dont get a good question or the community just doesnt like it that day then you have to keep waiting. But yes I agree. After 6 months you should just be un banned until like a second ban or something
19:44
Hey guys can I ask a quick question here about pandas?
@Dominik Yeah.
DSM
DSM
There are often systems which people think work but actually only work because they're frequently ignored. Business processes in particular.
they are adorable, and love bamboos, and will be arriving to Calgary for display.
@Kevin *unless
DSM
DSM
Apparently kids really do talk about Instagram and snapchat and who they unfollow. #overheard
19:46
@Andras I will never shut down my thneed factory
@Kevin Sadly that has crossed my mind. But I dont want to get noticed. And more importantly Ive been working my tail off trying to get some rep.
@DSM did you know that obsessive "selfies" is a genuine mental
@Kevin gesundheit!
so does pandas not recognize close() that would be used when closing out a reading a file?
I haven't heard of pandas having unusual behavior like that. Do you have code that caused this suspicion?
19:48
import os
import pandas as pd
data = pd.read_csv('average2016.csv')
# Sort dataframe by Average Snow Fall column
data = data.sort_values(by=['AverageSnowFall'])
# Get the top 3 locations by average snow fall
print (data['Location'].iloc[:3])
if (os.path.isfile('top3.csv')):
os.remove('top3.csv')
data2 = open('top3.csv','w')
# Write File headers
data2.write("2016\n")
# Write contents of the file
#for location in Snow_Fall:
# SPlit the location into name and month
# location_name, location_date = location.split("_")
AttributeError: 'DataFrame' object has no attribute 'close'
pandas shouldn't be involved in closing files as far as I can tell
data = pd.read_csv('average2016.csv')
that's not a file handle (or whatever you call those things in python)
@AndrasDeak Thats my fear. And personally I think 6 months is way to long. 6 month is longer than some jail sentencings.... And I didnt even get a trial!
open(...) -> close(...)
pd.read_csv(...) -> you're done, have fun with your data
okay then how would I go about fixing it
It's not broken. Well, before you're trying to close it.
DSM
DSM
19:49
Andras +1
Just delete data.close() I suppose
ok..
okay that did fix that
Rad.
word of the day?
when pandas are well behave enough to close their source when they are finished with it :D
19:52
I would like to take a moment to express my gratitude for with blocks
Also Kevin why are you 'Rad'-ing a lot these days. did something happen?
yup, they're the real MVP
@MooingRawr he changed. To a degree.
or is this another side of Kevin that is leaking out of many parallel of Kevins
C# has them too but my static code analysis tool keeps telling me to delete them and replace them with twelve lines of nasty conditionals because it can't guarantee that the WidgetMatriculators won't be disposed twice in rare situations
@AndrasDeak I want to star this really badly... but I know it's not that fitting for the Star Board, so take a virtual high five -high five-
19:53
I guess one more question how would I take the top 3 results that are printed using print (data['Location'].iloc[:3]) and store that to top3.csv?
@MooingRawr I'm trying to cultivate a bit of California-style upbeatness
@MooingRawr it's OK, I missed the opportunity to include "gradually"
@Kevin where do you stand with kowabunga?
@Dominik write to a csv instead of printing?
19:54
Not interested in using it, but will not impede upon the right of others to use it
eh
@Code-Apprentice cute little buggers bears they are.
would I do data.write(stuff...)
and when they grow big enough, they will rip your head off...
strange thing about wild animals
@Dominik google "pandas write csv"?
@Dominik no, use the to_csv method
19:59
ehm
@Code-Apprentice they saw that about most things, I'm sure if you raise an animal since they were born, the likeliness of them mauling/biting you decreases.
00:00 - 20:0020:00 - 00:00

« first day (2686 days earlier)      last day (2487 days later) »