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
lmfao
2018-01-18T20:17:25.000576
Tisa
pythondev_help_Tisa_2018-01-18T20:17:25.000576
1,516,306,645.000576
29,924
pythondev
help
list in arguments is leaking
2018-01-18T20:17:28.000440
Stefan
pythondev_help_Stefan_2018-01-18T20:17:28.000440
1,516,306,648.00044
29,925
pythondev
help
what the hell python
2018-01-18T20:17:33.000057
Tisa
pythondev_help_Tisa_2018-01-18T20:17:33.000057
1,516,306,653.000057
29,926
pythondev
help
don't use mutable arguments
2018-01-18T20:17:33.000988
Garrett
pythondev_help_Garrett_2018-01-18T20:17:33.000988
1,516,306,653.000988
29,927
pythondev
help
children=None
2018-01-18T20:17:35.000648
Stefan
pythondev_help_Stefan_2018-01-18T20:17:35.000648
1,516,306,655.000648
29,928
pythondev
help
if children is None: children = []
2018-01-18T20:17:44.000757
Stefan
pythondev_help_Stefan_2018-01-18T20:17:44.000757
1,516,306,664.000757
29,929
pythondev
help
you could use a tuple to prevent leaking
2018-01-18T20:17:59.001697
Stefan
pythondev_help_Stefan_2018-01-18T20:17:59.001697
1,516,306,679.001697
29,930
pythondev
help
children = tuple()
2018-01-18T20:18:06.000640
Stefan
pythondev_help_Stefan_2018-01-18T20:18:06.000640
1,516,306,686.00064
29,931
pythondev
help
ehh list is fine, setting to None by default fixes it for me
2018-01-18T20:18:21.000373
Tisa
pythondev_help_Tisa_2018-01-18T20:18:21.000373
1,516,306,701.000373
29,932
pythondev
help
typical case of... whatever floats your boat
2018-01-18T20:18:51.000397
Stefan
pythondev_help_Stefan_2018-01-18T20:18:51.000397
1,516,306,731.000397
29,933
pythondev
help
yup
2018-01-18T20:18:53.001329
Tisa
pythondev_help_Tisa_2018-01-18T20:18:53.001329
1,516,306,733.001329
29,934
pythondev
help
or sinks it :P
2018-01-18T20:18:57.000425
Tisa
pythondev_help_Tisa_2018-01-18T20:18:57.000425
1,516,306,737.000425
29,935
pythondev
help
i should have asked for your tree implementation then i would have seen it -_-
2018-01-18T20:19:14.000385
Stefan
pythondev_help_Stefan_2018-01-18T20:19:14.000385
1,516,306,754.000385
29,936
pythondev
help
eh, at least I learned a thing
2018-01-18T20:19:50.001121
Tisa
pythondev_help_Tisa_2018-01-18T20:19:50.001121
1,516,306,790.001121
29,937
pythondev
help
all python programmers end up having problems with it
2018-01-18T20:20:30.001070
Stefan
pythondev_help_Stefan_2018-01-18T20:20:30.001070
1,516,306,830.00107
29,938
pythondev
help
yep, mutable defaults bite everyone eventually
2018-01-18T20:20:59.001421
Garrett
pythondev_help_Garrett_2018-01-18T20:20:59.001421
1,516,306,859.001421
29,939
pythondev
help
interestingly you could see my case cover it (None then assigning to the case)
2018-01-18T20:21:16.000119
Stefan
pythondev_help_Stefan_2018-01-18T20:21:16.000119
1,516,306,876.000119
29,940
pythondev
help
I see that now, that makes sense
2018-01-18T20:25:04.000099
Tisa
pythondev_help_Tisa_2018-01-18T20:25:04.000099
1,516,307,104.000099
29,941
pythondev
help
hi how can i get from a json all the texts from symbol example (get like this : ETH,XRP) from jason info "symbol": "ETH", "symbol": "XRP", I have this code but need help import json with open("api.coinmarketcap.com.json") as input_file: data = json.load(input_file) #what should i put in data = to get all coin...
2018-01-19T01:28:52.000136
Retha
pythondev_help_Retha_2018-01-19T01:28:52.000136
1,516,325,332.000136
29,942
pythondev
help
<@Retha> This might help: <https://stackoverflow.com/questions/12353288/getting-values-from-json-using-python> Be sure to read the actual question, as OP includes how he's parsing the JSON
2018-01-19T01:45:11.000327
Dominica
pythondev_help_Dominica_2018-01-19T01:45:11.000327
1,516,326,311.000327
29,943
pythondev
help
ok thanks
2018-01-19T01:46:47.000845
Retha
pythondev_help_Retha_2018-01-19T01:46:47.000845
1,516,326,407.000845
29,944
pythondev
help
I am still stuck lol
2018-01-19T02:05:05.001425
Retha
pythondev_help_Retha_2018-01-19T02:05:05.001425
1,516,327,505.001425
29,945
pythondev
help
what is the file structure <@Retha>?
2018-01-19T02:36:33.000693
Lakita
pythondev_help_Lakita_2018-01-19T02:36:33.000693
1,516,329,393.000693
29,946
pythondev
help
what was the error?
2018-01-19T02:36:35.000424
Ben
pythondev_help_Ben_2018-01-19T02:36:35.000424
1,516,329,395.000424
29,947
pythondev
help
Thats the file, I want to extract only the symbols value
2018-01-19T02:38:29.001748
Retha
pythondev_help_Retha_2018-01-19T02:38:29.001748
1,516,329,509.001748
29,948
pythondev
help
list of symbols or mapping name(or id) -&gt; symbol ?
2018-01-19T02:40:29.001309
Lakita
pythondev_help_Lakita_2018-01-19T02:40:29.001309
1,516,329,629.001309
29,949
pythondev
help
list of symbols example: 'BTC', 'ETH', 'XRP',
2018-01-19T02:41:21.001244
Retha
pythondev_help_Retha_2018-01-19T02:41:21.001244
1,516,329,681.001244
29,950
pythondev
help
ok, so data currently stores a list of dictionaries, you'd have to iterate over them and grab only values corresponding to 'symbol' key
2018-01-19T02:42:33.001701
Lakita
pythondev_help_Lakita_2018-01-19T02:42:33.001701
1,516,329,753.001701
29,951
pythondev
help
the file structure is an array of dict, so you need to iter through this array, and access the dict
2018-01-19T02:42:38.000177
Ben
pythondev_help_Ben_2018-01-19T02:42:38.000177
1,516,329,758.000177
29,952
pythondev
help
yes thats what i read on the staackoverflow but I cant get it to work
2018-01-19T02:43:26.000458
Retha
pythondev_help_Retha_2018-01-19T02:43:26.000458
1,516,329,806.000458
29,953
pythondev
help
im trying again sec
2018-01-19T02:44:18.000357
Retha
pythondev_help_Retha_2018-01-19T02:44:18.000357
1,516,329,858.000357
29,954
pythondev
help
more explicit version ```In [3]: symbols = [] In [4]: for currency in data: ...: symbols.append(currency['symbol']) ```
2018-01-19T02:44:56.001402
Lakita
pythondev_help_Lakita_2018-01-19T02:44:56.001402
1,516,329,896.001402
29,955
pythondev
help
(list comprehension) ```symbols = [currency['symbol'] for currency in data] ```
2018-01-19T02:46:06.001872
Lakita
pythondev_help_Lakita_2018-01-19T02:46:06.001872
1,516,329,966.001872
29,956
pythondev
help
these are the most obvious ways, perhaps there are some others
2018-01-19T02:46:44.001653
Lakita
pythondev_help_Lakita_2018-01-19T02:46:44.001653
1,516,330,004.001653
29,957
pythondev
help
ok will do that i was doing this import json import sys with open("api.coinmarketcap.com.json") as input_file: data = json.load(input_file) json_str = json.dumps(data) resp = json.loads(json_str) print (resp) print (resp['symbol'])
2018-01-19T02:50:37.000941
Retha
pythondev_help_Retha_2018-01-19T02:50:37.000941
1,516,330,237.000941
29,958
pythondev
help
sorry if im a mess i am a begginer lol
2018-01-19T02:51:22.001562
Retha
pythondev_help_Retha_2018-01-19T02:51:22.001562
1,516,330,282.001562
29,959
pythondev
help
<@Lakita> i get none
2018-01-19T02:55:14.000777
Retha
pythondev_help_Retha_2018-01-19T02:55:14.000777
1,516,330,514.000777
29,960
pythondev
help
what am i doing wrong?
2018-01-19T02:56:23.000376
Retha
pythondev_help_Retha_2018-01-19T02:56:23.000376
1,516,330,583.000376
29,961
pythondev
help
delete the `data = symbols.append` line and try to print symbols variable
2018-01-19T02:57:41.000759
Sadye
pythondev_help_Sadye_2018-01-19T02:57:41.000759
1,516,330,661.000759
29,962
pythondev
help
What you're trying to do is to print result of a `list.append` function which always returns None
2018-01-19T02:58:17.000917
Sadye
pythondev_help_Sadye_2018-01-19T02:58:17.000917
1,516,330,697.000917
29,963
pythondev
help
symbols should contain results already
2018-01-19T02:59:07.001091
Sadye
pythondev_help_Sadye_2018-01-19T02:59:07.001091
1,516,330,747.001091
29,964
pythondev
help
i deleted the line but now it prints a bunch of stuff not only the symbols
2018-01-19T02:59:16.001099
Retha
pythondev_help_Retha_2018-01-19T02:59:16.001099
1,516,330,756.001099
29,965
pythondev
help
show us
2018-01-19T02:59:32.000435
Sadye
pythondev_help_Sadye_2018-01-19T02:59:32.000435
1,516,330,772.000435
29,966
pythondev
help
print(symbols), not print(data)
2018-01-19T03:00:31.001708
Sadye
pythondev_help_Sadye_2018-01-19T03:00:31.001708
1,516,330,831.001708
29,967
pythondev
help
data is your initially loaded file without changes
2018-01-19T03:00:41.001714
Sadye
pythondev_help_Sadye_2018-01-19T03:00:41.001714
1,516,330,841.001714
29,968
pythondev
help
nvm yeah i just noticed it
2018-01-19T03:00:53.001399
Retha
pythondev_help_Retha_2018-01-19T03:00:53.001399
1,516,330,853.001399
29,969
pythondev
help
thanks mate
2018-01-19T03:01:19.000405
Retha
pythondev_help_Retha_2018-01-19T03:01:19.000405
1,516,330,879.000405
29,970
pythondev
help
Mission acomplished
2018-01-19T03:01:45.000575
Retha
pythondev_help_Retha_2018-01-19T03:01:45.000575
1,516,330,905.000575
29,971
pythondev
help
haha
2018-01-19T03:01:47.002051
Retha
pythondev_help_Retha_2018-01-19T03:01:47.002051
1,516,330,907.002051
29,972
pythondev
help
haha 2 hours for that in the middle of a .py i wonder how long till i get all right :thinking_face:
2018-01-19T03:03:11.001229
Retha
pythondev_help_Retha_2018-01-19T03:03:11.001229
1,516,330,991.001229
29,973
pythondev
help
there are a bunch of useful debugging techniques
2018-01-19T03:04:45.001645
Sadye
pythondev_help_Sadye_2018-01-19T03:04:45.001645
1,516,331,085.001645
29,974
pythondev
help
For example, you could print every variable you create
2018-01-19T03:04:58.000454
Sadye
pythondev_help_Sadye_2018-01-19T03:04:58.000454
1,516,331,098.000454
29,975
pythondev
help
Or you can read about python lists and list comprehensions
2018-01-19T03:05:14.001035
Sadye
pythondev_help_Sadye_2018-01-19T03:05:14.001035
1,516,331,114.001035
29,976
pythondev
help
Ill read about it
2018-01-19T03:05:46.000612
Retha
pythondev_help_Retha_2018-01-19T03:05:46.000612
1,516,331,146.000612
29,977
pythondev
help
thanks
2018-01-19T03:05:50.000944
Retha
pythondev_help_Retha_2018-01-19T03:05:50.000944
1,516,331,150.000944
29,978
pythondev
help
If you'll do such things often, I suggest you to watch talk by dabeaz called "built in superheroes"
2018-01-19T03:06:45.000222
Sadye
pythondev_help_Sadye_2018-01-19T03:06:45.000222
1,516,331,205.000222
29,979
pythondev
help
<https://www.youtube.com/watch?v=j6VSAsKAj98>
2018-01-19T03:07:16.001073
Sadye
pythondev_help_Sadye_2018-01-19T03:07:16.001073
1,516,331,236.001073
29,980
pythondev
help
It's the most awesome video which do a quick showcase of how easily you can crunch data with python
2018-01-19T03:08:30.000054
Sadye
pythondev_help_Sadye_2018-01-19T03:08:30.000054
1,516,331,310.000054
29,981
pythondev
help
Thanks saving it to watch later
2018-01-19T03:10:52.000537
Retha
pythondev_help_Retha_2018-01-19T03:10:52.000537
1,516,331,452.000537
29,982
pythondev
help
good nights
2018-01-19T03:12:29.001867
Retha
pythondev_help_Retha_2018-01-19T03:12:29.001867
1,516,331,549.001867
29,983
pythondev
help
Hi all, I'm looking for some help. I've been asked to assist in finding an additional panelist for a Physics careers event later this month at the University of Oxford. This is to join myself, a Physics Professor and other respected experts to offer advice/help to PhD students and researchers looking to start a career...
2018-01-19T04:16:19.000068
Justin
pythondev_help_Justin_2018-01-19T04:16:19.000068
1,516,335,379.000068
29,984
pythondev
help
Hello all. What happens if subprocess.check_call() calls a process which couldn't finish? How it manage to return status different from 0? Is there any timeout ?
2018-01-19T05:27:55.000116
Dorian
pythondev_help_Dorian_2018-01-19T05:27:55.000116
1,516,339,675.000116
29,985
pythondev
help
<https://docs.python.org/3/library/subprocess.html#subprocess.check_call>
2018-01-19T05:28:39.001667
Micki
pythondev_help_Micki_2018-01-19T05:28:39.001667
1,516,339,719.001667
29,986
pythondev
help
there is a timeout and raise an exception if status != 0
2018-01-19T05:28:50.000487
Micki
pythondev_help_Micki_2018-01-19T05:28:50.000487
1,516,339,730.000487
29,987
pythondev
help
Thanks!
2018-01-19T05:34:05.001899
Dorian
pythondev_help_Dorian_2018-01-19T05:34:05.001899
1,516,340,045.001899
29,988
pythondev
help
Hi all! Anybody using python-docx?
2018-01-19T07:36:23.000859
Margarete
pythondev_help_Margarete_2018-01-19T07:36:23.000859
1,516,347,383.000859
29,989
pythondev
help
I intresting how to add text in loop
2018-01-19T07:36:42.000411
Margarete
pythondev_help_Margarete_2018-01-19T07:36:42.000411
1,516,347,402.000411
29,990
pythondev
help
Any idea of why I am always getting "Empty", even after 5 seconds elapsed?
2018-01-19T08:08:09.001443
Maye
pythondev_help_Maye_2018-01-19T08:08:09.001443
1,516,349,289.001443
29,991
pythondev
help
What I'd like to do is to get `Empty` if `takes_awhile` hasn't yet put any data into the queue, but after a while, I should see random numbers being printed, however I always get `Empty`
2018-01-19T08:14:38.000498
Maye
pythondev_help_Maye_2018-01-19T08:14:38.000498
1,516,349,678.000498
29,992
pythondev
help
<@Maye> works for me once imports are sorted and SomeClass is instantiated
2018-01-19T08:22:19.000465
Adrianne
pythondev_help_Adrianne_2018-01-19T08:22:19.000465
1,516,350,139.000465
29,993
pythondev
help
the wall of "Empty" probably makes it look like it's not working, when they're just hiding the less frequent instances of finding something on the queue
2018-01-19T08:23:15.000007
Adrianne
pythondev_help_Adrianne_2018-01-19T08:23:15.000007
1,516,350,195.000007
29,994
pythondev
help
<@Adrianne> hmm, that might be, I guess I can write a test around that, thanks
2018-01-19T08:24:27.000670
Maye
pythondev_help_Maye_2018-01-19T08:24:27.000670
1,516,350,267.00067
29,995
pythondev
help
Hey :slightly_smiling_face:
2018-01-19T10:21:48.000835
Pennie
pythondev_help_Pennie_2018-01-19T10:21:48.000835
1,516,357,308.000835
29,996
pythondev
help
Hello :slightly_smiling_face:
2018-01-19T10:22:18.000099
Merlin
pythondev_help_Merlin_2018-01-19T10:22:18.000099
1,516,357,338.000099
29,997
pythondev
help
I was wondering if there is a function that permits to set an "at least condition". Let me elaborate: Imagine you have a column with 240 items. Either "N" or "D". When there is a "D" you want at least 2 "N" before. Is there a specific function for that in python or maybe pandas? :slightly_smiling_face:
2018-01-19T10:26:05.001334
Pennie
pythondev_help_Pennie_2018-01-19T10:26:05.001334
1,516,357,565.001334
29,998
pythondev
help
It's hard to tell without an actual use case, but maybe you could somehow utilize built in `any` function? :thinking_face:
2018-01-19T10:30:51.000633
Sadye
pythondev_help_Sadye_2018-01-19T10:30:51.000633
1,516,357,851.000633
29,999
pythondev
help
<https://docs.python.org/3/library/functions.html#any>
2018-01-19T10:39:43.000775
Floy
pythondev_help_Floy_2018-01-19T10:39:43.000775
1,516,358,383.000775
30,000
pythondev
help
<https://leemendelowitz.github.io/blog/any-all-in-python.html>
2018-01-19T10:40:20.000647
Floy
pythondev_help_Floy_2018-01-19T10:40:20.000647
1,516,358,420.000647
30,001
pythondev
help
also it depends on how you are creating your dataframe. there are all sorts of things you can do to filter.
2018-01-19T10:40:57.000953
Davina
pythondev_help_Davina_2018-01-19T10:40:57.000953
1,516,358,457.000953
30,002
pythondev
help
I took a screenshot in order to be more clear
2018-01-19T10:43:01.000594
Pennie
pythondev_help_Pennie_2018-01-19T10:43:01.000594
1,516,358,581.000594
30,003
pythondev
help
This is an example, I want to create a psuedo random order meaning it has to be random but after a D there muse be at least 2 N before the next D
2018-01-19T10:44:09.001605
Pennie
pythondev_help_Pennie_2018-01-19T10:44:09.001605
1,516,358,649.001605
30,004
pythondev
help
You guys think the any function fits this need?
2018-01-19T10:44:19.001927
Pennie
pythondev_help_Pennie_2018-01-19T10:44:19.001927
1,516,358,659.001927
30,005
pythondev
help
by default, I don’t think so
2018-01-19T10:45:59.000096
Floy
pythondev_help_Floy_2018-01-19T10:45:59.000096
1,516,358,759.000096
30,006
pythondev
help
hmm.. probably going to have to filter doing something like this: ``` df_D = df_original[(df_original['ColY']=='D')] ``` this will give you a new dataframe of all rows where D is true. You can then probably use iloc to get the position of the one 2N before those.
2018-01-19T11:33:00.001558
Davina
pythondev_help_Davina_2018-01-19T11:33:00.001558
1,516,361,580.001558
30,007
pythondev
help
something like that.
2018-01-19T11:33:19.000863
Davina
pythondev_help_Davina_2018-01-19T11:33:19.000863
1,516,361,599.000863
30,008
pythondev
help
<@Pennie> And please-please post a solution when you'll find one that suits your needs :blush:
2018-01-19T11:38:03.000966
Sadye
pythondev_help_Sadye_2018-01-19T11:38:03.000966
1,516,361,883.000966
30,009
pythondev
help
bitwise operations are supported so you could also do: ``` df_D = df_original[(df_original['ColY']=='D') &amp; (df_original['ColX'] == 'N')] ```
2018-01-19T11:40:59.000999
Davina
pythondev_help_Davina_2018-01-19T11:40:59.000999
1,516,362,059.000999
30,010
pythondev
help
this will return a dataframe where only those two things evaluate to true. Then with df_original you can use iloc. yep, i’m pretty sure that would work.
2018-01-19T11:42:25.000261
Davina
pythondev_help_Davina_2018-01-19T11:42:25.000261
1,516,362,145.000261
30,011
pythondev
help
I wish I had to work with pandas more. Now, I only need it occasionally for some half-assed aggregations
2018-01-19T11:44:29.000827
Sadye
pythondev_help_Sadye_2018-01-19T11:44:29.000827
1,516,362,269.000827
30,012
pythondev
help
It's such a cool instrument you want to find use cases for so you can just use it more :slightly_smiling_face:
2018-01-19T11:44:55.001217
Sadye
pythondev_help_Sadye_2018-01-19T11:44:55.001217
1,516,362,295.001217
30,013
pythondev
help
yea, i don’t use it nearly enough either. i work with ppl that use it every day so i see their code. lol
2018-01-19T11:44:58.000355
Davina
pythondev_help_Davina_2018-01-19T11:44:58.000355
1,516,362,298.000355
30,014
pythondev
help
In python what really is the difference between a set and a list?
2018-01-19T12:00:27.000622
Deja
pythondev_help_Deja_2018-01-19T12:00:27.000622
1,516,363,227.000622
30,015
pythondev
help
I was doing Problem 23 on Project_Euler and earlier my solution took 500+ sec to execute when i used a list but when i used a set it just took 1 sec
2018-01-19T12:00:42.001204
Deja
pythondev_help_Deja_2018-01-19T12:00:42.001204
1,516,363,242.001204
30,016
pythondev
help
sets are unordered and unique. lists have an order and can contain duplicates
2018-01-19T12:04:03.000774
Garrett
pythondev_help_Garrett_2018-01-19T12:04:03.000774
1,516,363,443.000774
30,017
pythondev
help
:point_up:
2018-01-19T12:04:28.001010
Davina
pythondev_help_Davina_2018-01-19T12:04:28.001010
1,516,363,468.00101
30,018
pythondev
help
because lists are ordered, operations in them require indexing and grinding through the index every time the list is accessed. I use the word "grinding" because if you hit the list often and with a significant amount of append/pop/transversal, it takes a long time. Sets, afaik, use a hashing which is much-faster. Ca...
2018-01-19T12:05:54.000443
Monroe
pythondev_help_Monroe_2018-01-19T12:05:54.000443
1,516,363,554.000443
30,019
pythondev
help
Yes, very similar to dictionaries using hash tables
2018-01-19T12:08:05.000206
Leanora
pythondev_help_Leanora_2018-01-19T12:08:05.000206
1,516,363,685.000206
30,020
pythondev
help
<https://hg.python.org/releasing/3.6/file/tip/Objects/setobject.c>
2018-01-19T12:08:06.001277
Leanora
pythondev_help_Leanora_2018-01-19T12:08:06.001277
1,516,363,686.001277
30,021
pythondev
help
So i cannot access each element with list[i] and that is why it is faster?
2018-01-19T12:09:01.001665
Deja
pythondev_help_Deja_2018-01-19T12:09:01.001665
1,516,363,741.001665
30,022
pythondev
help
depends on what your code is
2018-01-19T12:09:29.000655
Floy
pythondev_help_Floy_2018-01-19T12:09:29.000655
1,516,363,769.000655
30,023