workspace
stringclasses
1 value
channel
stringclasses
1 value
sentences
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
sentence_id
stringlengths
44
53
timestamp
float64
1.5B
1.56B
__index_level_0__
int64
0
106k
pythondev
help
Since I'm just making sure that the endpoints work.
2018-02-23T03:23:19.000080
Hans
pythondev_help_Hans_2018-02-23T03:23:19.000080
1,519,356,199.00008
35,624
pythondev
help
Google Chrome Postman extension can help
2018-02-23T03:24:13.000025
Delilah
pythondev_help_Delilah_2018-02-23T03:24:13.000025
1,519,356,253.000025
35,625
pythondev
help
<@Delilah> I am aware of that but apparently it is being deprecated. And it requires signing in and all that, which I would really prefer to avoid.
2018-02-23T03:30:12.000405
Hans
pythondev_help_Hans_2018-02-23T03:30:12.000405
1,519,356,612.000405
35,626
pythondev
help
The desktop app I mean.
2018-02-23T03:30:25.000277
Hans
pythondev_help_Hans_2018-02-23T03:30:25.000277
1,519,356,625.000277
35,627
pythondev
help
<@Delilah> actually it seems I misunderstood you
2018-02-23T03:35:25.000337
Hans
pythondev_help_Hans_2018-02-23T03:35:25.000337
1,519,356,925.000337
35,628
pythondev
help
That isn't what I want to do.
2018-02-23T03:35:40.000055
Hans
pythondev_help_Hans_2018-02-23T03:35:40.000055
1,519,356,940.000055
35,629
pythondev
help
I want to add a new business into the list `self.business` and have it returned by the statement `return jsonify({'business': business}), 201`
2018-02-23T03:37:00.000161
Hans
pythondev_help_Hans_2018-02-23T03:37:00.000161
1,519,357,020.000161
35,630
pythondev
help
<@Delilah> that is the idea I had in mind. I could be wrong about how I'm going about it though.
2018-02-23T03:38:39.000144
Hans
pythondev_help_Hans_2018-02-23T03:38:39.000144
1,519,357,119.000144
35,631
pythondev
help
so ```new_business``` should be the list which is returned by ```weconnect.create_business``` function
2018-02-23T03:50:27.000077
Delilah
pythondev_help_Delilah_2018-02-23T03:50:27.000077
1,519,357,827.000077
35,632
pythondev
help
How do I use prepared statements for MySQL Bulk Inset like below: ``` insert into multi(c1,c2,c3) VALUES ( 1,'hey','{"name": "Jon", "Age": 20}' ), ( 2,'hi','{"name": "Doe", "Age": 20}' ) ``` I tried `recs.append("( {0},'{1}','{2}' )".format(2, '%s', '%s'))` but it will not work as I will not have dynamic values at ...
2018-02-23T05:28:05.000155
Krista
pythondev_help_Krista_2018-02-23T05:28:05.000155
1,519,363,685.000155
35,633
pythondev
help
<http://zetcode.com/db/mysqlpython/> Search for "prepared statements"
2018-02-23T05:33:11.000486
Aleida
pythondev_help_Aleida_2018-02-23T05:33:11.000486
1,519,363,991.000486
35,634
pythondev
help
<@Aleida> I know what PS are, I am asking how to implement in my situation
2018-02-23T05:41:07.000266
Krista
pythondev_help_Krista_2018-02-23T05:41:07.000266
1,519,364,467.000266
35,635
pythondev
help
What have you tried? `recs.append(...)` do look like a list, not a prepared statement
2018-02-23T05:41:55.000045
Aleida
pythondev_help_Aleida_2018-02-23T05:41:55.000045
1,519,364,515.000045
35,636
pythondev
help
<@Aleida> yes so multiple values coming for insertion and I want to make INSERT query given above
2018-02-23T06:57:53.000226
Krista
pythondev_help_Krista_2018-02-23T06:57:53.000226
1,519,369,073.000226
35,637
pythondev
help
????
2018-02-23T08:42:29.000029
Floy
pythondev_help_Floy_2018-02-23T08:42:29.000029
1,519,375,349.000029
35,638
pythondev
help
I don’t see anything out of the ordinary, sorry
2018-02-23T08:42:44.000289
Floy
pythondev_help_Floy_2018-02-23T08:42:44.000289
1,519,375,364.000289
35,639
pythondev
help
A normal python file looks like this:
2018-02-23T08:43:12.000239
Tanesha
pythondev_help_Tanesha_2018-02-23T08:43:12.000239
1,519,375,392.000239
35,640
pythondev
help
Its like its not registering the page, wont finish any of my code
2018-02-23T08:44:14.000157
Tanesha
pythondev_help_Tanesha_2018-02-23T08:44:14.000157
1,519,375,454.000157
35,641
pythondev
help
in the first screenshot, it looks like there’s a background process running
2018-02-23T08:44:38.000198
Floy
pythondev_help_Floy_2018-02-23T08:44:38.000198
1,519,375,478.000198
35,642
pythondev
help
in the second, its finished
2018-02-23T08:44:44.000219
Floy
pythondev_help_Floy_2018-02-23T08:44:44.000219
1,519,375,484.000219
35,643
pythondev
help
is the issue still showing on the serializer file?
2018-02-23T08:44:55.000078
Floy
pythondev_help_Floy_2018-02-23T08:44:55.000078
1,519,375,495.000078
35,644
pythondev
help
Yeah still the same
2018-02-23T08:45:25.000273
Tanesha
pythondev_help_Tanesha_2018-02-23T08:45:25.000273
1,519,375,525.000273
35,645
pythondev
help
I never had this before :confused:
2018-02-23T08:45:35.000249
Tanesha
pythondev_help_Tanesha_2018-02-23T08:45:35.000249
1,519,375,535.000249
35,646
pythondev
help
I’m using the same material theme, and don’t have that issue
2018-02-23T08:45:58.000462
Floy
pythondev_help_Floy_2018-02-23T08:45:58.000462
1,519,375,558.000462
35,647
pythondev
help
Yeah i have no idea whats going on i created a new python file and its done this
2018-02-23T08:46:22.000292
Tanesha
pythondev_help_Tanesha_2018-02-23T08:46:22.000292
1,519,375,582.000292
35,648
pythondev
help
I just created a new serializer file and copied over some text, no rendering issues ¯\_(ツ)_/¯
2018-02-23T08:48:00.000128
Floy
pythondev_help_Floy_2018-02-23T08:48:00.000128
1,519,375,680.000128
35,649
pythondev
help
Ill finish the api off with it like that. hopefully it will still work
2018-02-23T08:48:51.000333
Tanesha
pythondev_help_Tanesha_2018-02-23T08:48:51.000333
1,519,375,731.000333
35,650
pythondev
help
Yes. That's the idea. <@Delilah>
2018-02-23T09:49:56.000080
Hans
pythondev_help_Hans_2018-02-23T09:49:56.000080
1,519,379,396.00008
35,651
pythondev
help
is there a certain way to deal with side effects in python? basically the functions that don’t return anything and just do something.. is there a specific way to capture them?
2018-02-23T09:51:29.000470
Suzette
pythondev_help_Suzette_2018-02-23T09:51:29.000470
1,519,379,489.00047
35,652
pythondev
help
Not really I think since functions always return (None by default)
2018-02-23T09:52:43.000366
Tenesha
pythondev_help_Tenesha_2018-02-23T09:52:43.000366
1,519,379,563.000366
35,653
pythondev
help
so I should probably explicitly return `True` or something like that
2018-02-23T09:53:22.000600
Suzette
pythondev_help_Suzette_2018-02-23T09:53:22.000600
1,519,379,602.0006
35,654
pythondev
help
to make sure that function ran correctly
2018-02-23T09:53:43.000046
Suzette
pythondev_help_Suzette_2018-02-23T09:53:43.000046
1,519,379,623.000046
35,655
pythondev
help
Or something "special" to signal that that function "doesn't return"
2018-02-23T09:53:46.000089
Tenesha
pythondev_help_Tenesha_2018-02-23T09:53:46.000089
1,519,379,626.000089
35,656
pythondev
help
gotcha
2018-02-23T09:53:56.000419
Suzette
pythondev_help_Suzette_2018-02-23T09:53:56.000419
1,519,379,636.000419
35,657
pythondev
help
thanks
2018-02-23T09:53:58.000098
Suzette
pythondev_help_Suzette_2018-02-23T09:53:58.000098
1,519,379,638.000098
35,658
pythondev
help
you can also raise exceptions
2018-02-23T09:58:38.000275
Micki
pythondev_help_Micki_2018-02-23T09:58:38.000275
1,519,379,918.000275
35,659
pythondev
help
i’m doing things like this littered in different places in my codebase, and my linter is yelling at me that i’m not assigning it a value
2018-02-23T10:42:56.000367
Tobias
pythondev_help_Tobias_2018-02-23T10:42:56.000367
1,519,382,576.000367
35,660
pythondev
help
the objective is to mutate “variables”
2018-02-23T10:43:04.000077
Tobias
pythondev_help_Tobias_2018-02-23T10:43:04.000077
1,519,382,584.000077
35,661
pythondev
help
``` [ variables.update(process_variables(filename)) for filename in arguments['--input-file'] ]```
2018-02-23T10:43:06.000265
Tobias
pythondev_help_Tobias_2018-02-23T10:43:06.000265
1,519,382,586.000265
35,662
pythondev
help
is there a more pythonic way to do this?
2018-02-23T10:43:14.000583
Tobias
pythondev_help_Tobias_2018-02-23T10:43:14.000583
1,519,382,594.000583
35,663
pythondev
help
a normal for loop ?
2018-02-23T10:43:44.000072
Micki
pythondev_help_Micki_2018-02-23T10:43:44.000072
1,519,382,624.000072
35,664
pythondev
help
``` for filename in files: variables.update(process_variables(filename)) ```
2018-02-23T10:44:08.000108
Tobias
pythondev_help_Tobias_2018-02-23T10:44:08.000108
1,519,382,648.000108
35,665
pythondev
help
i have a lot of `for item in items` hanging around, and thought that was a code smell
2018-02-23T10:45:15.000248
Tobias
pythondev_help_Tobias_2018-02-23T10:45:15.000248
1,519,382,715.000248
35,666
pythondev
help
`variables.update` does not return anything if `variables` is a dict
2018-02-23T10:45:15.000774
Aleida
pythondev_help_Aleida_2018-02-23T10:45:15.000774
1,519,382,715.000774
35,667
pythondev
help
append to the list, right? that's what you are doing
2018-02-23T10:45:17.000612
Tenesha
pythondev_help_Tenesha_2018-02-23T10:45:17.000612
1,519,382,717.000612
35,668
pythondev
help
it’s a dict
2018-02-23T10:45:23.000702
Tobias
pythondev_help_Tobias_2018-02-23T10:45:23.000702
1,519,382,723.000702
35,669
pythondev
help
so why that list comprehension?
2018-02-23T10:45:34.000756
Tenesha
pythondev_help_Tenesha_2018-02-23T10:45:34.000756
1,519,382,734.000756
35,670
pythondev
help
Then you really have a list of Nones
2018-02-23T10:45:37.000713
Aleida
pythondev_help_Aleida_2018-02-23T10:45:37.000713
1,519,382,737.000713
35,671
pythondev
help
it's a list of dicts
2018-02-23T10:45:43.000279
Tenesha
pythondev_help_Tenesha_2018-02-23T10:45:43.000279
1,519,382,743.000279
35,672
pythondev
help
don't do that, write a regular for loop
2018-02-23T10:45:45.000379
Aleida
pythondev_help_Aleida_2018-02-23T10:45:45.000379
1,519,382,745.000379
35,673
pythondev
help
i’m at the point in my learning python where i’m learning techniques and i’m abusing them
2018-02-23T10:46:15.000549
Tobias
pythondev_help_Tobias_2018-02-23T10:46:15.000549
1,519,382,775.000549
35,674
pythondev
help
that’s progress, right? hah
2018-02-23T10:46:24.000710
Tobias
pythondev_help_Tobias_2018-02-23T10:46:24.000710
1,519,382,784.00071
35,675
pythondev
help
Right but what you are doing in the for loop is not the same as what you are doing in the list comprehension. Just note that.
2018-02-23T10:46:45.000256
Tenesha
pythondev_help_Tenesha_2018-02-23T10:46:45.000256
1,519,382,805.000256
35,676
pythondev
help
how so?
2018-02-23T10:47:10.000723
Tobias
pythondev_help_Tobias_2018-02-23T10:47:10.000723
1,519,382,830.000723
35,677
pythondev
help
the variables are being mutated as i expect.
2018-02-23T10:47:33.000368
Tobias
pythondev_help_Tobias_2018-02-23T10:47:33.000368
1,519,382,853.000368
35,678
pythondev
help
but, i’m curious to learn what, under the covers, is different
2018-02-23T10:47:47.000755
Tobias
pythondev_help_Tobias_2018-02-23T10:47:47.000755
1,519,382,867.000755
35,679
pythondev
help
right but `[a for a in b]` returns (builds) a `list`
2018-02-23T10:47:51.000492
Tenesha
pythondev_help_Tenesha_2018-02-23T10:47:51.000492
1,519,382,871.000492
35,680
pythondev
help
right?
2018-02-23T10:48:06.000495
Tenesha
pythondev_help_Tenesha_2018-02-23T10:48:06.000495
1,519,382,886.000495
35,681
pythondev
help
ahh yes
2018-02-23T10:48:09.000714
Tobias
pythondev_help_Tobias_2018-02-23T10:48:09.000714
1,519,382,889.000714
35,682
pythondev
help
a list that goes to the ether because i’m not assigning it
2018-02-23T10:48:22.000165
Tobias
pythondev_help_Tobias_2018-02-23T10:48:22.000165
1,519,382,902.000165
35,683
pythondev
help
and thus explaining why my editor got upset with me
2018-02-23T10:48:32.000219
Tobias
pythondev_help_Tobias_2018-02-23T10:48:32.000219
1,519,382,912.000219
35,684
pythondev
help
geez, i’ve got a lot to learn
2018-02-23T10:48:40.000797
Tobias
pythondev_help_Tobias_2018-02-23T10:48:40.000797
1,519,382,920.000797
35,685
pythondev
help
That's nice, I'm on it for some years and still learning every day. That's the point of keep doing it I think.
2018-02-23T10:51:18.000248
Tenesha
pythondev_help_Tenesha_2018-02-23T10:51:18.000248
1,519,383,078.000248
35,686
pythondev
help
those llist comprehesions are still fuzzy to me
2018-02-23T10:56:04.000268
Elisha
pythondev_help_Elisha_2018-02-23T10:56:04.000268
1,519,383,364.000268
35,687
pythondev
help
i just did this last night and feel like a super badass `[[(case['created_at'][0:10], label) for label in case['labels']] for case in cases]`
2018-02-23T10:56:55.000654
Elisha
pythondev_help_Elisha_2018-02-23T10:56:55.000654
1,519,383,415.000654
35,688
pythondev
help
smushed a disgusting nested loop into one line, python is so cool
2018-02-23T10:57:26.000064
Elisha
pythondev_help_Elisha_2018-02-23T10:57:26.000064
1,519,383,446.000064
35,689
pythondev
help
i feel really rad doing things like that, but also feel like sometimes it affects readability
2018-02-23T11:00:43.000537
Tobias
pythondev_help_Tobias_2018-02-23T11:00:43.000537
1,519,383,643.000537
35,690
pythondev
help
`[(case['created_at'][0:10], label) for case in cases for label in case['labels']]`
2018-02-23T11:00:44.000125
Aleida
pythondev_help_Aleida_2018-02-23T11:00:44.000125
1,519,383,644.000125
35,691
pythondev
help
``` ret = [(case['created_at'][0:10], label) for case in cases for label in case['labels']] ```
2018-02-23T11:01:33.000272
Aleida
pythondev_help_Aleida_2018-02-23T11:01:33.000272
1,519,383,693.000272
35,692
pythondev
help
That's how I would do that
2018-02-23T11:01:59.000367
Aleida
pythondev_help_Aleida_2018-02-23T11:01:59.000367
1,519,383,719.000367
35,693
pythondev
help
lemme throw a harder one at ya then :wink:
2018-02-23T11:02:59.000644
Elisha
pythondev_help_Elisha_2018-02-23T11:02:59.000644
1,519,383,779.000644
35,694
pythondev
help
i feel cheap asking because it's something I will learn with time
2018-02-23T11:03:15.000390
Elisha
pythondev_help_Elisha_2018-02-23T11:03:15.000390
1,519,383,795.00039
35,695
pythondev
help
but lets say I have a list of dicts
2018-02-23T11:03:20.000709
Elisha
pythondev_help_Elisha_2018-02-23T11:03:20.000709
1,519,383,800.000709
35,696
pythondev
help
and each dict contains a timestamp, and a list of items
2018-02-23T11:03:40.000036
Elisha
pythondev_help_Elisha_2018-02-23T11:03:40.000036
1,519,383,820.000036
35,697
pythondev
help
would that work <@Aleida> ?
2018-02-23T11:03:54.000596
Micki
pythondev_help_Micki_2018-02-23T11:03:54.000596
1,519,383,834.000596
35,698
pythondev
help
and I want to know the total count of each item for each distinct timestamp
2018-02-23T11:03:55.000748
Elisha
pythondev_help_Elisha_2018-02-23T11:03:55.000748
1,519,383,835.000748
35,699
pythondev
help
<@Micki> try it :wink:
2018-02-23T11:04:12.000247
Aleida
pythondev_help_Aleida_2018-02-23T11:04:12.000247
1,519,383,852.000247
35,700
pythondev
help
the output would look like ``` 2018-02-22{ foo: 1 bar: 6 baz: 2 } ```
2018-02-23T11:04:33.000116
Elisha
pythondev_help_Elisha_2018-02-23T11:04:33.000116
1,519,383,873.000116
35,701
pythondev
help
I had a weird things with list comp yesterday. But I don't remember who else was in the discussion :confused:
2018-02-23T11:04:43.000029
Micki
pythondev_help_Micki_2018-02-23T11:04:43.000029
1,519,383,883.000029
35,702
pythondev
help
<@Elisha> can you show an example input?
2018-02-23T11:05:25.000517
Aleida
pythondev_help_Aleida_2018-02-23T11:05:25.000517
1,519,383,925.000517
35,703
pythondev
help
sure thing
2018-02-23T11:05:29.000863
Elisha
pythondev_help_Elisha_2018-02-23T11:05:29.000863
1,519,383,929.000863
35,704
pythondev
help
I think i was here <@Micki>
2018-02-23T11:08:18.000344
Tobias
pythondev_help_Tobias_2018-02-23T11:08:18.000344
1,519,384,098.000344
35,705
pythondev
help
input: ``` [ {'created_at': '2018-02-22' 'labels': [foo, bar] }, {'created_at': '2018-02-23' 'labels': [baz] } ] ``` requested output: ``` [ [2018-02-22 : [foo: 1 bar: 1], [2018-02-23 : [baz: 1] ] ``` that input list would contain hundreds of dicts with multiple dicts containing the same `created_at` I currentl...
2018-02-23T11:08:39.000231
Elisha
pythondev_help_Elisha_2018-02-23T11:08:39.000231
1,519,384,119.000231
35,706
pythondev
help
I ended up doing a nested for loop and breaking some of the bits into functions
2018-02-23T11:08:39.000558
Tobias
pythondev_help_Tobias_2018-02-23T11:08:39.000558
1,519,384,119.000558
35,707
pythondev
help
forgive me if my list/dict symbols are wrong
2018-02-23T11:08:49.000521
Elisha
pythondev_help_Elisha_2018-02-23T11:08:49.000521
1,519,384,129.000521
35,708
pythondev
help
do you remember what you had originally ? I'm curious of what I missed :slightly_smiling_face:
2018-02-23T11:09:20.000691
Micki
pythondev_help_Micki_2018-02-23T11:09:20.000691
1,519,384,160.000691
35,709
pythondev
help
<@Elisha> ``` In [12]: data = [{'created_at': '2018-02-22', 'labels': ['foo', 'bar']}, {'created_at': '2018-02-23', 'labels': ['baz']}] In [13]: from collections import Counter In [14]: res = {entry['created_at']: Counter(entry['labels']) for entry in data} In [15]: res Out[15]: {'2018-02-22': Counter({'bar': 1, 'fo...
2018-02-23T11:14:02.000239
Aleida
pythondev_help_Aleida_2018-02-23T11:14:02.000239
1,519,384,442.000239
35,710
pythondev
help
I don’t have it, it was an issue with assigning a variable within the nested comp
2018-02-23T11:15:16.000273
Tobias
pythondev_help_Tobias_2018-02-23T11:15:16.000273
1,519,384,516.000273
35,711
pythondev
help
we determined that it worked for tuples, but not lists, or something to that effect
2018-02-23T11:15:29.000391
Tobias
pythondev_help_Tobias_2018-02-23T11:15:29.000391
1,519,384,529.000391
35,712
pythondev
help
&lt;- brain is fuzzy after working on this project pretty much non stop since i got the bug in my head
2018-02-23T11:15:50.000337
Tobias
pythondev_help_Tobias_2018-02-23T11:15:50.000337
1,519,384,550.000337
35,713
pythondev
help
<@Aleida> is collections the same thing as groups? I was going to spend a nice wholesome friday evening looking into those
2018-02-23T11:17:26.000567
Elisha
pythondev_help_Elisha_2018-02-23T11:17:26.000567
1,519,384,646.000567
35,714
pythondev
help
What are groups?
2018-02-23T11:18:02.000722
Aleida
pythondev_help_Aleida_2018-02-23T11:18:02.000722
1,519,384,682.000722
35,715
pythondev
help
collections is a module from the standard library
2018-02-23T11:18:15.000734
Aleida
pythondev_help_Aleida_2018-02-23T11:18:15.000734
1,519,384,695.000734
35,716
pythondev
help
a friend of mine said to look into groups to make that happen, i have no ida
2018-02-23T11:18:18.000164
Elisha
pythondev_help_Elisha_2018-02-23T11:18:18.000164
1,519,384,698.000164
35,717
pythondev
help
i assume he meant collections now
2018-02-23T11:18:32.000281
Elisha
pythondev_help_Elisha_2018-02-23T11:18:32.000281
1,519,384,712.000281
35,718
pythondev
help
lemme give you a hot, fresh, <@Aleida> :taco: for that tho
2018-02-23T11:19:18.000002
Elisha
pythondev_help_Elisha_2018-02-23T11:19:18.000002
1,519,384,758.000002
35,719
pythondev
help
Dunno what groups is, def. not stdlib AFAIK
2018-02-23T11:19:24.000211
Huong
pythondev_help_Huong_2018-02-23T11:19:24.000211
1,519,384,764.000211
35,720
pythondev
help
based on the context i'm fairly sure he meant collections
2018-02-23T11:19:54.000322
Elisha
pythondev_help_Elisha_2018-02-23T11:19:54.000322
1,519,384,794.000322
35,721
pythondev
help
collections is simple, not like itertools where comprehension goes to die
2018-02-23T11:20:00.000149
Huong
pythondev_help_Huong_2018-02-23T11:20:00.000149
1,519,384,800.000149
35,722
pythondev
help
i've heard horror stories about itertools and generators
2018-02-23T11:20:32.000510
Elisha
pythondev_help_Elisha_2018-02-23T11:20:32.000510
1,519,384,832.00051
35,723