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
<@Von> optionally, i wrote a library for this called “delegator.py”, which makes it a bit easier :)
2018-01-15T10:35:00.000393
Meghan
pythondev_help_Meghan_2018-01-15T10:35:00.000393
1,516,012,500.000393
29,124
pythondev
help
I'll give it a look, thanks
2018-01-15T10:52:45.000211
Von
pythondev_help_Von_2018-01-15T10:52:45.000211
1,516,013,565.000211
29,125
pythondev
help
it is so weird...
2018-01-15T18:22:29.000144
Stefan
pythondev_help_Stefan_2018-01-15T18:22:29.000144
1,516,040,549.000144
29,126
pythondev
help
also with a normal function it is not possible this way
2018-01-15T18:24:24.000331
Stefan
pythondev_help_Stefan_2018-01-15T18:24:24.000331
1,516,040,664.000331
29,127
pythondev
help
not so anonymous, eh?
2018-01-15T18:24:56.000272
Brande
pythondev_help_Brande_2018-01-15T18:24:56.000272
1,516,040,696.000272
29,128
pythondev
help
<https://stackoverflow.com/questions/10875442/possible-to-change-a-functions-repr-in-python>
2018-01-15T18:25:11.000108
Stefan
pythondev_help_Stefan_2018-01-15T18:25:11.000108
1,516,040,711.000108
29,129
pythondev
help
but seriously... this is so counterintuitive
2018-01-15T18:25:26.000029
Stefan
pythondev_help_Stefan_2018-01-15T18:25:26.000029
1,516,040,726.000029
29,130
pythondev
help
it should just work
2018-01-15T18:25:30.000054
Stefan
pythondev_help_Stefan_2018-01-15T18:25:30.000054
1,516,040,730.000054
29,131
pythondev
help
Hey Everyone
2018-01-15T18:26:20.000288
Frances
pythondev_help_Frances_2018-01-15T18:26:20.000288
1,516,040,780.000288
29,132
pythondev
help
hoping to get some quick advice on an issue that I know I'm close to solving. I am running code to save a csv but getting an error because the filename saves with a carriage return and newline character at the beginning. eg. \r\nmyfile.csv
2018-01-15T18:26:32.000089
Frances
pythondev_help_Frances_2018-01-15T18:26:32.000089
1,516,040,792.000089
29,133
pythondev
help
``` outputFile = open('/output/'+filename, 'wb') outputWriter = csv.writer(outputFile) ```
2018-01-15T18:27:52.000335
Frances
pythondev_help_Frances_2018-01-15T18:27:52.000335
1,516,040,872.000335
29,134
pythondev
help
"No, because repr(f) is done as type(f).__repr__(f) instead."
2018-01-15T18:27:53.000074
Stefan
pythondev_help_Stefan_2018-01-15T18:27:53.000074
1,516,040,873.000074
29,135
pythondev
help
anyone have experience with google cloud vision api?
2018-01-15T23:58:02.000040
Shila
pythondev_help_Shila_2018-01-15T23:58:02.000040
1,516,060,682.00004
29,136
pythondev
help
on windows, python 3.6, trying two different methods for accessing the api, both are failing
2018-01-15T23:58:17.000129
Shila
pythondev_help_Shila_2018-01-15T23:58:17.000129
1,516,060,697.000129
29,137
pythondev
help
one says “cannot import name types”
2018-01-15T23:58:38.000003
Shila
pythondev_help_Shila_2018-01-15T23:58:38.000003
1,516,060,718.000003
29,138
pythondev
help
the other says it’s expecting something in the google authentication json file, but doesn’t say what it’s expecting
2018-01-15T23:58:54.000150
Shila
pythondev_help_Shila_2018-01-15T23:58:54.000150
1,516,060,734.00015
29,139
pythondev
help
Hey guys i'm on a Codewars challenge , and im getting this error `TypeError: expected a character buffer object`
2018-01-16T04:39:10.000525
Tanesha
pythondev_help_Tanesha_2018-01-16T04:39:10.000525
1,516,077,550.000525
29,140
pythondev
help
Can anyone explain to me what this means?
2018-01-16T04:39:22.000203
Tanesha
pythondev_help_Tanesha_2018-01-16T04:39:22.000203
1,516,077,562.000203
29,141
pythondev
help
``` def get_middle(s): num = len(s) if num % 2 == 0: print('even') one = num/2-1 two = num/2 return(s[one] + s[two]) else: print("odd") index = int(num/2) print(s.find(index)) ```
2018-01-16T04:39:29.000267
Tanesha
pythondev_help_Tanesha_2018-01-16T04:39:29.000267
1,516,077,569.000267
29,142
pythondev
help
I think the error is coming from the last two lines of the function
2018-01-16T04:39:44.000438
Tanesha
pythondev_help_Tanesha_2018-01-16T04:39:44.000438
1,516,077,584.000438
29,143
pythondev
help
s.find() takes a string
2018-01-16T04:42:27.000371
Barney
pythondev_help_Barney_2018-01-16T04:42:27.000371
1,516,077,747.000371
29,144
pythondev
help
not a number
2018-01-16T04:42:28.000147
Barney
pythondev_help_Barney_2018-01-16T04:42:28.000147
1,516,077,748.000147
29,145
pythondev
help
``` &gt;&gt;&gt; 'abcdef'.find('cd') 2 ```
2018-01-16T04:42:43.000346
Barney
pythondev_help_Barney_2018-01-16T04:42:43.000346
1,516,077,763.000346
29,146
pythondev
help
maybe you wanted `s[index]`?
2018-01-16T04:43:11.000079
Barney
pythondev_help_Barney_2018-01-16T04:43:11.000079
1,516,077,791.000079
29,147
pythondev
help
`return(s.index(str(num/2)))`
2018-01-16T04:50:16.000325
Tanesha
pythondev_help_Tanesha_2018-01-16T04:50:16.000325
1,516,078,216.000325
29,148
pythondev
help
Now im getting substring not found
2018-01-16T04:50:22.000282
Tanesha
pythondev_help_Tanesha_2018-01-16T04:50:22.000282
1,516,078,222.000282
29,149
pythondev
help
because there's no such substring in `s`
2018-01-16T04:51:05.000165
Barney
pythondev_help_Barney_2018-01-16T04:51:05.000165
1,516,078,265.000165
29,150
pythondev
help
probably:)
2018-01-16T04:51:10.000162
Barney
pythondev_help_Barney_2018-01-16T04:51:10.000162
1,516,078,270.000162
29,151
pythondev
help
'return(s.index(num/2))' - So why is this expecting a character buffer?
2018-01-16T04:51:59.000573
Tanesha
pythondev_help_Tanesha_2018-01-16T04:51:59.000573
1,516,078,319.000573
29,152
pythondev
help
what
2018-01-16T04:52:09.000118
Barney
pythondev_help_Barney_2018-01-16T04:52:09.000118
1,516,078,329.000118
29,153
pythondev
help
str.index is a function that takes a string `a`, and looks for `a` in `str`
2018-01-16T04:52:39.000101
Barney
pythondev_help_Barney_2018-01-16T04:52:39.000101
1,516,078,359.000101
29,154
pythondev
help
and then tells you in which position it was found
2018-01-16T04:52:49.000630
Barney
pythondev_help_Barney_2018-01-16T04:52:49.000630
1,516,078,369.00063
29,155
pythondev
help
i.e., `"abcdef".index("cd")` is 2
2018-01-16T04:53:03.000395
Barney
pythondev_help_Barney_2018-01-16T04:53:03.000395
1,516,078,383.000395
29,156
pythondev
help
Okay so how do i search by index?
2018-01-16T04:53:17.000080
Tanesha
pythondev_help_Tanesha_2018-01-16T04:53:17.000080
1,516,078,397.00008
29,157
pythondev
help
with integer?
2018-01-16T04:53:32.000111
Tanesha
pythondev_help_Tanesha_2018-01-16T04:53:32.000111
1,516,078,412.000111
29,158
pythondev
help
`string[n]`?
2018-01-16T04:53:56.000132
Barney
pythondev_help_Barney_2018-01-16T04:53:56.000132
1,516,078,436.000132
29,159
pythondev
help
i.e., `"abcdef"[1]` is `"b"`
2018-01-16T04:54:09.000006
Barney
pythondev_help_Barney_2018-01-16T04:54:09.000006
1,516,078,449.000006
29,160
pythondev
help
oh jesus.
2018-01-16T04:54:33.000323
Tanesha
pythondev_help_Tanesha_2018-01-16T04:54:33.000323
1,516,078,473.000323
29,161
pythondev
help
`return(s[num/2])` - i was over thinking it, thansks :slightly_smiling_face: sorted now.
2018-01-16T04:54:56.000288
Tanesha
pythondev_help_Tanesha_2018-01-16T04:54:56.000288
1,516,078,496.000288
29,162
pythondev
help
Would anyone happen to know how to login to a django-powered site by giving credentials through the url? Or is it too variable to say?
2018-01-16T08:13:35.000025
Von
pythondev_help_Von_2018-01-16T08:13:35.000025
1,516,090,415.000025
29,163
pythondev
help
That isn’t a normally supported pattern as it is quite insecure
2018-01-16T08:21:46.000187
Cecila
pythondev_help_Cecila_2018-01-16T08:21:46.000187
1,516,090,906.000187
29,164
pythondev
help
don’t
2018-01-16T08:21:48.000494
Floy
pythondev_help_Floy_2018-01-16T08:21:48.000494
1,516,090,908.000494
29,165
pythondev
help
So it would depend on the site supporting it and making the security compromise
2018-01-16T08:21:59.000426
Cecila
pythondev_help_Cecila_2018-01-16T08:21:59.000426
1,516,090,919.000426
29,166
pythondev
help
you can provide a token via url, which is often used with api services
2018-01-16T08:22:08.000239
Floy
pythondev_help_Floy_2018-01-16T08:22:08.000239
1,516,090,928.000239
29,167
pythondev
help
but all that is doing is saying you’re ok to access that particular resource
2018-01-16T08:22:30.000092
Floy
pythondev_help_Floy_2018-01-16T08:22:30.000092
1,516,090,950.000092
29,168
pythondev
help
and honestly, if I came across any site doing that, I would not use it and think the developer/agency/company is incompentent
2018-01-16T08:23:07.000322
Floy
pythondev_help_Floy_2018-01-16T08:23:07.000322
1,516,090,987.000322
29,169
pythondev
help
Point taken, thank you
2018-01-16T08:23:39.000613
Von
pythondev_help_Von_2018-01-16T08:23:39.000613
1,516,091,019.000613
29,170
pythondev
help
:thumbsup:
2018-01-16T08:26:02.000556
Floy
pythondev_help_Floy_2018-01-16T08:26:02.000556
1,516,091,162.000556
29,171
pythondev
help
Hi peeps! I hope I am posting in the right channel. Is there a channel for jupyter related issues/questions discussions?
2018-01-16T09:41:15.000512
Milly
pythondev_help_Milly_2018-01-16T09:41:15.000512
1,516,095,675.000512
29,172
pythondev
help
If you click on "Channels" you can search for it
2018-01-16T09:44:28.000825
Von
pythondev_help_Von_2018-01-16T09:44:28.000825
1,516,095,868.000825
29,173
pythondev
help
Cant fin it <@Von>. Did I miss it? Also cant create channels.
2018-01-16T09:46:24.000034
Milly
pythondev_help_Milly_2018-01-16T09:46:24.000034
1,516,095,984.000034
29,174
pythondev
help
Any idea whom/where can i request for it? PS: Thanks for the response buddy!!
2018-01-16T09:47:42.000638
Milly
pythondev_help_Milly_2018-01-16T09:47:42.000638
1,516,096,062.000638
29,175
pythondev
help
No idea if it exists or not, just pointing to where you can look for it
2018-01-16T09:48:10.000470
Von
pythondev_help_Von_2018-01-16T09:48:10.000470
1,516,096,090.00047
29,176
pythondev
help
You should be able to make it yourself
2018-01-16T09:49:16.000106
Von
pythondev_help_Von_2018-01-16T09:49:16.000106
1,516,096,156.000106
29,177
pythondev
help
Unfortunately, I dont see the :heavy_plus_sign: next to *Channels* to make it.
2018-01-16T09:50:29.000358
Milly
pythondev_help_Milly_2018-01-16T09:50:29.000358
1,516,096,229.000358
29,178
pythondev
help
Ah, then I guess we can't. Get a hold of a mod
2018-01-16T09:51:42.000059
Von
pythondev_help_Von_2018-01-16T09:51:42.000059
1,516,096,302.000059
29,179
pythondev
help
Guys, how could I remove all characters after *'.'* in an url?
2018-01-16T10:04:33.000396
Nilda
pythondev_help_Nilda_2018-01-16T10:04:33.000396
1,516,097,073.000396
29,180
pythondev
help
I'm trying this but doens't work : .rstrip('.')[-1]
2018-01-16T10:05:02.000501
Nilda
pythondev_help_Nilda_2018-01-16T10:05:02.000501
1,516,097,102.000501
29,181
pythondev
help
split the string on the `.`
2018-01-16T10:05:10.000381
Porsha
pythondev_help_Porsha_2018-01-16T10:05:10.000381
1,516,097,110.000381
29,182
pythondev
help
I want just the content before the last *.*
2018-01-16T10:05:42.000446
Nilda
pythondev_help_Nilda_2018-01-16T10:05:42.000446
1,516,097,142.000446
29,183
pythondev
help
```my_str = "<http://www.example.com|www.example.com>" a, b, c = my_str.split(".") print(a, b, c)```
2018-01-16T10:06:29.000021
Porsha
pythondev_help_Porsha_2018-01-16T10:06:29.000021
1,516,097,189.000021
29,184
pythondev
help
I would even say ``` my_str = "<http://www.example.com|www.example.com>" *a, b = my_str.split(".") print(b) ```
2018-01-16T10:07:30.000183
Sadye
pythondev_help_Sadye_2018-01-16T10:07:30.000183
1,516,097,250.000183
29,185
pythondev
help
If you need only the 'com' part
2018-01-16T10:07:37.000615
Sadye
pythondev_help_Sadye_2018-01-16T10:07:37.000615
1,516,097,257.000615
29,186
pythondev
help
I know that you need the stuff before, but I just wanted to showcase this neat language feature :slightly_smiling_face:
2018-01-16T10:08:12.001015
Sadye
pythondev_help_Sadye_2018-01-16T10:08:12.001015
1,516,097,292.001015
29,187
pythondev
help
This is providing you're working with a TLD with 1 dot
2018-01-16T10:08:17.000001
Porsha
pythondev_help_Porsha_2018-01-16T10:08:17.000001
1,516,097,297.000001
29,188
pythondev
help
if you are parsing url there is probably a module in the stdlib
2018-01-16T10:09:09.000443
Micki
pythondev_help_Micki_2018-01-16T10:09:09.000443
1,516,097,349.000443
29,189
pythondev
help
Btw, if you'll do this on a regular bases and with a different types of TLDs, I had good experience with <https://github.com/john-kurkowski/tldextract>
2018-01-16T10:09:30.000342
Sadye
pythondev_help_Sadye_2018-01-16T10:09:30.000342
1,516,097,370.000342
29,190
pythondev
help
```my_str = "<https://www.example.com>" split_str = my_str.split(".") domain = split_str[1] print(domain)```
2018-01-16T10:09:45.000536
Porsha
pythondev_help_Porsha_2018-01-16T10:09:45.000536
1,516,097,385.000536
29,191
pythondev
help
and stdlib has `urllib.parse.urlparse` in Python3
2018-01-16T10:10:12.000993
Sadye
pythondev_help_Sadye_2018-01-16T10:10:12.000993
1,516,097,412.000993
29,192
pythondev
help
Slice the split string to pull out the domain name
2018-01-16T10:10:15.000229
Porsha
pythondev_help_Porsha_2018-01-16T10:10:15.000229
1,516,097,415.000229
29,193
pythondev
help
Or use a library lol
2018-01-16T10:10:27.000517
Porsha
pythondev_help_Porsha_2018-01-16T10:10:27.000517
1,516,097,427.000517
29,194
pythondev
help
<@Milly>, <#C0JB9ATQV|data_science> would probably be able to answer any questions about jupyter.
2018-01-16T10:11:43.000547
Davina
pythondev_help_Davina_2018-01-16T10:11:43.000547
1,516,097,503.000547
29,195
pythondev
help
The problem is that I need all before the last dot
2018-01-16T10:14:54.000686
Nilda
pythondev_help_Nilda_2018-01-16T10:14:54.000686
1,516,097,694.000686
29,196
pythondev
help
I will check the library
2018-01-16T10:15:04.000608
Nilda
pythondev_help_Nilda_2018-01-16T10:15:04.000608
1,516,097,704.000608
29,197
pythondev
help
I could use regex too, forgot this detail
2018-01-16T10:19:05.000366
Nilda
pythondev_help_Nilda_2018-01-16T10:19:05.000366
1,516,097,945.000366
29,198
pythondev
help
<@Nilda> a.partition() (without 'r') would look for the first occurrence
2018-01-16T10:20:46.000589
Denisha
pythondev_help_Denisha_2018-01-16T10:20:46.000589
1,516,098,046.000589
29,199
pythondev
help
<@Tifany>ex Worked Perfectly! I didn't know rpartition, Thank you all <@Porsha> <@Sadye> <@Micki>
2018-01-16T10:25:58.000280
Nilda
pythondev_help_Nilda_2018-01-16T10:25:58.000280
1,516,098,358.00028
29,200
pythondev
help
<@Nilda> that will break on 2 period TLDs
2018-01-16T10:27:50.000425
Brande
pythondev_help_Brande_2018-01-16T10:27:50.000425
1,516,098,470.000425
29,201
pythondev
help
@joe yes. but I think he was not looking for tld's anyway. But if that was the goal, then better use a good library for it, because there are too many edge cases.
2018-01-16T10:29:10.000282
Denisha
pythondev_help_Denisha_2018-01-16T10:29:10.000282
1,516,098,550.000282
29,202
pythondev
help
what’s a 2 period TLD?
2018-01-16T10:29:18.000537
Zack
pythondev_help_Zack_2018-01-16T10:29:18.000537
1,516,098,558.000537
29,203
pythondev
help
<@Nilda> You can always slice the string on the `.` and concatenate the slices together
2018-01-16T10:29:19.000702
Porsha
pythondev_help_Porsha_2018-01-16T10:29:19.000702
1,516,098,559.000702
29,204
pythondev
help
<@Zack>.<http://co.uk|co.uk>, .<http://com.au|com.au> etc..
2018-01-16T10:29:43.000415
Porsha
pythondev_help_Porsha_2018-01-16T10:29:43.000415
1,516,098,583.000415
29,205
pythondev
help
.uk is the TLD there though?
2018-01-16T10:30:05.000623
Zack
pythondev_help_Zack_2018-01-16T10:30:05.000623
1,516,098,605.000623
29,206
pythondev
help
well on the literal sense yeah
2018-01-16T10:30:32.000101
Micki
pythondev_help_Micki_2018-01-16T10:30:32.000101
1,516,098,632.000101
29,207
pythondev
help
but I think people refer to them as TLD anyways
2018-01-16T10:30:49.000504
Micki
pythondev_help_Micki_2018-01-16T10:30:49.000504
1,516,098,649.000504
29,208
pythondev
help
I guess `.<http://co.uk|co.uk>` is the relevant registrar though?
2018-01-16T10:30:50.000824
Zack
pythondev_help_Zack_2018-01-16T10:30:50.000824
1,516,098,650.000824
29,209
pythondev
help
use a library. you can't do this with some simple split() or regex. Or you'll run into issues later on
2018-01-16T10:31:46.000856
Denisha
pythondev_help_Denisha_2018-01-16T10:31:46.000856
1,516,098,706.000856
29,210
pythondev
help
is there anything else peered with `.co` in `.<http://co.uk|co.uk>` or `.<http://co.au|co.au>`?
2018-01-16T10:32:26.000161
Zack
pythondev_help_Zack_2018-01-16T10:32:26.000161
1,516,098,746.000161
29,211
pythondev
help
It really depends what domains you're working with
2018-01-16T10:32:41.000004
Porsha
pythondev_help_Porsha_2018-01-16T10:32:41.000004
1,516,098,761.000004
29,212
pythondev
help
Subdomains might cause issues
2018-01-16T10:32:48.000854
Porsha
pythondev_help_Porsha_2018-01-16T10:32:48.000854
1,516,098,768.000854
29,213
pythondev
help
But I'm sure you could write some simple logic to get around it
2018-01-16T10:33:09.000556
Porsha
pythondev_help_Porsha_2018-01-16T10:33:09.000556
1,516,098,789.000556
29,214
pythondev
help
ah, interesting, internet says yes.
2018-01-16T10:33:18.000539
Zack
pythondev_help_Zack_2018-01-16T10:33:18.000539
1,516,098,798.000539
29,215
pythondev
help
why re-invent the wheel.
2018-01-16T10:33:27.000096
Denisha
pythondev_help_Denisha_2018-01-16T10:33:27.000096
1,516,098,807.000096
29,216
pythondev
help
Well, generally in public available domains such as `.<http://co.uk|co.uk>` `.uk` is a ccTLD (<https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains>) and `.co` is a second-level domain (<https://en.wikipedia.org/wiki/Second-level_domain>)
2018-01-16T10:34:42.000338
Sadye
pythondev_help_Sadye_2018-01-16T10:34:42.000338
1,516,098,882.000338
29,217
pythondev
help
<https://docs.python.org/2/library/urlparse.html>
2018-01-16T10:35:14.000311
Denisha
pythondev_help_Denisha_2018-01-16T10:35:14.000311
1,516,098,914.000311
29,218
pythondev
help
Thing is, you can't write reliable logic in code to determine whether domain is available or not for registering sub domains (if you need it). You can only rely on hardcoded list.
2018-01-16T10:36:22.000413
Sadye
pythondev_help_Sadye_2018-01-16T10:36:22.000413
1,516,098,982.000413
29,219
pythondev
help
Because by definition `example` in `<http://example.com|example.com>` and `co` in `<http://co.uk|co.uk>` are the same, but they are not the same in practice, obviously
2018-01-16T10:37:08.000381
Sadye
pythondev_help_Sadye_2018-01-16T10:37:08.000381
1,516,099,028.000381
29,220
pythondev
help
But usually people refer to domains such as `.<http://co.uk|co.uk>` and `.<http://com.au|com.au>` as TLD as well, just as <@Micki> said.
2018-01-16T10:39:35.000047
Sadye
pythondev_help_Sadye_2018-01-16T10:39:35.000047
1,516,099,175.000047
29,221
pythondev
help
is there a way to easily display the cotents of a `itertools._grouper` object?
2018-01-16T10:43:11.000221
Theressa
pythondev_help_Theressa_2018-01-16T10:43:11.000221
1,516,099,391.000221
29,222
pythondev
help
in this script there's a `itertools.groupby` object created with it's key and group passed into a function... this function then does some fancyness with the `_grouper` argument
2018-01-16T10:44:58.000272
Theressa
pythondev_help_Theressa_2018-01-16T10:44:58.000272
1,516,099,498.000272
29,223