@PM2Ring Ok, got it. I didn't know how much "domain knowledge" was expected, and I didn't know that moderation is often performed by people totally unfamiliar with that particular tag.
my python version is 2.7.15rcl but now I want to update it to 2.7.16 because when I googled the documentation there's one for 2.7.16 and not for 2.7.15rcl. Now, sudo apt-get update python 2.7.16 doesn't work, but sudo apt-get update python 2.7 works, is that what I have to do? (I can't use python 3+ because my course is 2.7+ based)
I seem to remember a proposal for python to allow the usage of keywords as variables and stuff, through the use of leading backslashes. Like \for = 'some_val'
was that just a nightmare, ir did it actually happen? can't find it on google or in the peps as of yet
well, I remembered it because of this question. he has to fulfill an interface, so he can't just append an underscore, and having a straight forward mapping between the parameter dict and the object representing it would be nice
oh, thats an interesting case. I do not work with classes at all really so far, so my general approach to issues with names have been, as a rule, using the quotation marks to access things whenever a choice is available (such as with dataframe columns).
But class attributes are basically variable names, so that throws a wrench in things in this case
@Moytaba shame on google. Python 2 was broken in subtle ways that's much harder to unlearn than never learn in the first place. In particular, strings and bytes.
@U9-Forward "accidentally"
There's a popup that asks if you really want to undelete. And why are you even pinging Martijn with that?
Too bad all those people have farmed a lot of rep so they can all "accidentally" undelete
@user14492 this better not be about what you asked last night, to which I left a wall of responses with no reply from you.
Just type "python3" and see what you get... normally they'll have 2.7 because of apt/package managers and other utils, but they'll still have Python 3 available as "python3" or easily installable
Ok Let me correct myself. I am using Pycharm on Windows PC and there I have python configured and it's kinda easy on Windows that I felt. However in Linux both python version are present so to avoid confusion I added python3 shebang on top of my script
If you've made any changes to your PYTHONPATH in your .bashrc or .bash_profile or .profile, it's possible that those files aren't executed by cron and the changes aren't applied
I undeleted, re-applied the duplicate state. Only thing lost is the delete votes (which I'm more than fine with) and a single reopen vote (cleared by U9's reopen, but from someone with no Python connection that I can see).
@MartijnPieters Thank you so much Martjin, i really appreciate it, i agree that it should be undeleted, thanks so much, i got my highest voted answer back.
@JonClements what is happening with the latest? "We can be flippant with runtime" --> "exactly my point". Oh my, I best not check SO while on holiday :)
X is an independent variable and y is the dependent. It doesn't make sense to me that x could be different on the same plot - are you sure this is the right approach?
There's nothing wrong with that graph other than the multiple, duplicate, x-axis
nooo it is not duplicate... it is there for a reason... in my chart there should be 3 plots.. 1-spline, 2-column, 3-bubble...... bubble and column should have 1 xAxis and the spline should have another
That doesn't make sense to me. A graph is an artificial visualisation of data to try make sense of it. The data always exists regardless; do you think that such a plot helps people understand?
Hmm, what's a good way to compress a sequence of unknown length that contains exactly three unique values? I could make "A" into 0b00 and "B" into 0b01 and "C" into 0b10, which lets me fit four values per byte. But this seems inefficient since 0b11 doesn't map to anything.
I have a feeling that the overhead of trying to compress 1) probably won't be that massively successful and 2) not very practical and 3) no better in space/convenience/performance that keeping it string like...
Umm... so between 32kb and a bit over a meg then if kept in a byte string?
"just store it as a string" isn't out of the question. As usual, my personal projects' requirements are dictated by what is fun rather than what is necessary. If I can't find a cool encoding, I'll just do the boring megabyte-long bytes object.
Certainly extracting the Nth trit from an integer isn't a lot of work on my end, since it's just one divide and one modulus. But I worry that this sort of arithmetic has linear complexity for very large integers.
lambda x: [y*2 for y in range(x)] is valid syntax, and so is [lambda a: a+b for b in range(10)]
Or perhaps you're asking "is it correct to use the term 'list comprehension' to refer to any expression that converts one sequence to another? For example, list(map(lambda x: x*2, range(3))) turns [0,1,2] into [0, 2, 4]. Is it a list comprehension?". If that's what you're asking, then no. That's not a list comprehension.
List comprehensions are at least as powerful as the map() and filter() functions found in most functional languages. You can't use them to reproduce the behavior of reduce, however.
You might write your julia code as result = sum(k / (2**k) for k in init_list)
the question asked me to calculate a sum formula similar to the following
So I guessed I had to sum all of them at the end, but I believe everything else should be a List Comprehension and not a lambda expression, and them summ the elements at the end
If I'm being maximally pedantic, result = sum(k / (2**k) for k in init_list) doesn't contain a list comprehension either. A list comprehension requires square brackets. [k / (2**k) for k in init_list] is a list comprehension. k / (2**k) for k in init_list with a parenthesis on either side is a generator expression.
Programmers coming from a functional language may prefer generator expressions since the values are calculated lazily. Compared to list comprehensions, which construct the full list right away.
I spent a good bit of time yesterday translating the Wikipedia page for calculating sunrise and sunset based on location and Julian date, only to remember that things like Astropy exist about five minutes after I got my code to start producing believable results. It's the journey not the destination, right?
@Dodge I started the flask tutorial, but figured out that to do much more than that, I need to learn more HTML/CSS/JS than I remember from...1999? That's the talk I'm embarking on now.
@toonarmycaptain my two cents on the matter is to grab a front end from somewhere like themeforest and reverse engineer to learn how such things are constructed. Don't waste time writing a bunch of JS to handle cross device compatibility for the site-- it's boring, tedious, and can be bought for nothing. Once you see how it's all put together the overall process for creating a web app is, obviously, much easier.
anyone on macbook here? thinking of upgrading my Pro 2015 with 1TB SSD, but not sure if it's worth investing around 250 pounds or shall I just wait a couple more years and buy a new laptop
I'm not big on hardware, so not sure i.e. how long will my 8gb of ram be sufficient for modern software, and how fast is my i5 processor ageing these days
@Dodge Well, tbh I stuck 'JS' on there because it's so ubiquitous I should at least glance at it. All I ever did when I was messing with web stuff before was nick stuff and change variables/filenames until it did what I wanted.