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
not to sure about pep8 but this isnt readable.. as in it has got bigger problems than pep8..
2019-01-29T06:51:39.945300
Leida
pythondev_help_Leida_2019-01-29T06:51:39.945300
1,548,744,699.9453
4,921
pythondev
help
For your use case yes
2019-01-29T06:55:33.945700
Valeri
pythondev_help_Valeri_2019-01-29T06:55:33.945700
1,548,744,933.9457
4,922
pythondev
help
<https://www.python.org/dev/peps/pep-0008/#indentation>
2019-01-29T07:04:13.946000
Leida
pythondev_help_Leida_2019-01-29T07:04:13.946000
1,548,745,453.946
4,923
pythondev
help
```not_present_script = inter_freq_internal_freq['Script'].loc[ ~(inter_freq_internal_freq['eNodeBName'].isin(sites_file['*eNodeB Name']))]```
2019-01-29T07:05:03.946400
Leida
pythondev_help_Leida_2019-01-29T07:05:03.946400
1,548,745,503.9464
4,924
pythondev
help
i would break from there but the `~(inter_freq_internal_freq['eNodeBName'].isin(sites_file['*eNodeB Name']))` is way long and is pretty much a separate thing
2019-01-29T07:05:38.947100
Leida
pythondev_help_Leida_2019-01-29T07:05:38.947100
1,548,745,538.9471
4,925
pythondev
help
so i would assign that to a variable and then use that in the outer bit
2019-01-29T07:05:54.947700
Leida
pythondev_help_Leida_2019-01-29T07:05:54.947700
1,548,745,554.9477
4,926
pythondev
help
```dat_thing = ~(inter_freq_internal_freq['eNodeBName'].isin(sites_file['*eNodeB Name'])) not_present_script = inter_freq_internal_freq['Script'].loc[dat_thing]```
2019-01-29T07:06:49.948400
Leida
pythondev_help_Leida_2019-01-29T07:06:49.948400
1,548,745,609.9484
4,927
pythondev
help
and then break up that thing into something more understandable as well
2019-01-29T07:08:08.949400
Leida
pythondev_help_Leida_2019-01-29T07:08:08.949400
1,548,745,688.9494
4,928
pythondev
help
idk, maybe this makes perfect sense in pandas world xD
2019-01-29T07:08:24.949800
Leida
pythondev_help_Leida_2019-01-29T07:08:24.949800
1,548,745,704.9498
4,929
pythondev
help
my understanding is that a single line of code should do a single thing, this long line that you posted does like 3 nested lookups. I feel it would be simpler to follow if they were separate lines
2019-01-29T07:10:47.951200
Leida
pythondev_help_Leida_2019-01-29T07:10:47.951200
1,548,745,847.9512
4,930
pythondev
help
Hi guys, I need some regex magic to extract the fraction from a string of the form `'123abc456/789' -&gt; ('123abc', 456/789)`
2019-01-29T07:15:44.952400
Coleen
pythondev_help_Coleen_2019-01-29T07:15:44.952400
1,548,746,144.9524
4,931
pythondev
help
`re.findall(r'[a-z]+\d+\/\d+', data)` ?
2019-01-29T07:35:16.953600
Coleen
pythondev_help_Coleen_2019-01-29T07:35:16.953600
1,548,747,316.9536
4,932
pythondev
help
ah no that matches also the letter
2019-01-29T07:42:07.954100
Coleen
pythondev_help_Coleen_2019-01-29T07:42:07.954100
1,548,747,727.9541
4,933
pythondev
help
<https://regex101.com/> is really helpful for this kind of thing
2019-01-29T07:50:02.956600
Jonas
pythondev_help_Jonas_2019-01-29T07:50:02.956600
1,548,748,202.9566
4,934
pythondev
help
it's great to visualise the matches
2019-01-29T07:50:47.958200
Jonas
pythondev_help_Jonas_2019-01-29T07:50:47.958200
1,548,748,247.9582
4,935
pythondev
help
``` regex = re.compile(r'(?P&lt;state&gt;\d+[a-z]+)(?P&lt;frac&gt;\d+\/\d+)') m = regex.search(data) print(m.group('state'), m.group('frac')) ```
2019-01-29T07:55:33.958400
Coleen
pythondev_help_Coleen_2019-01-29T07:55:33.958400
1,548,748,533.9584
4,936
pythondev
help
I'm not sure how to explain this, but here's me trying; I have built an application that connects to Twitter's API and streams tweets which my application then analyses for sentiment. This is a continuous stream. Tweet volume, sentiment results and such are written to a db each minute. It works - until it doesn't. Wha...
2019-01-29T07:55:37.958500
Conchita
pythondev_help_Conchita_2019-01-29T07:55:37.958500
1,548,748,537.9585
4,937
pythondev
help
To the more experienced people on here, can you smell where the issue might be? This is a snippet of my try/except
2019-01-29T07:58:54.959300
Conchita
pythondev_help_Conchita_2019-01-29T07:58:54.959300
1,548,748,734.9593
4,938
pythondev
help
do you have any logging output ?
2019-01-29T07:59:48.959700
Jimmy
pythondev_help_Jimmy_2019-01-29T07:59:48.959700
1,548,748,788.9597
4,939
pythondev
help
Only whats inside the `try` block, when the initial connection to Twitter happens
2019-01-29T08:00:41.960900
Conchita
pythondev_help_Conchita_2019-01-29T08:00:41.960900
1,548,748,841.9609
4,940
pythondev
help
does it spam it?
2019-01-29T08:00:52.961100
Leida
pythondev_help_Leida_2019-01-29T08:00:52.961100
1,548,748,852.9611
4,941
pythondev
help
```2019-01-29 17:13:27,744:INFO:Stream connected 2019-01-29 18:48:21,621:INFO:Stream connected 2019-01-29 18:55:16,013:INFO:Stream connected ```
2019-01-29T08:01:07.961600
Conchita
pythondev_help_Conchita_2019-01-29T08:01:07.961600
1,548,748,867.9616
4,942
pythondev
help
It does not <@Leida>
2019-01-29T08:01:19.961900
Conchita
pythondev_help_Conchita_2019-01-29T08:01:19.961900
1,548,748,879.9619
4,943
pythondev
help
Should I add a `continue` in the end of my `except` blocks?
2019-01-29T08:01:39.962700
Conchita
pythondev_help_Conchita_2019-01-29T08:01:39.962700
1,548,748,899.9627
4,944
pythondev
help
you have some exception that falls through the current catching
2019-01-29T08:01:54.963200
Leida
pythondev_help_Leida_2019-01-29T08:01:54.963200
1,548,748,914.9632
4,945
pythondev
help
Or am I not catching the errors
2019-01-29T08:02:05.963600
Conchita
pythondev_help_Conchita_2019-01-29T08:02:05.963600
1,548,748,925.9636
4,946
pythondev
help
Yeah that could be
2019-01-29T08:02:13.963900
Conchita
pythondev_help_Conchita_2019-01-29T08:02:13.963900
1,548,748,933.9639
4,947
pythondev
help
How can I catch all, for the purpose of finding it?
2019-01-29T08:02:26.964300
Conchita
pythondev_help_Conchita_2019-01-29T08:02:26.964300
1,548,748,946.9643
4,948
pythondev
help
Would this work?
2019-01-29T08:05:01.966500
Conchita
pythondev_help_Conchita_2019-01-29T08:05:01.966500
1,548,749,101.9665
4,949
pythondev
help
that would do it
2019-01-29T08:05:15.966900
Leida
pythondev_help_Leida_2019-01-29T08:05:15.966900
1,548,749,115.9669
4,950
pythondev
help
only your while loop keeps on going
2019-01-29T08:05:23.967200
Leida
pythondev_help_Leida_2019-01-29T08:05:23.967200
1,548,749,123.9672
4,951
pythondev
help
stream.disconnect() disconnects but does stream.filter() connect?
2019-01-29T08:07:21.968100
Leida
pythondev_help_Leida_2019-01-29T08:07:21.968100
1,548,749,241.9681
4,952
pythondev
help
I'm pretty sure it does, but can't be 100% due to lack of proper logging in the past
2019-01-29T08:08:53.968900
Conchita
pythondev_help_Conchita_2019-01-29T08:08:53.968900
1,548,749,333.9689
4,953
pythondev
help
what triggers your db write tho?
2019-01-29T08:10:06.969700
Leida
pythondev_help_Leida_2019-01-29T08:10:06.969700
1,548,749,406.9697
4,954
pythondev
help
an uncaught exception would break the while loop and that bit of code stops, if you have some external db write that does the write without regard to whether it has data or not could explain the 0's
2019-01-29T08:11:22.971700
Leida
pythondev_help_Leida_2019-01-29T08:11:22.971700
1,548,749,482.9717
4,955
pythondev
help
I know this is not best practice but the logic is as follow; I use global variables. 1) These are updated as data is processed 2) Then a while loop read those globals and writes to the db 3) globals are reset 4) while loop sleeps for x seconds 5) repeat
2019-01-29T08:13:32.973500
Conchita
pythondev_help_Conchita_2019-01-29T08:13:32.973500
1,548,749,612.9735
4,956
pythondev
help
None
2019-01-29T08:15:16.974000
Conchita
pythondev_help_Conchita_2019-01-29T08:15:16.974000
1,548,749,716.974
4,957
pythondev
help
and you have some threading so that you can have two blocking while loops going?
2019-01-29T08:17:11.975600
Leida
pythondev_help_Leida_2019-01-29T08:17:11.975600
1,548,749,831.9756
4,958
pythondev
help
Well, no
2019-01-29T08:17:59.976500
Conchita
pythondev_help_Conchita_2019-01-29T08:17:59.976500
1,548,749,879.9765
4,959
pythondev
help
I sort of started writing this app two weeks after I starting my programming journey
2019-01-29T08:19:23.978400
Conchita
pythondev_help_Conchita_2019-01-29T08:19:23.978400
1,548,749,963.9784
4,960
pythondev
help
anyway the main point is that an uncaught exception jumps out of your reading while loop and no new data goes into your globals
2019-01-29T08:19:44.979000
Leida
pythondev_help_Leida_2019-01-29T08:19:44.979000
1,548,749,984.979
4,961
pythondev
help
Full of bad practice and not knowing exactly what I'm doing
2019-01-29T08:19:52.979300
Conchita
pythondev_help_Conchita_2019-01-29T08:19:52.979300
1,548,749,992.9793
4,962
pythondev
help
Exactly
2019-01-29T08:19:59.979700
Conchita
pythondev_help_Conchita_2019-01-29T08:19:59.979700
1,548,749,999.9797
4,963
pythondev
help
catch the exception that does this and fix the problem
2019-01-29T08:21:05.980600
Leida
pythondev_help_Leida_2019-01-29T08:21:05.980600
1,548,750,065.9806
4,964
pythondev
help
On it
2019-01-29T08:21:26.981300
Conchita
pythondev_help_Conchita_2019-01-29T08:21:26.981300
1,548,750,086.9813
4,965
pythondev
help
try not to keep a catch-all in your code, would add to the list of bad ideas ^^
2019-01-29T08:21:41.981900
Leida
pythondev_help_Leida_2019-01-29T08:21:41.981900
1,548,750,101.9819
4,966
pythondev
help
Absolutely, only using it now for testing so I can find the ninja exception so I can add it to the small list of specific exceptions
2019-01-29T08:22:44.983200
Conchita
pythondev_help_Conchita_2019-01-29T08:22:44.983200
1,548,750,164.9832
4,967
pythondev
help
Could you shed some light on threading and why not having it is a bad idea when using two while loops?
2019-01-29T08:23:01.983600
Conchita
pythondev_help_Conchita_2019-01-29T08:23:01.983600
1,548,750,181.9836
4,968
pythondev
help
threading is not a good idea for you right now, so not having it is good :smile:
2019-01-29T08:23:34.984300
Leida
pythondev_help_Leida_2019-01-29T08:23:34.984300
1,548,750,214.9843
4,969
pythondev
help
i just cant tell how you can have two blocking while loops going, unless they are nested ^^
2019-01-29T08:24:13.985100
Leida
pythondev_help_Leida_2019-01-29T08:24:13.985100
1,548,750,253.9851
4,970
pythondev
help
One while loop is inside a function. The second is not. If that answers your Q
2019-01-29T08:26:13.986500
Conchita
pythondev_help_Conchita_2019-01-29T08:26:13.986500
1,548,750,373.9865
4,971
pythondev
help
None
2019-01-29T08:27:34.986600
Conchita
pythondev_help_Conchita_2019-01-29T08:27:34.986600
1,548,750,454.9866
4,972
pythondev
help
now im confused how it enters any data besides the first time atall :smile:
2019-01-29T08:29:21.987600
Leida
pythondev_help_Leida_2019-01-29T08:29:21.987600
1,548,750,561.9876
4,973
pythondev
help
`There's a way to force conda to download packages only from pypi?` this was the question maybe you missed it out
2019-01-29T08:29:29.987800
Alicia
pythondev_help_Alicia_2019-01-29T08:29:29.987800
1,548,750,569.9878
4,974
pythondev
help
you run the script, definitions are loaded and then the code hits if __name__ line which calls main()
2019-01-29T08:29:57.988600
Leida
pythondev_help_Leida_2019-01-29T08:29:57.988600
1,548,750,597.9886
4,975
pythondev
help
the main contains an endless loop that wont stop unless some error that you are not catching break it
2019-01-29T08:30:23.989200
Leida
pythondev_help_Leida_2019-01-29T08:30:23.989200
1,548,750,623.9892
4,976
pythondev
help
and only then should the writing to database loop start
2019-01-29T08:30:38.989600
Leida
pythondev_help_Leida_2019-01-29T08:30:38.989600
1,548,750,638.9896
4,977
pythondev
help
in the while run: bit do you call main() again somewhere?
2019-01-29T08:31:46.990900
Leida
pythondev_help_Leida_2019-01-29T08:31:46.990900
1,548,750,706.9909
4,978
pythondev
help
No
2019-01-29T08:32:11.991100
Conchita
pythondev_help_Conchita_2019-01-29T08:32:11.991100
1,548,750,731.9911
4,979
pythondev
help
That while loop that starts off at line 32 runs every 60 second
2019-01-29T08:33:00.991400
Conchita
pythondev_help_Conchita_2019-01-29T08:33:00.991400
1,548,750,780.9914
4,980
pythondev
help
Since the variable `run` is always True, and to the best of my knowledge can't turn False: the while loop will never stop. And in the first line of the while loop it has a sleep statement
2019-01-29T08:34:45.992700
Conchita
pythondev_help_Conchita_2019-01-29T08:34:45.992700
1,548,750,885.9927
4,981
pythondev
help
That sleep statement has a variable which is set to 60 seconds
2019-01-29T08:35:10.993100
Conchita
pythondev_help_Conchita_2019-01-29T08:35:10.993100
1,548,750,910.9931
4,982
pythondev
help
Does that make sense or am I missing some core concepts here?
2019-01-29T08:36:25.994000
Conchita
pythondev_help_Conchita_2019-01-29T08:36:25.994000
1,548,750,985.994
4,983
pythondev
help
the sleep() blocks the thread, this should not enable the other loop to run any further
2019-01-29T08:36:27.994100
Leida
pythondev_help_Leida_2019-01-29T08:36:27.994100
1,548,750,987.9941
4,984
pythondev
help
interesting. Well it does run for quite some time. Sometimes days, sometimes hours
2019-01-29T08:37:06.994900
Conchita
pythondev_help_Conchita_2019-01-29T08:37:06.994900
1,548,751,026.9949
4,985
pythondev
help
hmmm
2019-01-29T08:37:56.995900
Conchita
pythondev_help_Conchita_2019-01-29T08:37:56.995900
1,548,751,076.9959
4,986
pythondev
help
my initial guess was that your second loop calls main again and that an error that causes it to stop would enable a write to the database, but i dont see that anywhere
2019-01-29T08:37:58.996000
Leida
pythondev_help_Leida_2019-01-29T08:37:58.996000
1,548,751,078.996
4,987
pythondev
help
do you call the script itself in a loop somewhere?
2019-01-29T08:38:07.996300
Leida
pythondev_help_Leida_2019-01-29T08:38:07.996300
1,548,751,087.9963
4,988
pythondev
help
I do not
2019-01-29T08:39:00.996600
Conchita
pythondev_help_Conchita_2019-01-29T08:39:00.996600
1,548,751,140.9966
4,989
pythondev
help
The last loop in this script is a for loop which is inside of a class I have, but that deals with sentiment analysis (textblob) and does not call this script
2019-01-29T08:39:59.997500
Conchita
pythondev_help_Conchita_2019-01-29T08:39:59.997500
1,548,751,199.9975
4,990
pythondev
help
Yeah I got that
2019-01-29T08:41:17.997700
Valeri
pythondev_help_Valeri_2019-01-29T08:41:17.997700
1,548,751,277.9977
4,991
pythondev
help
I was wondering what lead you into doing this
2019-01-29T08:41:27.997900
Valeri
pythondev_help_Valeri_2019-01-29T08:41:27.997900
1,548,751,287.9979
4,992
pythondev
help
Maybe if you shared that we could have a better simpler solution?
2019-01-29T08:41:54.998400
Valeri
pythondev_help_Valeri_2019-01-29T08:41:54.998400
1,548,751,314.9984
4,993
pythondev
help
did the last paste of code contain code from multiple sources?
2019-01-29T08:41:56.998600
Leida
pythondev_help_Leida_2019-01-29T08:41:56.998600
1,548,751,316.9986
4,994
pythondev
help
No
2019-01-29T08:43:35.998800
Conchita
pythondev_help_Conchita_2019-01-29T08:43:35.998800
1,548,751,415.9988
4,995
pythondev
help
All the snippets have been from the same script
2019-01-29T08:43:46.999100
Conchita
pythondev_help_Conchita_2019-01-29T08:43:46.999100
1,548,751,426.9991
4,996
pythondev
help
there is some magic going on that i dont see from the pastes but basically in the `start_stream()` there is an uncaught exception so that the while loop breaks and the global state does not get updated. Since there is a break statement in the successful running of `stream.filter()` means that something needs to call th...
2019-01-29T08:48:49.001200
Leida
pythondev_help_Leida_2019-01-29T08:48:49.001200
1,548,751,729.0012
4,997
pythondev
help
what ever the exception is calling `stream.filter()` does not fix it
2019-01-29T08:49:06.001700
Leida
pythondev_help_Leida_2019-01-29T08:49:06.001700
1,548,751,746.0017
4,998
pythondev
help
so i would assume the problem is with the authentication becoming invalid
2019-01-29T08:49:23.002100
Leida
pythondev_help_Leida_2019-01-29T08:49:23.002100
1,548,751,763.0021
4,999
pythondev
help
<@Conchita> Why don't you allow your code to break and then figure out what went wrong?
2019-01-29T08:53:23.004700
Valeri
pythondev_help_Valeri_2019-01-29T08:53:23.004700
1,548,752,003.0047
5,000
pythondev
help
Basically get rid of all the exceptions and see why your code broke
2019-01-29T08:54:09.005500
Valeri
pythondev_help_Valeri_2019-01-29T08:54:09.005500
1,548,752,049.0055
5,001
pythondev
help
Also, relying on a exceptions to perform tasks is a bad idea imo
2019-01-29T08:54:41.006500
Valeri
pythondev_help_Valeri_2019-01-29T08:54:41.006500
1,548,752,081.0065
5,002
pythondev
help
You're probably just being rate limited maybe?
2019-01-29T08:55:17.007500
Valeri
pythondev_help_Valeri_2019-01-29T08:55:17.007500
1,548,752,117.0075
5,003
pythondev
help
there is mention of async in the code so that some part may well die while the rest keeps on running
2019-01-29T08:55:28.007600
Leida
pythondev_help_Leida_2019-01-29T08:55:28.007600
1,548,752,128.0076
5,004
pythondev
help
Yeah
2019-01-29T08:56:27.008100
Valeri
pythondev_help_Valeri_2019-01-29T08:56:27.008100
1,548,752,187.0081
5,005
pythondev
help
Also, why don't you verify your data before writing to the database?
2019-01-29T08:57:11.009200
Valeri
pythondev_help_Valeri_2019-01-29T08:57:11.009200
1,548,752,231.0092
5,006
pythondev
help
As in they're non-zero entries
2019-01-29T08:57:33.009900
Valeri
pythondev_help_Valeri_2019-01-29T08:57:33.009900
1,548,752,253.0099
5,007
pythondev
help
<http://docs.tweepy.org/en/v3.4.0/streaming_how_to.html#a-few-more-pointers>
2019-01-29T08:57:47.010100
Hiroko
pythondev_help_Hiroko_2019-01-29T08:57:47.010100
1,548,752,267.0101
5,008
pythondev
help
suggests you’re using the wrong kwarg for streaming
2019-01-29T08:57:59.010500
Hiroko
pythondev_help_Hiroko_2019-01-29T08:57:59.010500
1,548,752,279.0105
5,009
pythondev
help
you have `is_async`, the filter takes in an `async` kwarg
2019-01-29T08:58:16.011000
Hiroko
pythondev_help_Hiroko_2019-01-29T08:58:16.011000
1,548,752,296.011
5,010
pythondev
help
the documentation may be wrong tho, github on master has `is_async`
2019-01-29T09:04:40.011500
Leida
pythondev_help_Leida_2019-01-29T09:04:40.011500
1,548,752,680.0115
5,011
pythondev
help
or the package is installed straight from git
2019-01-29T09:07:26.012000
Leida
pythondev_help_Leida_2019-01-29T09:07:26.012000
1,548,752,846.012
5,012
pythondev
help
:facepalm:
2019-01-29T09:08:09.012200
Hiroko
pythondev_help_Hiroko_2019-01-29T09:08:09.012200
1,548,752,889.0122
5,013
pythondev
help
hey someone else might have mentioned this (I'm just scrolling through) but there is `logging.exception` which will automatically print the stack trace for you. So you can do something like: ``` except Exception: logging.exception('An Error Occurred') ```
2019-01-29T09:08:16.012300
Karoline
pythondev_help_Karoline_2019-01-29T09:08:16.012300
1,548,752,896.0123
5,014
pythondev
help
or just wrong version :smile:
2019-01-29T09:08:49.012600
Leida
pythondev_help_Leida_2019-01-29T09:08:49.012600
1,548,752,929.0126
5,015
pythondev
help
¯\_(ツ)_/¯
2019-01-29T09:08:52.012900
Valeri
pythondev_help_Valeri_2019-01-29T09:08:52.012900
1,548,752,932.0129
5,016
pythondev
help
3.4 does indeed have `async` 3.6 has `is_async`
2019-01-29T09:09:07.013200
Leida
pythondev_help_Leida_2019-01-29T09:09:07.013200
1,548,752,947.0132
5,017
pythondev
help
cool thanks!
2019-01-29T09:12:21.013300
Arturo
pythondev_help_Arturo_2019-01-29T09:12:21.013300
1,548,753,141.0133
5,018
pythondev
help
ok so actually there is no exception to catch in `start_stream()` since it probably succeeds first time it is run and since `is_async` is `True` the `stream.filter()` is run on a separate thread
2019-01-29T09:17:28.015100
Leida
pythondev_help_Leida_2019-01-29T09:17:28.015100
1,548,753,448.0151
5,019
pythondev
help
the library handles passing of data between threads internally
2019-01-29T09:19:08.016600
Leida
pythondev_help_Leida_2019-01-29T09:19:08.016600
1,548,753,548.0166
5,020