|
edmund745 posted:I had a problem but I already edited the files so I can't show the code... its a 350k total comp (150k cash 200k rsu) job in a 2-5 million neighborhood
|
# ? Aug 28, 2018 01:33 |
|
|
# ? May 28, 2024 14:17 |
Isn’t 150k formally poverty in some parts of SF?
|
|
# ? Aug 28, 2018 04:13 |
|
120K is the poverty line for a single male in Palo Alto, I think in SF the poverty line is 98K for a family of 4. You can live pretty comfortably in SF in a one bedroom in a desirable neighborhood for $100K, for $150 you can afford a really nice 1 bedroom and a hobby like race cars or sail boats, so long as you aren't trying to save money to buy a house or invest more than 5% in your 401k. Gets a lot cheaper if you get a roommate.
|
# ? Aug 28, 2018 04:25 |
|
edmund745 posted:I had a problem but I already edited the files so I can't show the code... If you just dump everything into the root of your file then it's going to be really difficult to implement the design that I mentioned. Use a class, this kind of problem is exactly what a class is good for. Define a main window class and a child window class. Have the main window class own an instance of the child window class. This will be easy to implement and relatively foolproof so long as you know basic python syntax A try/except block is a way of catching exceptions and then reacting to them instead of j letting the code crash. I recommend looking up some tutorials on how to use this
|
# ? Aug 28, 2018 07:08 |
|
bob dobbs is dead posted:its a 350k total comp (150k cash 200k rsu) job in a 2-5 million neighborhood QuarkJets posted:If you just dump everything into the root of your file then it's going to be really difficult to implement the design that I mentioned. ... quote:A try/except block is a way of catching exceptions and then reacting to them instead of j letting the code crash. I recommend looking up some tutorials on how to use this As I was searching for answers to the phantom window, I don't think I ran across any examples of using the Toplevel widget that said it was better to only use them inside classes.
|
# ? Aug 28, 2018 12:50 |
If you want to do GUI programming then “learn Python” is not a good thing to say or something that is commonly said, sorry.
|
|
# ? Aug 28, 2018 13:31 |
|
I'm taking a Udemy course on Python for data science and so far it's excellent. However, one thing that is lacking is lack of exercises. There's only one homework problem per section. Can anyone suggest a good resource for data science centric python exercises (with solutions), whether free or paid so i can practice some more? I'm taking Python A-Z: Python for data science with Kirill Eremenko on Udemy. If anyone could recommend any other Python courses (or any other data science related courses) on Udemy, i'd greatly appreciate it as well! Thanks!
|
# ? Aug 28, 2018 14:52 |
|
I was impressed with Tree House classes when I went to brush up a couple years ago. However, it's anywhere from $25 to $200/mo depending on which plan you want. So it might not be economically feasible if you can't get work to pay for it. https://teamtreehouse.com/account/enrollment
|
# ? Aug 28, 2018 16:02 |
|
Proteus Jones posted:I was impressed with Tree House classes when I went to brush up a couple years ago. Thanks for the suggestion! Looks like it focuses on python for web development rather than data science/analytics though.
|
# ? Aug 28, 2018 16:26 |
|
Mister Fister posted:Thanks for the suggestion! Looks like it focuses on python for web development rather than data science/analytics though. My bad. I didn't look at the current courses. For some reason I thought they had some data courses. Maybe that was Coursera, I remember looking at that around the same time.
|
# ? Aug 28, 2018 16:32 |
|
edmund745 posted:Yes but I'm kinda white-trashy so I figured I'd be in the slummy part of Palo Alto. So maybe that's a 1-mil neighborhood? You joke but there is a slummy part of Palo Alto called East Palo Alto. Its separated by 101 and its unmetaphorically the other side of the
|
# ? Aug 28, 2018 21:53 |
Mister Fister posted:I'm taking a Udemy course on Python for data science and so far it's excellent. However, one thing that is lacking is lack of exercises. There's only one homework problem per section. imo datacamp is pretty good if you can get it on a deal. Mostly smaller projects but there's a pretty wide range of subjects
|
|
# ? Aug 28, 2018 21:56 |
|
edmund745 posted:Yes but I'm kinda white-trashy so I figured I'd be in the slummy part of Palo Alto. So maybe that's a 1-mil neighborhood? What I said is that if you want parent windows to keep track of children windows then you should use a class to do that. Because then the children window literally belongs to the class You can use Toplevel wherever you want, the choice to use classes or not use classes is a question of design. edmund745 posted:That bit also wasn't working. What do you mean? Did you find some tutorials showing how try/except works? Did you try setting up a try/except block for yourself? What didn't work?
|
# ? Aug 28, 2018 23:39 |
|
CarForumPoster posted:You joke but there is a slummy part of Palo Alto called East Palo Alto. Its separated by 101 and its unmetaphorically the other side of the and it is pretty much actually at the $1 mil range https://www.redfin.com/city/5401/CA/East-Palo-Alto palo alto <-> mountain view commute is much more annoying than the distance lets on, tho, because zoning in the bay area is turbofucked and they can't build intermediate size roads worth poo poo and the transit sucks
|
# ? Aug 28, 2018 23:42 |
|
Yeah it is 30 minutes from SF to PA, about 36 miles, and then 30 minutes from PA to MV, about 9 miles. Doesn't help that the bridge (Dunbarton?) dumps out right in Palo Alto and their idea of on ramps and offramps are rooted in 1940s methodology.
|
# ? Aug 29, 2018 02:07 |
|
Any suggestions on scraping frameworks? I've always defaulted to requests + BS4 & falling back to Selenium + Chrome if I need funky stuff. But Scrapy looks quite appealing with its baked-in concurrency and plug-in support for stuff like proxies.
|
# ? Aug 29, 2018 10:57 |
|
cinci zoo sniper posted:If you want to do GUI programming then “learn Python” is not a good thing to say or something that is commonly said, sorry. Are there any decent tutorials on GUI programming, python or otherwise? I have done some basic interfaces but I feel like there should be some basic OO guidelines and good practice I am missing.
|
# ? Aug 29, 2018 12:24 |
|
It's all under the header of UX (user experience) now Or wait when you say gui programming are you talking about the interface or the code behind it?
|
# ? Aug 29, 2018 12:38 |
|
NtotheTC posted:It's all under the header of UX (user experience) now I mean how to implement an interface in code, like discussion above regarding child and parent windows, but for higher complexity. I don't even know if there common patterns for building multiscreen applications that work with an MVC approach.
|
# ? Aug 29, 2018 13:10 |
|
I'd like to use panda's sample function to skew the results according to the values in a column. For example, repeated executions of the following snipped usually return the row with the highest 'hugeness': Python code:
I use the sample function to get a few items from groupby objects, but I'd like to keep track of the number of times a word is returned, and skew the result towards words that were never returned. For example if my algo returns 'FunnyString' to the web ui a number of times, a field somewhere is updated and I'd want it to be less likely to come up later. ( I'm not even sure it makes sense from a math perspective. ) My two main questions are:
I find very few examples online, trial and error doesn't get me very far, and I can't really parse the docs.
|
# ? Aug 30, 2018 16:36 |
|
So I'm following along with 'Automate the Boring Stuff', and I'm trying to apply some things.Lesson 1 posted:print('How many cats do you have?') Lesson 2 posted:if guess > secretNumber: So I'm trying to merge them as follows: quote:try: But its telling me the break is outside the loop.
|
# ? Aug 30, 2018 16:39 |
|
Loel posted:But its telling me the break is outside the loop. Try posting with [code] tags so that we can see your indentation.
|
# ? Aug 30, 2018 16:43 |
|
At one point the main flask website has a great link near the bottom of the main page, or maybe it was the GitHub readme.md, that linked to the best example about how to structure a flask app. Does this still exist, or is there a good resource that replaces it? There's a lot of examples out there when you Google this question, but hard to find a quality example. There's a whole thread (two actually) on hacker news about how the example by digital ocean is the worst pattern to follow but is frequently referenced.
|
# ? Aug 30, 2018 16:54 |
unpacked robinhood posted:I'd like to use panda's sample function to skew the results according to the values in a column. Lower count weights would be, quick and dirty: code:
code:
code:
cinci zoo sniper fucked around with this message at 17:02 on Aug 30, 2018 |
|
# ? Aug 30, 2018 17:00 |
|
Loel posted:But its telling me the break is outside the loop. Well, it is as in, there isn't any loop at all (unless you didn't post that part of the code). To work as you intend, you can put pass instead of break, or better yet, don't put anything at all, since it isn't doing anything, just remove the else.
|
# ? Aug 30, 2018 17:17 |
|
Mark Larson posted:Try posting with tags so that we can see your indentation. code:
|
# ? Aug 30, 2018 21:22 |
|
Should be this:code:
|
# ? Aug 30, 2018 23:23 |
|
Hadlock posted:At one point the main flask website has a great link near the bottom of the main page, or maybe it was the GitHub readme.md, that linked to the best example about how to structure a flask app. Does this still exist, or is there a good resource that replaces it? There's a lot of examples out there when you Google this question, but hard to find a quality example. There's a whole thread (two actually) on hacker news about how the example by digital ocean is the worst pattern to follow but is frequently referenced. Maybe talking about this? http://flask.pocoo.org/docs/1.0/patterns/packages/
|
# ? Aug 31, 2018 07:03 |
|
Dr Subterfuge posted:Should be this: Yes. Indentation is king in Python.
|
# ? Aug 31, 2018 08:57 |
|
The other problem with that code is that the exception you're using the try/except block to catch happens when you convert the input from a string into an integer, you need to move that part inside the try.code:
|
# ? Aug 31, 2018 11:44 |
|
Whoops. Yeah. Guess I was too busy looking at the indents to notice the guess.
|
# ? Aug 31, 2018 22:56 |
|
Could someone help me out with what I'm missing here? Just switched over two VSCode from Pycharm which used to handle all this kind of stuff for me. My issue is that I have a course I'm taking that has weekly assignments. I'd like to have a directory per week, and then a collection of utilities, such as timing functions to measure various solutions I come up with. Here is my directory structure.code:
code:
code:
It seems to be getting tripped up on the line code:
|
# ? Sep 1, 2018 01:06 |
|
pretty sure this would workPython code:
|
# ? Sep 1, 2018 01:45 |
|
Dr Subterfuge posted:pretty sure this would work That results in: code:
code:
huhu fucked around with this message at 02:02 on Sep 1, 2018 |
# ? Sep 1, 2018 01:56 |
|
Personally, I always make a setup.py file, and pip install -e it. Otherwise whether it works depends on what's on the path and what your current directory is. From PyCharm, your current directory is the parent folder, whereas from the command line you were already one folder deep. I believe that's the difference, rather than any PyCharm shenanigans. It might also work if you put code:
and code:
Or something like that. Although that will help the import chain along, exactly where to start importing from will depend on what directory you're in. Unless c1_algorithmic_toolbox is on the path, which is most reliably accomplished by packaging and installing it.
|
# ? Sep 1, 2018 02:28 |
|
And I just realized the print statement isn't a function, so this is python 2. I know some import behavior changed between 2 and 3, but I don't know if that's relevant here.
|
# ? Sep 1, 2018 02:49 |
|
Dr Subterfuge posted:And I just realized the print statement isn't a function, so this is python 2. I know some import behavior changed between 2 and 3, but I don't know if that's relevant here. That's why I tried to highlight that " some code, which I don't think is relevant to my current problem " because I couldn't even get anything to yell about it being Python 2 code.
|
# ? Sep 1, 2018 03:00 |
|
Good point, I haven't used Python 2 in a long time so that might throw off my suggestion. Is your class really having you use Python 2? It will be deprecated in 15 months. It's been the wrong choice (especially for an educational environment) for years, but at this point there's no excuse and it's probably worth complaining about. Granted, the differences aren't huge, but still. Edit: Oh, you're using Python 3 but have some old Python 2 code you want to run? Well, fix the import problem first, and then yes, you'll have to update timing.py.
|
# ? Sep 1, 2018 03:02 |
|
SurgicalOntologist posted:Edit: Oh, you're using Python 3 but have some old Python 2 code you want to run? Well, fix the import problem first, and then yes, you'll have to update timing.py. I'm leading a class at work because I'd like to learn new things. I might have spent too long as a React/Node developer that I forget the Python way of doing things or I'm just trying to force the JS way on Python. Eeeesh...
|
# ? Sep 1, 2018 03:41 |
|
|
# ? May 28, 2024 14:17 |
|
A Python garbage collection question – I've implemented a data structure in C and wrapped it with a Python module using ctypes. This module is used in a project where the data structure is an attribute of a class. Where and how is it best to free the memory allocated by the C library? Cursory searches suggest adding a __del__ method which frees the memory, but which class should have the __del__ method? Should the class which wraps the data structure free the memory, or should the class which uses the wrapped data structure have the method? If I put it on the wrapped data structure, when an object of the class in the end project is garbage collected, will it call the __del__ method of its attributes (and therefore the wrapped data structure)? Other results I found suggested that the __del__ method was evil and to be avoided, what the hell am I supposed to be doing here?
|
# ? Sep 1, 2018 22:38 |