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
If what you are asking for is an automated migration, well, that is unlikely
2019-02-12T12:08:40.245800
Clemmie
pythondev_help_Clemmie_2019-02-12T12:08:40.245800
1,549,973,320.2458
7,921
pythondev
help
Also chances are R is doing numerical/statistical work. R is better suited syntactically for that than php\
2019-02-12T12:09:35.246600
Clemmie
pythondev_help_Clemmie_2019-02-12T12:09:35.246600
1,549,973,375.2466
7,922
pythondev
help
okay. so we are saying that R is more suitable than python.. are we?
2019-02-12T12:10:42.247300
Chet
pythondev_help_Chet_2019-02-12T12:10:42.247300
1,549,973,442.2473
7,923
pythondev
help
Not necessarily. Python is also excellent for numerical work
2019-02-12T12:11:05.247700
Clemmie
pythondev_help_Clemmie_2019-02-12T12:11:05.247700
1,549,973,465.2477
7,924
pythondev
help
you asked about php
2019-02-12T12:11:18.248000
Clemmie
pythondev_help_Clemmie_2019-02-12T12:11:18.248000
1,549,973,478.248
7,925
pythondev
help
then what is R better suited for? php I am using in backend
2019-02-12T12:11:44.248600
Chet
pythondev_help_Chet_2019-02-12T12:11:44.248600
1,549,973,504.2486
7,926
pythondev
help
R is well suited for numerical/statistical work. So is Python. So is Matlab and others
2019-02-12T12:12:14.249200
Clemmie
pythondev_help_Clemmie_2019-02-12T12:12:14.249200
1,549,973,534.2492
7,927
pythondev
help
Different strokes for different folks
2019-02-12T12:12:27.249600
Clemmie
pythondev_help_Clemmie_2019-02-12T12:12:27.249600
1,549,973,547.2496
7,928
pythondev
help
okay understood. But I have experienced that python processes faster than R. So if I want to make use of python instead of R, then from where do I start, can you help me with some resources?
2019-02-12T12:14:56.251700
Chet
pythondev_help_Chet_2019-02-12T12:14:56.251700
1,549,973,696.2517
7,929
pythondev
help
that's a very broad request...
2019-02-12T12:15:19.252000
Carlo
pythondev_help_Carlo_2019-02-12T12:15:19.252000
1,549,973,719.252
7,930
pythondev
help
Whats the best way to remove HTML markup from a string in python? For example, I have “’Freshpet® Select Slice” but it should be “Freshpet Select Slice”. However, a simple .replace() doesn’t work because there are different character numbers
2019-02-12T12:16:36.253800
Sherman
pythondev_help_Sherman_2019-02-12T12:16:36.253800
1,549,973,796.2538
7,931
pythondev
help
<@Sherman> those are HTML entities, this one's ®
2019-02-12T12:18:41.254400
Carlo
pythondev_help_Carlo_2019-02-12T12:18:41.254400
1,549,973,921.2544
7,932
pythondev
help
Is there a good way to strip all of those from a string and replace it with a blank?
2019-02-12T12:18:56.254800
Sherman
pythondev_help_Sherman_2019-02-12T12:18:56.254800
1,549,973,936.2548
7,933
pythondev
help
use regex?
2019-02-12T12:19:56.255600
Deon
pythondev_help_Deon_2019-02-12T12:19:56.255600
1,549,973,996.2556
7,934
pythondev
help
oh okay
2019-02-12T12:20:11.256100
Chet
pythondev_help_Chet_2019-02-12T12:20:11.256100
1,549,974,011.2561
7,935
pythondev
help
well you could always do some simple regex matching but you risk eliminating non-entities lol
2019-02-12T12:20:12.256200
Carlo
pythondev_help_Carlo_2019-02-12T12:20:12.256200
1,549,974,012.2562
7,936
pythondev
help
Ya thats the concern
2019-02-12T12:20:19.256600
Sherman
pythondev_help_Sherman_2019-02-12T12:20:19.256600
1,549,974,019.2566
7,937
pythondev
help
maybe remove everything that starts with '&amp;' up to \s
2019-02-12T12:20:50.257700
Deon
pythondev_help_Deon_2019-02-12T12:20:50.257700
1,549,974,050.2577
7,938
pythondev
help
or whitespace
2019-02-12T12:20:56.258100
Deon
pythondev_help_Deon_2019-02-12T12:20:56.258100
1,549,974,056.2581
7,939
pythondev
help
Is there a big list of all of them?
2019-02-12T12:20:57.258400
Sherman
pythondev_help_Sherman_2019-02-12T12:20:57.258400
1,549,974,057.2584
7,940
pythondev
help
And I could just filter them all out
2019-02-12T12:21:01.258600
Sherman
pythondev_help_Sherman_2019-02-12T12:21:01.258600
1,549,974,061.2586
7,941
pythondev
help
<https://www.freeformatter.com/html-entities.html>
2019-02-12T12:21:21.259400
Carlo
pythondev_help_Carlo_2019-02-12T12:21:21.259400
1,549,974,081.2594
7,942
pythondev
help
good luck :wink:
2019-02-12T12:21:25.259700
Carlo
pythondev_help_Carlo_2019-02-12T12:21:25.259700
1,549,974,085.2597
7,943
pythondev
help
blech
2019-02-12T12:21:34.260300
Sherman
pythondev_help_Sherman_2019-02-12T12:21:34.260300
1,549,974,094.2603
7,944
pythondev
help
```soup = BeautifulSoup(html, convertEntities=BeautifulSoup.HTML_ENTITIES)```
2019-02-12T12:21:38.260800
Sherman
pythondev_help_Sherman_2019-02-12T12:21:38.260800
1,549,974,098.2608
7,945
pythondev
help
you could use a regex. I think `clean_text = re.sub(r'&amp;#\d+;', ' ', input_string)`
2019-02-12T12:21:39.261100
Clemmie
pythondev_help_Clemmie_2019-02-12T12:21:39.261100
1,549,974,099.2611
7,946
pythondev
help
Someone suggested that
2019-02-12T12:21:41.261200
Sherman
pythondev_help_Sherman_2019-02-12T12:21:41.261200
1,549,974,101.2612
7,947
pythondev
help
<@Sherman> maybe try the solution posted here <https://stackoverflow.com/questions/753052/strip-html-from-strings-in-python/19730306> it seems to strip tags and entities but you can modify it
2019-02-12T12:21:48.261800
Genaro
pythondev_help_Genaro_2019-02-12T12:21:48.261800
1,549,974,108.2618
7,948
pythondev
help
yeah beautifulsoup has stuff to deal with this
2019-02-12T12:21:49.261900
Carlo
pythondev_help_Carlo_2019-02-12T12:21:49.261900
1,549,974,109.2619
7,949
pythondev
help
<@Clemmie> that regex only catches entities passed by entity number
2019-02-12T12:22:26.262600
Carlo
pythondev_help_Carlo_2019-02-12T12:22:26.262600
1,549,974,146.2626
7,950
pythondev
help
there are things like &amp;amp; too
2019-02-12T12:22:39.263000
Carlo
pythondev_help_Carlo_2019-02-12T12:22:39.263000
1,549,974,159.263
7,951
pythondev
help
I was assuming the all were based on the original question
2019-02-12T12:22:45.263200
Clemmie
pythondev_help_Clemmie_2019-02-12T12:22:45.263200
1,549,974,165.2632
7,952
pythondev
help
fair enough
2019-02-12T12:22:51.263400
Carlo
pythondev_help_Carlo_2019-02-12T12:22:51.263400
1,549,974,171.2634
7,953
pythondev
help
Said all the instances has different numbers
2019-02-12T12:23:04.264100
Clemmie
pythondev_help_Clemmie_2019-02-12T12:23:04.264100
1,549,974,184.2641
7,954
pythondev
help
Kk lemme try to beautifulSoup and <@Genaro> method, I’ll get back shortly
2019-02-12T12:23:10.264300
Sherman
pythondev_help_Sherman_2019-02-12T12:23:10.264300
1,549,974,190.2643
7,955
pythondev
help
Ugh, this is close, but this decodes it, is there any way to replace it with a blank? ```import html def remove_html_entities(string): cleaned = html.unescape(string) return cleaned```
2019-02-12T12:36:06.264800
Sherman
pythondev_help_Sherman_2019-02-12T12:36:06.264800
1,549,974,966.2648
7,956
pythondev
help
I guess I can build my own function and just have the list lol
2019-02-12T12:38:56.265100
Sherman
pythondev_help_Sherman_2019-02-12T12:38:56.265100
1,549,975,136.2651
7,957
pythondev
help
If all of your entity references are using the numerical form, the regex I posted above should work as a oneliner
2019-02-12T12:41:18.265900
Clemmie
pythondev_help_Clemmie_2019-02-12T12:41:18.265900
1,549,975,278.2659
7,958
pythondev
help
`clean_text = re.sub(r'&amp;#\d+;', ' ', input_string)` or something very close to it
2019-02-12T12:41:54.266600
Clemmie
pythondev_help_Clemmie_2019-02-12T12:41:54.266600
1,549,975,314.2666
7,959
pythondev
help
The issue is (super edge case) for “Store SKU Number &amp;#123456; Next store SKU Number &amp;#67890;”
2019-02-12T12:42:25.267200
Sherman
pythondev_help_Sherman_2019-02-12T12:42:25.267200
1,549,975,345.2672
7,960
pythondev
help
Super unlikely, but could happen
2019-02-12T12:42:43.267500
Sherman
pythondev_help_Sherman_2019-02-12T12:42:43.267500
1,549,975,363.2675
7,961
pythondev
help
Oh, yup, that will get in the way
2019-02-12T12:43:11.267800
Clemmie
pythondev_help_Clemmie_2019-02-12T12:43:11.267800
1,549,975,391.2678
7,962
pythondev
help
The function was super easy, only 300 characters
2019-02-12T12:43:23.268300
Sherman
pythondev_help_Sherman_2019-02-12T12:43:23.268300
1,549,975,403.2683
7,963
pythondev
help
so now I just replace anything in the function with a blank
2019-02-12T12:43:29.268600
Sherman
pythondev_help_Sherman_2019-02-12T12:43:29.268600
1,549,975,409.2686
7,964
pythondev
help
Great, good solve!
2019-02-12T12:43:42.268800
Clemmie
pythondev_help_Clemmie_2019-02-12T12:43:42.268800
1,549,975,422.2688
7,965
pythondev
help
Thanks for the help though
2019-02-12T12:44:04.269200
Sherman
pythondev_help_Sherman_2019-02-12T12:44:04.269200
1,549,975,444.2692
7,966
pythondev
help
Hello all, I’m practicing my list comprehensions and there’s a bit of theory I just don’t understand. If i run the following ```for found in root.iterfind('xml_file_thing'): for i, value in found.items(): print(value)``` I get a list of values ranging from ```0101 ... 0812``` which is the expected result. I...
2019-02-12T13:09:15.269500
Elvia
pythondev_help_Elvia_2019-02-12T13:09:15.269500
1,549,976,955.2695
7,967
pythondev
help
remove 'value for' .. what's the output of that?
2019-02-12T13:49:21.271400
Deon
pythondev_help_Deon_2019-02-12T13:49:21.271400
1,549,979,361.2714
7,968
pythondev
help
sorry remove 'value for i, vlaue in'
2019-02-12T13:49:46.271700
Deon
pythondev_help_Deon_2019-02-12T13:49:46.271700
1,549,979,386.2717
7,969
pythondev
help
hello, qq. I have an array of monthly values that I would like to aggregate to yearly values. for example an array of 36 months entries of 100 is turned to 3 year entries of [1200,1200,1200]
2019-02-12T13:54:33.274100
Deangelo
pythondev_help_Deangelo_2019-02-12T13:54:33.274100
1,549,979,673.2741
7,970
pythondev
help
how do I go about doing this and is pandas the way to do it?
2019-02-12T13:55:04.274600
Deangelo
pythondev_help_Deangelo_2019-02-12T13:55:04.274600
1,549,979,704.2746
7,971
pythondev
help
<@Britt>
2019-02-12T13:58:33.274900
Clemmie
pythondev_help_Clemmie_2019-02-12T13:58:33.274900
1,549,979,913.2749
7,972
pythondev
help
That takes advantage of slicing (splitting a list into smaller list by index)
2019-02-12T13:59:39.275700
Clemmie
pythondev_help_Clemmie_2019-02-12T13:59:39.275700
1,549,979,979.2757
7,973
pythondev
help
oh great
2019-02-12T14:00:43.275900
Deangelo
pythondev_help_Deangelo_2019-02-12T14:00:43.275900
1,549,980,043.2759
7,974
pythondev
help
I was just reading about the concept of Split, apply(sum) in Pandas. Do you think that's overkill for this task?
2019-02-12T14:01:31.276800
Deangelo
pythondev_help_Deangelo_2019-02-12T14:01:31.276800
1,549,980,091.2768
7,975
pythondev
help
yes, unless you have a huge number of months. Especially if you don’t need Pandas for anything else, installing and importing it just for this taks is huge overkill
2019-02-12T14:02:19.277800
Clemmie
pythondev_help_Clemmie_2019-02-12T14:02:19.277800
1,549,980,139.2778
7,976
pythondev
help
And for huge number of months, I mean all the months in recorded human history kind of numbers
2019-02-12T14:02:45.278300
Clemmie
pythondev_help_Clemmie_2019-02-12T14:02:45.278300
1,549,980,165.2783
7,977
pythondev
help
lol, not that much
2019-02-12T14:03:09.278600
Deangelo
pythondev_help_Deangelo_2019-02-12T14:03:09.278600
1,549,980,189.2786
7,978
pythondev
help
but this is eventually for a reporting service that will process data for up to 30 years in months, with lots of month to year conversions and the other way around
2019-02-12T14:04:33.280100
Deangelo
pythondev_help_Deangelo_2019-02-12T14:04:33.280100
1,549,980,273.2801
7,979
pythondev
help
Thats only a list of 360 elements. Should run basically instantaneously. The data processing time will likely dwarf the munging year &lt;-&gt; month
2019-02-12T14:06:15.282000
Clemmie
pythondev_help_Clemmie_2019-02-12T14:06:15.282000
1,549,980,375.282
7,980
pythondev
help
right, makes sense
2019-02-12T14:06:39.282300
Deangelo
pythondev_help_Deangelo_2019-02-12T14:06:39.282300
1,549,980,399.2823
7,981
pythondev
help
in your loop, what happens if you only get an array of 12 months. Doesn't it skip one year?
2019-02-12T14:06:42.282500
Deangelo
pythondev_help_Deangelo_2019-02-12T14:06:42.282500
1,549,980,402.2825
7,982
pythondev
help
and I think you meant `len(monthly) &gt; 12` instead of `len(monthly &gt; 12)`
2019-02-12T14:07:24.283200
Deangelo
pythondev_help_Deangelo_2019-02-12T14:07:24.283200
1,549,980,444.2832
7,983
pythondev
help
Yup. nut the last year is handled by the line after the loop. Strictly speaking you could do it without the length check like this (I did it the way I did because I forgot if slicing would throw an index erorr. It doesn’t so this is better) ``` monthly = &lt;yourlist&gt; yearly = [] while len(monthly) &gt; 0: year, mo...
2019-02-12T14:09:21.284500
Clemmie
pythondev_help_Clemmie_2019-02-12T14:09:21.284500
1,549,980,561.2845
7,984
pythondev
help
very neat, just updated `yearly.append(year)`
2019-02-12T14:14:34.285300
Deangelo
pythondev_help_Deangelo_2019-02-12T14:14:34.285300
1,549,980,874.2853
7,985
pythondev
help
right, yeah
2019-02-12T14:17:19.286000
Clemmie
pythondev_help_Clemmie_2019-02-12T14:17:19.286000
1,549,981,039.286
7,986
pythondev
help
snippet feature doesn’t have checking :blush:
2019-02-12T14:17:40.286500
Clemmie
pythondev_help_Clemmie_2019-02-12T14:17:40.286500
1,549,981,060.2865
7,987
pythondev
help
checking like input validation?
2019-02-12T14:19:14.286800
Deangelo
pythondev_help_Deangelo_2019-02-12T14:19:14.286800
1,549,981,154.2868
7,988
pythondev
help
syntax, I think
2019-02-12T14:19:29.287100
Hiroko
pythondev_help_Hiroko_2019-02-12T14:19:29.287100
1,549,981,169.2871
7,989
pythondev
help
oh I see. fortunately the ide helps
2019-02-12T14:19:46.287700
Deangelo
pythondev_help_Deangelo_2019-02-12T14:19:46.287700
1,549,981,186.2877
7,990
pythondev
help
it’ll do highlighting but not actual checking
2019-02-12T14:19:58.288100
Hiroko
pythondev_help_Hiroko_2019-02-12T14:19:58.288100
1,549,981,198.2881
7,991
pythondev
help
Yup
2019-02-12T14:21:07.289400
Clemmie
pythondev_help_Clemmie_2019-02-12T14:21:07.289400
1,549,981,267.2894
7,992
pythondev
help
I have a similar need for scaling back a yearly array to monthly, so year array [y1, y2] breaks down to monthly array of 24 elements, but instead of each monthly value = yearly / 12, I need to use an allocation array that defines the percentage of allocation for each month of the year. a simple example would be given ...
2019-02-12T14:25:56.293600
Deangelo
pythondev_help_Deangelo_2019-02-12T14:25:56.293600
1,549,981,556.2936
7,993
pythondev
help
``` alloc = [0.5, 0.5, 0,0,0,0,0,0,0,0,0,0] v = 1200 monthly = [alloc[i] * v for i in range(12)] ```
2019-02-12T14:29:30.295200
Yaeko
pythondev_help_Yaeko_2019-02-12T14:29:30.295200
1,549,981,770.2952
7,994
pythondev
help
?
2019-02-12T14:29:33.295400
Yaeko
pythondev_help_Yaeko_2019-02-12T14:29:33.295400
1,549,981,773.2954
7,995
pythondev
help
None
2019-02-12T14:29:51.295500
Sasha
pythondev_help_Sasha_2019-02-12T14:29:51.295500
1,549,981,791.2955
7,996
pythondev
help
More generic, better solution.
2019-02-12T14:30:24.296000
Yaeko
pythondev_help_Yaeko_2019-02-12T14:30:24.296000
1,549,981,824.296
7,997
pythondev
help
nice, let me check it
2019-02-12T14:36:04.296400
Deangelo
pythondev_help_Deangelo_2019-02-12T14:36:04.296400
1,549,982,164.2964
7,998
pythondev
help
works perfectly
2019-02-12T14:38:23.296900
Deangelo
pythondev_help_Deangelo_2019-02-12T14:38:23.296900
1,549,982,303.2969
7,999
pythondev
help
now instead of allocation[i % 12],
2019-02-12T14:38:40.297300
Deangelo
pythondev_help_Deangelo_2019-02-12T14:38:40.297300
1,549,982,320.2973
8,000
pythondev
help
I think it would be best to have it as a separate function because,
2019-02-12T14:39:04.297800
Deangelo
pythondev_help_Deangelo_2019-02-12T14:39:04.297800
1,549,982,344.2978
8,001
pythondev
help
as `get_allocation(allocation, index)`
2019-02-12T14:39:22.298200
Deangelo
pythondev_help_Deangelo_2019-02-12T14:39:22.298200
1,549,982,362.2982
8,002
pythondev
help
because the allocation array can be defined for up to five years with the last year (12 values) applying to subsequent years. so if I have an allocation array of 24 values, the last 12 values apply to year 2, year 3...etc
2019-02-12T14:40:42.299800
Deangelo
pythondev_help_Deangelo_2019-02-12T14:40:42.299800
1,549,982,442.2998
8,003
pythondev
help
I got it
2019-02-12T14:55:53.300200
Deangelo
pythondev_help_Deangelo_2019-02-12T14:55:53.300200
1,549,983,353.3002
8,004
pythondev
help
``` allocation = [ 50,50,0,0,0,0,0,0,0,0,0,0, 25,25,25,25,0,0,0,0,0,0,0,0, ] yearly = [1200, 1200,1200] monthly = [] def get_allocation(allocation, index): last_allocation = allocation[-12:] return allocation[index] if index &lt; len(allocation) else last_allocation[index % 12] for i in range(len(yearly) * 12...
2019-02-12T14:56:00.300400
Deangelo
pythondev_help_Deangelo_2019-02-12T14:56:00.300400
1,549,983,360.3004
8,005
pythondev
help
output: ``` monthly array: [ 600, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 300, 300, 300, 0, 0, 0, 0, 0, 0, 0, 0, 300, 300, 300, 300, 0, 0, 0, 0, 0, 0, 0, 0 ] ```
2019-02-12T14:56:37.300900
Deangelo
pythondev_help_Deangelo_2019-02-12T14:56:37.300900
1,549,983,397.3009
8,006
pythondev
help
forgot to divide percents by 100
2019-02-12T14:58:16.301900
Deangelo
pythondev_help_Deangelo_2019-02-12T14:58:16.301900
1,549,983,496.3019
8,007
pythondev
help
Hi all - I have a virtual environment for my Django app and I want to upgrade my `social-auth-app-django` package to the latest version to fix the Google+ issues outlined here: <https://github.com/python-social-auth/social-core/issues/300>
2019-02-12T15:55:49.303200
Maricruz
pythondev_help_Maricruz_2019-02-12T15:55:49.303200
1,549,986,949.3032
8,008
pythondev
help
When I do `pip install social-auth-app-django -U` to upgrade to the latest version, it upgrades successfully, but the code in my `myvenv/Lib/site-packages/social_core/backends/google.py` doesn't seem to have changed.
2019-02-12T15:56:54.304400
Maricruz
pythondev_help_Maricruz_2019-02-12T15:56:54.304400
1,549,987,014.3044
8,009
pythondev
help
Also did `pip install social-auth-core -U`
2019-02-12T15:57:15.304700
Maricruz
pythondev_help_Maricruz_2019-02-12T15:57:15.304700
1,549,987,035.3047
8,010
pythondev
help
(`myvenv` is the name of my virtual environment)
2019-02-12T15:57:31.305100
Maricruz
pythondev_help_Maricruz_2019-02-12T15:57:31.305100
1,549,987,051.3051
8,011
pythondev
help
Any ideas?
2019-02-12T15:57:43.305300
Maricruz
pythondev_help_Maricruz_2019-02-12T15:57:43.305300
1,549,987,063.3053
8,012
pythondev
help
<@Maricruz> try `python -m pip` instead of `pip`
2019-02-12T15:59:20.305900
Ashley
pythondev_help_Ashley_2019-02-12T15:59:20.305900
1,549,987,160.3059
8,013
pythondev
help
<@Ashley> didn't make a difference unfortunately
2019-02-12T16:22:24.306400
Maricruz
pythondev_help_Maricruz_2019-02-12T16:22:24.306400
1,549,988,544.3064
8,014
pythondev
help
`Requirement already up-to-date: social-auth-core`
2019-02-12T16:22:39.306700
Maricruz
pythondev_help_Maricruz_2019-02-12T16:22:39.306700
1,549,988,559.3067
8,015
pythondev
help
what do you get when you enter `which python`?
2019-02-12T16:22:57.307000
Ashley
pythondev_help_Ashley_2019-02-12T16:22:57.307000
1,549,988,577.307
8,016
pythondev
help
ahhhhh
2019-02-12T16:23:14.307200
Maricruz
pythondev_help_Maricruz_2019-02-12T16:23:14.307200
1,549,988,594.3072
8,017
pythondev
help
`/c/users/ehofmann/desktop/django_projects/ops_dashboard/myvenv/Scripts/python`
2019-02-12T16:23:28.307400
Maricruz
pythondev_help_Maricruz_2019-02-12T16:23:28.307400
1,549,988,608.3074
8,018
pythondev
help
that's actually my second project - I can't figure out why my first project's virtual environment is pointing there....
2019-02-12T16:23:48.307900
Maricruz
pythondev_help_Maricruz_2019-02-12T16:23:48.307900
1,549,988,628.3079
8,019
pythondev
help
thank you!
2019-02-12T16:23:50.308200
Maricruz
pythondev_help_Maricruz_2019-02-12T16:23:50.308200
1,549,988,630.3082
8,020