jupyter-notebook

Beautiful Soup AssertionError

与世无争的帅哥 提交于 2020-02-25 13:18:32
问题 I am trying to scrape this website into a .CSV and I am getting an error that says: AssertionError: 9 columns passed, passed data had 30 columns . My code is below, it is a little messy because I exported from Jupyter Notebook. from urllib.request import Request, urlopen from bs4 import BeautifulSoup as soup import pandas as pd url = 'https://apps.azsos.gov/apps/election/cfs/search/CandidateSearch.aspx' req = Request(url , headers={'User-Agent': 'Mozilla/5.0'}) html = urlopen(req).read() soup

Beautiful Soup AssertionError

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-25 13:18:25
问题 I am trying to scrape this website into a .CSV and I am getting an error that says: AssertionError: 9 columns passed, passed data had 30 columns . My code is below, it is a little messy because I exported from Jupyter Notebook. from urllib.request import Request, urlopen from bs4 import BeautifulSoup as soup import pandas as pd url = 'https://apps.azsos.gov/apps/election/cfs/search/CandidateSearch.aspx' req = Request(url , headers={'User-Agent': 'Mozilla/5.0'}) html = urlopen(req).read() soup

Line profiling with cython in jupyter notebook

ⅰ亾dé卋堺 提交于 2020-02-25 08:18:06
问题 I'm trying to use liner_profiler library in jupyter notebook with cython function. It is working only halfway. The result I get only consist of first row of the function and no profiling results. %%cython -a # cython: linetrace=True # cython: binding=True # distutils: define_macros=CYTHON_TRACE_NOGIL=1 import numpy as np cimport numpy as np from datetime import datetime import math cpdef np.int64_t get_days(np.int64_t year, np.int64_t month): cdef np.ndarray months=np.array([31,28,31,30,31,30

Connect to remote python kernel from python code

纵饮孤独 提交于 2020-02-24 17:31:25
问题 I have been using PaperMill for executing my python notebook periodically. To execute compute intensive notebook, I need to connect to remote kernel running in my EMR cluster. In case of Jupyter notebook I can do that by starting jupyter server with jupyter notebook --gateway-url=http://my-gateway-server:8888 and I am able to execute my code on remote kernel. But how do I let my local python code(through PaperMill) to use remote kernel? What changes do what to make in Kernel Manager to

Connect to remote python kernel from python code

寵の児 提交于 2020-02-24 17:29:57
问题 I have been using PaperMill for executing my python notebook periodically. To execute compute intensive notebook, I need to connect to remote kernel running in my EMR cluster. In case of Jupyter notebook I can do that by starting jupyter server with jupyter notebook --gateway-url=http://my-gateway-server:8888 and I am able to execute my code on remote kernel. But how do I let my local python code(through PaperMill) to use remote kernel? What changes do what to make in Kernel Manager to

Connect to remote python kernel from python code

两盒软妹~` 提交于 2020-02-24 17:29:06
问题 I have been using PaperMill for executing my python notebook periodically. To execute compute intensive notebook, I need to connect to remote kernel running in my EMR cluster. In case of Jupyter notebook I can do that by starting jupyter server with jupyter notebook --gateway-url=http://my-gateway-server:8888 and I am able to execute my code on remote kernel. But how do I let my local python code(through PaperMill) to use remote kernel? What changes do what to make in Kernel Manager to

how to make a new line in a jupyter markdown cell

一个人想着一个人 提交于 2020-02-17 06:56:27
问题 md $S$: a set of shops $I$: a set of items M wants to get I'd like to make a new line between this two sentences. We usually put " (space)" after the first sentence before a new line, but it doesn't work in Jupyter. How can I do this? Should I put "enter" twice after the first sentence? 回答1: Just add <br> where you would like to make the new line. $S$: a set of shops <br> $I$: a set of items M wants to get Because jupyter notebook markdown cell is a superset of HTML. http://jupyter-notebook

Cannot import modules in jupyter notebook; wrong sys.path

不问归期 提交于 2020-02-14 02:51:07
问题 I am having a problem importing modules in my iPython/Jupyter notebook. The problem fundamentally lies in where the sys.path is pointing to. From the iPython/Jupyter notebook, sys.executable returns: '/usr/bin/python' However, from the command line, it returns: '//anaconda/bin/python' I have tried un-installing and re-installing anacondas, but the problem still remains. I have also tried augmenting $PYTHONPATH in my bash_profile to include //anaconda/bin/python, but this doesn't resolve it.

Cannot import modules in jupyter notebook; wrong sys.path

末鹿安然 提交于 2020-02-14 02:50:49
问题 I am having a problem importing modules in my iPython/Jupyter notebook. The problem fundamentally lies in where the sys.path is pointing to. From the iPython/Jupyter notebook, sys.executable returns: '/usr/bin/python' However, from the command line, it returns: '//anaconda/bin/python' I have tried un-installing and re-installing anacondas, but the problem still remains. I have also tried augmenting $PYTHONPATH in my bash_profile to include //anaconda/bin/python, but this doesn't resolve it.

Default kernel in jupyter notebook (Python3) not working

柔情痞子 提交于 2020-02-07 02:25:07
问题 I installed Anaconda3 having Python 3.7.3 on Windows 10. When I launch Jupyter Notebook from Anaconda3 Navigator using environment: base(root), it shows kernel error and Python 3 (which is default kernel) as dead kernel. The kernel error is: Traceback (most recent call last): File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\web.py", line 1699, in _execute result = await result File "C:\Users\Admin\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line