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
ok thanks guys
2017-12-13T18:02:56.000249
Gemma
pythondev_help_Gemma_2017-12-13T18:02:56.000249
1,513,188,176.000249
103,703
pythondev
help
<@Devorah> you could just use regex's to find F, L and replace B
2017-12-13T18:07:56.000383
Miguelina
pythondev_help_Miguelina_2017-12-13T18:07:56.000383
1,513,188,476.000383
103,704
pythondev
help
I'm not there yet <@Miguelina> how would I do that?
2017-12-13T18:17:28.000313
Devorah
pythondev_help_Devorah_2017-12-13T18:17:28.000313
1,513,189,048.000313
103,705
pythondev
help
without knowing all the details I can't give the exact code but would look something like this ``` import re new_text = re.sub(r'(F)\s+(L)\s+(\d+)',r'\g&lt;3&gt;B',workers) ```
2017-12-13T18:23:24.000388
Miguelina
pythondev_help_Miguelina_2017-12-13T18:23:24.000388
1,513,189,404.000388
103,706
pythondev
help
will need to try it out a bit and tweak it maybe
2017-12-13T18:23:43.000266
Miguelina
pythondev_help_Miguelina_2017-12-13T18:23:43.000266
1,513,189,423.000266
103,707
pythondev
help
cool will do thanks!
2017-12-13T18:24:15.000132
Devorah
pythondev_help_Devorah_2017-12-13T18:24:15.000132
1,513,189,455.000132
103,708
pythondev
help
If you run into any trouble with regex I highly recommend using <http://regex101.com> which has a Python option for testing
2017-12-13T18:25:27.000397
Marcie
pythondev_help_Marcie_2017-12-13T18:25:27.000397
1,513,189,527.000397
103,709
pythondev
help
The string worked off the bat, but it's still saying there's a space in the 'correct' one that isn't being shown in mine..
2017-12-13T18:40:14.000277
Devorah
pythondev_help_Devorah_2017-12-13T18:40:14.000277
1,513,190,414.000277
103,710
pythondev
help
I've spent way too much time on this one problem, it's such a pain when beginning and getting hung up on this tiny dumb part.
2017-12-13T18:42:34.000048
Devorah
pythondev_help_Devorah_2017-12-13T18:42:34.000048
1,513,190,554.000048
103,711
pythondev
help
<#C07EW4DNE|learning_python>
2017-12-14T00:39:48.000060
Perla
pythondev_help_Perla_2017-12-14T00:39:48.000060
1,513,211,988.00006
103,712
pythondev
help
Hi <@Ora>, you can always ask on here for a code review! I'm sure someone will be willing to have a look. I gave someone some feedback on a small github project they wrote the other day and I'd be happy to do so again (as long as it's not too complicated :wink: )
2017-12-14T05:13:18.000330
Fabiola
pythondev_help_Fabiola_2017-12-14T05:13:18.000330
1,513,228,398.00033
103,713
pythondev
help
Hey has anyone seen a nice tutorial or guide on how to make haystack facets work? Its more of the rendering side i'm struggling with, facet data is being collected I just cant render to templates The documentation is not the best.
2017-12-14T07:08:50.000325
Robbin
pythondev_help_Robbin_2017-12-14T07:08:50.000325
1,513,235,330.000325
103,714
pythondev
help
With that kind of stuff I’ve found it’s usually best just to dive into the source and look, because yeah the docs aren’t so hot. :confused:
2017-12-14T07:31:50.000354
Junita
pythondev_help_Junita_2017-12-14T07:31:50.000354
1,513,236,710.000354
103,715
pythondev
help
Hey guys I have a json data that looks like this after using `json.dumps(data)`: `{\"id\": 5, \"first_name\": \"b\", \"last_name\": \"b\", \"email\": \"<mailto:b@gmail.com|b@gmail.com>\", \"username\": \"bb\", \"date_joined\": \"2017-12-05T16:49:22.527214+00:00\", \"country\": \"a\", \"goal\": \"a\", \"mobile_number\":...
2017-12-14T09:03:24.000013
Alba
pythondev_help_Alba_2017-12-14T09:03:24.000013
1,513,242,204.000013
103,716
pythondev
help
I want to take out all the `\`
2017-12-14T09:03:34.000435
Alba
pythondev_help_Alba_2017-12-14T09:03:34.000435
1,513,242,214.000435
103,717
pythondev
help
how do i do that since `'\'` isn't allowed in `.replace()`
2017-12-14T09:03:57.000396
Alba
pythondev_help_Alba_2017-12-14T09:03:57.000396
1,513,242,237.000396
103,718
pythondev
help
it doesn't allow `\`? you'd think there'd be an escape character (ex. `\\`) but im pretty new
2017-12-14T09:07:27.000616
Ozie
pythondev_help_Ozie_2017-12-14T09:07:27.000616
1,513,242,447.000616
103,719
pythondev
help
Yes `\` is the escape but when I tried to replace `\\` it didn't work :disappointed:
2017-12-14T09:16:32.000226
Alba
pythondev_help_Alba_2017-12-14T09:16:32.000226
1,513,242,992.000226
103,720
pythondev
help
It’s just “ signs , they are escaped because the whole string here is wrapped with “”
2017-12-14T09:19:49.000348
Kenia
pythondev_help_Kenia_2017-12-14T09:19:49.000348
1,513,243,189.000348
103,721
pythondev
help
Try print(json.dumps(data))
2017-12-14T09:20:25.000610
Kenia
pythondev_help_Kenia_2017-12-14T09:20:25.000610
1,513,243,225.00061
103,722
pythondev
help
are you printing that out?
2017-12-14T09:24:08.000222
Meg
pythondev_help_Meg_2017-12-14T09:24:08.000222
1,513,243,448.000222
103,723
pythondev
help
or is it just displaying in the shell
2017-12-14T09:24:17.000435
Meg
pythondev_help_Meg_2017-12-14T09:24:17.000435
1,513,243,457.000435
103,724
pythondev
help
so the solution was `json.loads(json.dumps(dict))` haha
2017-12-14T09:24:26.000163
Alba
pythondev_help_Alba_2017-12-14T09:24:26.000163
1,513,243,466.000163
103,725
pythondev
help
huh?
2017-12-14T09:24:43.000170
Meg
pythondev_help_Meg_2017-12-14T09:24:43.000170
1,513,243,483.00017
103,726
pythondev
help
that feels unintuitive though haha
2017-12-14T09:24:43.000234
Alba
pythondev_help_Alba_2017-12-14T09:24:43.000234
1,513,243,483.000234
103,727
pythondev
help
you never answered my question though
2017-12-14T09:24:55.000410
Meg
pythondev_help_Meg_2017-12-14T09:24:55.000410
1,513,243,495.00041
103,728
pythondev
help
you’re just loading the dict back into a dict after dumping to json
2017-12-14T09:25:13.000078
Meg
pythondev_help_Meg_2017-12-14T09:25:13.000078
1,513,243,513.000078
103,729
pythondev
help
so what does `print(json.dumps(data))` look like?
2017-12-14T09:25:28.000579
Meg
pythondev_help_Meg_2017-12-14T09:25:28.000579
1,513,243,528.000579
103,730
pythondev
help
yeah its super weird hold on i'll upload pics
2017-12-14T09:26:12.000403
Alba
pythondev_help_Alba_2017-12-14T09:26:12.000403
1,513,243,572.000403
103,731
pythondev
help
This one using `json.dumps(user_details)`
2017-12-14T09:27:02.000375
Alba
pythondev_help_Alba_2017-12-14T09:27:02.000375
1,513,243,622.000375
103,732
pythondev
help
what is `user_details`? Looks like you're dumping a string to a string
2017-12-14T09:28:54.000435
Fabiola
pythondev_help_Fabiola_2017-12-14T09:28:54.000435
1,513,243,734.000435
103,733
pythondev
help
its a dictionary
2017-12-14T09:29:02.000840
Alba
pythondev_help_Alba_2017-12-14T09:29:02.000840
1,513,243,742.00084
103,734
pythondev
help
So i guess it makes sense, I json-ified the dict then made it readable using `json.loads`
2017-12-14T09:29:47.000158
Alba
pythondev_help_Alba_2017-12-14T09:29:47.000158
1,513,243,787.000158
103,735
pythondev
help
what are you trying to do?
2017-12-14T09:34:55.000536
Meg
pythondev_help_Meg_2017-12-14T09:34:55.000536
1,513,244,095.000536
103,736
pythondev
help
because if you’re printint the data out to a template, you don’t need to do the json stuff
2017-12-14T09:35:11.000511
Meg
pythondev_help_Meg_2017-12-14T09:35:11.000511
1,513,244,111.000511
103,737
pythondev
help
and if you’re logging to file, you don’t need that either
2017-12-14T09:35:24.000448
Meg
pythondev_help_Meg_2017-12-14T09:35:24.000448
1,513,244,124.000448
103,738
pythondev
help
basically, I think you’re driving yourself into an area of confusion about something that has zero relevance
2017-12-14T09:35:59.000165
Meg
pythondev_help_Meg_2017-12-14T09:35:59.000165
1,513,244,159.000165
103,739
pythondev
help
story of my life
2017-12-14T09:36:55.000542
Ozie
pythondev_help_Ozie_2017-12-14T09:36:55.000542
1,513,244,215.000542
103,740
pythondev
help
<@Meg> sorry for the late reply, the data being presented by the endpoint included the `\\` and I just wanted to remove it to make the front end api calls easier.
2017-12-14T10:44:36.000287
Alba
pythondev_help_Alba_2017-12-14T10:44:36.000287
1,513,248,276.000287
103,741
pythondev
help
Would it be worth it to multi-thread a computationally heavy for loop with 3000+ iterations that takes 20+ minutes to complete?
2017-12-14T11:07:41.000391
Myong
pythondev_help_Myong_2017-12-14T11:07:41.000391
1,513,249,661.000391
103,742
pythondev
help
how often do you need to do this?
2017-12-14T11:08:11.000429
Junita
pythondev_help_Junita_2017-12-14T11:08:11.000429
1,513,249,691.000429
103,743
pythondev
help
Once a day
2017-12-14T11:08:23.000390
Myong
pythondev_help_Myong_2017-12-14T11:08:23.000390
1,513,249,703.00039
103,744
pythondev
help
Or should I just be creating a bunch of workers
2017-12-14T11:08:45.000301
Myong
pythondev_help_Myong_2017-12-14T11:08:45.000301
1,513,249,725.000301
103,745
pythondev
help
really depends- do you care that it takes 20m? :)
2017-12-14T11:08:51.000327
Joann
pythondev_help_Joann_2017-12-14T11:08:51.000327
1,513,249,731.000327
103,746
pythondev
help
I’d go the multiprocessing route over threading, but yeah, like <@Joann> said - depends how much you care
2017-12-14T11:09:15.000109
Junita
pythondev_help_Junita_2017-12-14T11:09:15.000109
1,513,249,755.000109
103,747
pythondev
help
could be a good excuse to try the technique though
2017-12-14T11:09:26.000146
Junita
pythondev_help_Junita_2017-12-14T11:09:26.000146
1,513,249,766.000146
103,748
pythondev
help
Currently sitting at my desk awaiting completion so I got 20 minutes lol
2017-12-14T11:09:42.000719
Myong
pythondev_help_Myong_2017-12-14T11:09:42.000719
1,513,249,782.000719
103,749
pythondev
help
heh
2017-12-14T11:10:24.000662
Junita
pythondev_help_Junita_2017-12-14T11:10:24.000662
1,513,249,824.000662
103,750
pythondev
help
I mean if it’s something you have to wait for the result for then I’d say yes. How many cores does your machine have?
2017-12-14T11:10:55.000121
Junita
pythondev_help_Junita_2017-12-14T11:10:55.000121
1,513,249,855.000121
103,751
pythondev
help
if the work you're doing is cpu bound I'm not sure if traditional multi-threading will help that much, wouldn't it be stuck on one core anyway?
2017-12-14T11:14:25.000611
Antionette
pythondev_help_Antionette_2017-12-14T11:14:25.000611
1,513,250,065.000611
103,752
pythondev
help
8 total with hyperthreading
2017-12-14T11:14:52.000150
Myong
pythondev_help_Myong_2017-12-14T11:14:52.000150
1,513,250,092.00015
103,753
pythondev
help
huh? no
2017-12-14T11:14:52.000430
Joann
pythondev_help_Joann_2017-12-14T11:14:52.000430
1,513,250,092.00043
103,754
pythondev
help
well, idk what you mean by 'traditional multi-threading' to be fair, but Linux threads will certainly get you access to multiple CPUs...
2017-12-14T11:16:06.000619
Joann
pythondev_help_Joann_2017-12-14T11:16:06.000619
1,513,250,166.000619
103,755
pythondev
help
In pure cpython you are block by the GIL
2017-12-14T11:16:42.000273
Ciera
pythondev_help_Ciera_2017-12-14T11:16:42.000273
1,513,250,202.000273
103,756
pythondev
help
I meant python threads vs a library like multi processing
2017-12-14T11:16:53.000208
Antionette
pythondev_help_Antionette_2017-12-14T11:16:53.000208
1,513,250,213.000208
103,757
pythondev
help
<@Antionette> I believe `ThreadPoolExecutor` works properly
2017-12-14T11:16:57.000726
Myong
pythondev_help_Myong_2017-12-14T11:16:57.000726
1,513,250,217.000726
103,758
pythondev
help
you need to drop in C or use multiprocessing
2017-12-14T11:16:59.000086
Ciera
pythondev_help_Ciera_2017-12-14T11:16:59.000086
1,513,250,219.000086
103,759
pythondev
help
oh, ugh, forgot which slack I was on. :)
2017-12-14T11:17:36.000462
Joann
pythondev_help_Joann_2017-12-14T11:17:36.000462
1,513,250,256.000462
103,760
pythondev
help
silly python
2017-12-14T11:17:40.000808
Joann
pythondev_help_Joann_2017-12-14T11:17:40.000808
1,513,250,260.000808
103,761
pythondev
help
Multithreading for IO bound, Multiprocess for CPU bound
2017-12-14T11:17:55.000427
Myong
pythondev_help_Myong_2017-12-14T11:17:55.000427
1,513,250,275.000427
103,762
pythondev
help
really good talk about concurrency in python <https://www.youtube.com/watch?v=9zinZmE3Ogk> :slightly_smiling_face:
2017-12-14T11:18:09.000642
Ciera
pythondev_help_Ciera_2017-12-14T11:18:09.000642
1,513,250,289.000642
103,763
pythondev
help
IIRC
2017-12-14T11:18:14.000851
Myong
pythondev_help_Myong_2017-12-14T11:18:14.000851
1,513,250,294.000851
103,764
pythondev
help
How many processes should I have running at once?
2017-12-14T11:18:46.000293
Myong
pythondev_help_Myong_2017-12-14T11:18:46.000293
1,513,250,326.000293
103,765
pythondev
help
with 8 HTs, I'd probably try 10
2017-12-14T11:19:16.000147
Joann
pythondev_help_Joann_2017-12-14T11:19:16.000147
1,513,250,356.000147
103,766
pythondev
help
you could time that and then vary the # of processes and see if there's much change
2017-12-14T11:19:51.000288
Joann
pythondev_help_Joann_2017-12-14T11:19:51.000288
1,513,250,391.000288
103,767
pythondev
help
n° of core + 1 is the rule I heard but I don't really know :smile:
2017-12-14T11:19:59.000284
Ciera
pythondev_help_Ciera_2017-12-14T11:19:59.000284
1,513,250,399.000284
103,768
pythondev
help
it really depends on a lot of different things, heh.
2017-12-14T11:20:13.000621
Joann
pythondev_help_Joann_2017-12-14T11:20:13.000621
1,513,250,413.000621
103,769
pythondev
help
yeah
2017-12-14T11:20:18.000058
Suellen
pythondev_help_Suellen_2017-12-14T11:20:18.000058
1,513,250,418.000058
103,770
pythondev
help
very hard even to estimate
2017-12-14T11:20:31.000028
Suellen
pythondev_help_Suellen_2017-12-14T11:20:31.000028
1,513,250,431.000028
103,771
pythondev
help
The difference is likely to be relatively small in total runtime anyway tho.
2017-12-14T11:20:35.000877
Joann
pythondev_help_Joann_2017-12-14T11:20:35.000877
1,513,250,435.000877
103,772
pythondev
help
but it's easy to shoot yourself in the foot and make parallel code work slower than one-core-one-thread
2017-12-14T11:20:52.000362
Suellen
pythondev_help_Suellen_2017-12-14T11:20:52.000362
1,513,250,452.000362
103,773
pythondev
help
RE: multiprocessing communication overhead
2017-12-14T11:21:20.000490
Suellen
pythondev_help_Suellen_2017-12-14T11:21:20.000490
1,513,250,480.00049
103,774
pythondev
help
Now the attempt to get `tqdm` to work with this
2017-12-14T11:25:39.000287
Myong
pythondev_help_Myong_2017-12-14T11:25:39.000287
1,513,250,739.000287
103,775
pythondev
help
<@Myong> Looks like you can afford to spend about a day or two on this before you wipe out any gains in time you make over a year: <https://xkcd.com/1205/>
2017-12-14T11:26:41.000239
Fabiola
pythondev_help_Fabiola_2017-12-14T11:26:41.000239
1,513,250,801.000239
103,776
pythondev
help
Assuming you shave 5-10 minutes off the task
2017-12-14T11:27:17.000409
Fabiola
pythondev_help_Fabiola_2017-12-14T11:27:17.000409
1,513,250,837.000409
103,777
pythondev
help
haha nice chart :smile:
2017-12-14T11:27:33.000481
Ciera
pythondev_help_Ciera_2017-12-14T11:27:33.000481
1,513,250,853.000481
103,778
pythondev
help
relevant xkcd!
2017-12-14T11:27:54.000588
Suellen
pythondev_help_Suellen_2017-12-14T11:27:54.000588
1,513,250,874.000588
103,779
pythondev
help
I like how some are greyed out. Like `you should have already done it` :smile:
2017-12-14T11:28:28.000332
Ciera
pythondev_help_Ciera_2017-12-14T11:28:28.000332
1,513,250,908.000332
103,780
pythondev
help
today's one was kind of happy/sad
2017-12-14T11:28:49.000039
Ciera
pythondev_help_Ciera_2017-12-14T11:28:49.000039
1,513,250,929.000039
103,781
pythondev
help
oh no
2017-12-14T11:29:18.000902
Suellen
pythondev_help_Suellen_2017-12-14T11:29:18.000902
1,513,250,958.000902
103,782
pythondev
help
wow, yeah, hadn't read it yet
2017-12-14T11:30:15.000265
Fabiola
pythondev_help_Fabiola_2017-12-14T11:30:15.000265
1,513,251,015.000265
103,783
pythondev
help
<@Myong> have you checked your time-complexity, for example, do you have inner and outer for loops? also have you profiled the code at all?
2017-12-14T11:30:50.000239
Seema
pythondev_help_Seema_2017-12-14T11:30:50.000239
1,513,251,050.000239
103,784
pythondev
help
Yeah I ran a profile on it
2017-12-14T11:31:01.000875
Myong
pythondev_help_Myong_2017-12-14T11:31:01.000875
1,513,251,061.000875
103,785
pythondev
help
It's basically a word likeness algorithm that runs on a few thousand inputs
2017-12-14T11:31:37.000067
Myong
pythondev_help_Myong_2017-12-14T11:31:37.000067
1,513,251,097.000067
103,786
pythondev
help
<@Myong> I don't know what the task is, but would it be possible to run it as a cron job before you need it, so you're not actually waiting for it?
2017-12-14T11:31:41.000913
Fabiola
pythondev_help_Fabiola_2017-12-14T11:31:41.000913
1,513,251,101.000913
103,787
pythondev
help
It spends about 97% of the time inside a single function
2017-12-14T11:31:59.000444
Myong
pythondev_help_Myong_2017-12-14T11:31:59.000444
1,513,251,119.000444
103,788
pythondev
help
Or is it something you need to run on up to date data when you get it?
2017-12-14T11:32:04.000109
Fabiola
pythondev_help_Fabiola_2017-12-14T11:32:04.000109
1,513,251,124.000109
103,789
pythondev
help
hope it's not the slow Levenstein
2017-12-14T11:32:05.000157
Suellen
pythondev_help_Suellen_2017-12-14T11:32:05.000157
1,513,251,125.000157
103,790
pythondev
help
It's useing `FuzzyWuzzy`
2017-12-14T11:32:19.000386
Myong
pythondev_help_Myong_2017-12-14T11:32:19.000386
1,513,251,139.000386
103,791
pythondev
help
<https://github.com/seatgeek/fuzzywuzzy>
2017-12-14T11:32:38.000428
Myong
pythondev_help_Myong_2017-12-14T11:32:38.000428
1,513,251,158.000428
103,792
pythondev
help
it might be a good opportunity to learn cython :smile:
2017-12-14T11:33:22.000304
Ciera
pythondev_help_Ciera_2017-12-14T11:33:22.000304
1,513,251,202.000304
103,793
pythondev
help
You could be correct
2017-12-14T11:33:46.000391
Myong
pythondev_help_Myong_2017-12-14T11:33:46.000391
1,513,251,226.000391
103,794
pythondev
help
I'm just not busy at work and trying to improve this little script
2017-12-14T11:34:00.000401
Myong
pythondev_help_Myong_2017-12-14T11:34:00.000401
1,513,251,240.000401
103,795
pythondev
help
"cheap" ways to *potentially* increase speed are to compile the program or try pypy, though reference that time chart for pypy :wink:
2017-12-14T11:34:31.000407
Seema
pythondev_help_Seema_2017-12-14T11:34:31.000407
1,513,251,271.000407
103,796
pythondev
help
Okay I'll check it out
2017-12-14T11:36:15.000118
Myong
pythondev_help_Myong_2017-12-14T11:36:15.000118
1,513,251,375.000118
103,797
pythondev
help
yeah pypi is a good idea :thumbsup:
2017-12-14T11:36:26.000856
Ciera
pythondev_help_Ciera_2017-12-14T11:36:26.000856
1,513,251,386.000856
103,798
pythondev
help
lol, I can never get the name right
2017-12-14T11:36:49.000417
Seema
pythondev_help_Seema_2017-12-14T11:36:49.000417
1,513,251,409.000417
103,799
pythondev
help
the python package index?
2017-12-14T11:36:50.000805
Myong
pythondev_help_Myong_2017-12-14T11:36:50.000805
1,513,251,410.000805
103,800
pythondev
help
Oh I got confused for a sec
2017-12-14T11:37:17.000206
Myong
pythondev_help_Myong_2017-12-14T11:37:17.000206
1,513,251,437.000206
103,801
pythondev
help
pypy is a python compiled python interpreter, no C underneath
2017-12-14T11:37:36.000597
Seema
pythondev_help_Seema_2017-12-14T11:37:36.000597
1,513,251,456.000597
103,802