k. i can't extract the text from the xpath "//*[@id="right"]/table[1]/tbody/tr[2]/td[1]" from this link. I'm using lxml.html. It returns an empty list []. It should return everything!
so either he copied the code and doesn't know what it is doing (which would be a pain) or he is trying to ask a different question which would need further clarification
Just as well, I wouldn't like that kind of "keep going even if the identifier doesn't exist" behavior anyway. 99 times out of 100 I'd prefer a typo like that to noisily crash the program as early as possible
Me and DSM could form a crack data science team at FB. We could make it into a sitcom, he'd be the grizzled veteran data scientist who has seen too much of the world, I'd be the young peppy newcomer trying to teach him that rainbows still exist. Except, of course, that in actual fact I'm the brutally cynical young man and in general DSM is quite upbeat. Go figure.
import numpy as np
class Perceptron(object):
"""Perceptron classifier.
Parameters
------------
eta : float
Learning rate (between 0.0 and 1.0)
n_iter : int
Passes over the training dataset.
Attributes
-----------
w_ : 1d-array
Weights after fitting.
errors_ : list
Number of misclassifications in every epoch.
sigh...too many people think they can simply jump straight into a "Data Science in X" or "Data Mining in X" book without understanding the basics. Shortcuts usually don't work (or end up being longer)
only if they are actually a data scientist or analyst or whatever we're called by people (my title seems to vary a lot depending on who is referring to me)
At FC you have a job role and a job title, your job role only changes when you get promoted, but your job title changes all the time with projects. One project I'm in Data Architecture, the next I'm a System Designer (our fancy term for software dev), and now I'm currently working on Data Science. \o/
@Käsebrot they did say what was going on (it was a comment) and pointed you towards docs and tutorial to learn the basics as this is a fairly early concept in python learning - and my comment was directed more at me trying to understand my own students then you or anyone on SO
@Ffisegydd Yeah, and not even for the sake of the room regulars. If you ask me, it's harder to learn from a disorganized group of people than from a meticulously curated and maintained tutorial.
I hammered a question about "unable to find vcvarsall.bat" with this, but it's not actually a very good reference. Nothing about Python 3.3+ needing a different version. Is there a better dupe target, at least for Python 3?
@Ffisegydd that's just what I was referring to. Two project ago I was a Data Scientist, which was cool cause you know Science is cool!...now I'm back to Data Analyst :P ;)....but I'm always just a researcher
@davidism you probably went through these, but this links directly to a blog post with a decent amount of information and this links to a 3.3 blog post as well
I'm having a minor chicken-and-egg problem with well-meaning circular imports. Is there a canonical on that or is it even worth asking a question about?
main.py is setting up the logging module, but needs info from config.py to know where to point the logger handler, but I want config.py to log as well.
Import config.py into your main.py, if the file has to be created then set a boolean variable somewhere and make sure you import it, then setup your logging using the config params, then once it's setup do your logging.
right, but logger.py would need to talk to config.py to get the filehandler location, and config.py would need logger.py to have the filehandler location before it can log
config["LOGGING"]["level"] == logging.INFO # True by default, but user can change
_default_config_ini = r''' # some big long string '''
I wrap the above config = ... in a try block and except FileNotFoundError: with open("filename.ini", "w") as f: f.write(_default_config_ini); config = # same as above
yeah more or less, but logfile isn't configurable -- it only ever goes to os.path.join(os.environ("LOCALAPPDATA"), "companyname", "appname", "versionnumber", "appname.log")
it seems Bad to log for config.py inside main.py. What if I need to reload the config for some reason? I think I can get it though, just typing something up
the stores are open, ppl can buy stuff, but those who ordered it online and paid in cash and said they'd pick it up at the shop cannot get their stuff..
what is more... the company had an ad campaign wherein you could get up to 40 % discounts when shopping online :D:D:D:D
the woman interviewed in this one article had got sms about her stuff being in the store, she went to receive it and they said "sorry, no, can't, illegal ya know"
then I can do fh.setLevel(config.config["LOGGING"]["level"]) or whatever
lets config.py log with a logging.DEBUG level, then by the time anything else needs to log it's been set up to logging.INFO or logging.WARN or whatever.
so if she'd spent 3 € more to have it delivered to a mail office or to door, then she'd have it now. but since she'd asked delivery to the store to save 3 € now she can't have it and must sue them instead
It's on my "to-watch" list. I enjoyed the first episode a lot, but I have this weird quirk where I need to be in the right mood to watch good TV, and the right situation hasn't happened yet..
I have lived in San Diego for 10 years and have never been to ComicCon. I don't know if I could put up with it in person, but I want to try at least once at some point.
I'm sure there is some smart editor out there to help you correct typos, let's say it does all permutations of your right script and then searches text for them, beacuse mostly it's like my word 9 words before
How cheap is Python's file I/O? I'm looking to count the number of lines in a file (basically like so), but doing the same in MATLAB is really expensive (edric(1) here) so I just use a system call like wc -l
Flask will prompt you with corrections if you try to generate a url to an endpoint it doesn't recognize. I'm not sure what it's using, or if it's actually in Werkzeug.
@Andras: yep. :-) If I had to count lots of lines from Python I'd try to read in big chunks and then call count to push as much of the searching to C as possible.
Oy, how'd it get so late already? Rhubarb for all!
It needs to solve everything under 2 seconds, and test cases are frightening :D
here is my solution dpaste.com/2YH9TQA because there you'd have to log in, before commenting on slow python loops if you look at it and read the problem, I didn't have better idea :)
the actual e-mail is non-trivial, it includes the crackpot's name as an image to prevent spam filters, and the raw message contains a lot of words that are backwards, I assume with a lot of RTL marks
the scary thing is that at least according to the source of the message, the sender really seems to be the Swedish guy (though I don't know anything about spoofing e-mail addresses)
I sent an e-mail to the poor Swedish fellow to inform him of these fun times...
fortunately two "papers" of the crackpot are also included for simplicity
> The real "particles" of this world are the photon, X-ray-photon and gamma-photon "particles". Other "particles" don't exist. James Chadwick's neutron is a gas molecule which with 20 minutes after the arising decays to a positive hydrogen ion and a negative gas ion which was known till now as electron, and it not same with the gamma-photons which are emitted by the nucleus of the radioactive atoms. Known that from the hydrogen so will be deuteron that the nucleus of the hydrogen absorbs a gamma-photon. The nucleus of the hydrogen consists of one gamma-photon. The mass of the absorbed gamma…
Nutty McNutface
OK I'm done for now, I'll come back tomorrow to vent some more:D