Please help contribute to the Reddit categorization project here

    lieutenant_lowercase

    + friends - friends
    16,173 link karma
    7,581 comment karma
    send message redditor for

    [–] colouring a surface by another variable (that is gridded) lieutenant_lowercase 2 points ago in learnpython

    If a particular RGBA value is None what are you expecting it to color the surface?

    [–] L3 - 2016 CFAI AM Mock lieutenant_lowercase 1 points ago in CFA

    Out of interest why do you think you failed L3?

    [–] Trying to learn some webscraping and running into some problems...could use any and all help. lieutenant_lowercase 2 points ago in learnpython

    To iterate you would do something like this:

    import requests
    from bs4 import BeautifulSoup
    
    base_url = 'https://www.fearnleys.no/weekly_issue/view/{}/3'
    for week in range(740, 746):
      r = requests.get(base_url.format(week))
      soup = BeautifulSoup(r.text)
      date = soup.find('option', {'selected':'selected'}).text
      for row in soup.findAll('table', {'class':'complex'})[0].tbody.findAll('tr'): #Spot Rates
        columns = row.findAll('td')
        print(date, columns[0].text.strip(), columns[1].text.strip()) 
    

    Where you increase the week number in the url. You can parse the date from the page and then save it

    [–] Trying to learn some webscraping and running into some problems...could use any and all help. lieutenant_lowercase 2 points ago in learnpython

    Use

    soup.find('table', {'class':'complex'})
    

    or

    soup.findAll('table', {'class':'complex'})[0]
    

    to select just the first table for rates or

    soup.findAll('table', {'class':'complex'})[2]
    

    to select the LNG

    [–] Trying to learn some webscraping and running into some problems...could use any and all help. lieutenant_lowercase 2 points ago * (lasted edited a day ago) in learnpython

    What have you tried so far? Are you using beautifulsoup? The trick is to inspect the elements. The main table body is class 'complex'. Select the table, then just the body using tbody then iterate over the rows 'tr'.

    import requests
    from bs4 import BeautifulSoup
    
    r = requests.get('https://www.fearnleys.no/weekly_issue/view/747/3')
    soup = BeautifulSoup(r.text)
    for row in soup.find('table', {'class':'complex'}).tbody.findAll('tr'): 
      columns = row.findAll('td')
      print(columns[0].text.strip(), columns[1].text.strip()) 
    

    [–] How can I make a flash detector? lieutenant_lowercase 1 points ago in learnpython

    _, lightcontours, hierarchy = cv2.findContours(edged, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
    

    https://github.com/jasonlfunk/ocr-text-extraction/issues/5

    [–] Serious question for civil discussion: ball cam on or off? lieutenant_lowercase 40 points ago * (lasted edited 2 days ago) in RocketLeague

    On unless dribbling or going for boost.

    [–] Dropped from Gold 2 to Silver 1 lieutenant_lowercase 6 points ago in RocketLeague

    Placing is very generous. If you dropped to Silver then that's where you most likely belong unfortunately

    [–] What are topic tests? lieutenant_lowercase 3 points ago in CFA

    Correct. In previous years on the old platform they were called Topic Tests

    [–] pandas help lieutenant_lowercase 2 points ago in learnpython

    str.contains accepts regex

    word_list = ['CPU high workload, 'High disk usage', etc..]
    df[df['type'].a.str.contains('|'.join(word_list ))]
    

    [–] I'm trying to scrape every legendary creature on wikipedia with BeautifulSoup and my attempts fire back random letters and symbols. lieutenant_lowercase 1 points ago in learnpython

    for creature in soup.findAll('ul')[0].findAll('li'):
        print(creature.a.text)
    

    Here is the answer but I'd recommend you spend some time on a beautifulsoup tutorial or something. Maybe learn a bit of HTML if you want to do anymore scraping