jupyter-notebook

How to fix 'C extension not loaded, training will be slow. Install a C compiler and reinstall gensim for fast training.'

家住魔仙堡 提交于 2019-12-20 01:06:46
问题 I'm using the library node2vec, which is based on gensim word2vec model to encode nodes in an embedding space, but when i want to fit the word2vec object I get this warning: C:\Users\lenovo\Anaconda3\lib\site-packages\gensim\models\base_any2vec.py:743: UserWarning: C extension not loaded, training will be slow. Install a C compiler and reinstall gensim for fast training. Can any one help me to fix this issue please ? 回答1: gensim relies on extension modules that need to be compiled. Both

Getting “OSError: [WinError 6] The handle is invalid” in VideoFileClip function

荒凉一梦 提交于 2019-12-20 00:09:08
问题 I am creating a program using python by importing moviepy library, but getting following error: from moviepy.editor import VideoFileClip white_output = 'videos/testVideo.mp4' clip1 = VideoFileClip("videos/testVideo.mp4") OSError Traceback (most recent call last) <ipython-input-40-f49638833528> in <module>() 1 white_output = 'videos/testVideo.mp4' ----> 2 clip1 = VideoFileClip("videos/testVideo.mp4") 3 white_clip = clip1.fl_image(process_image) #NOTE: this function expects color images!! 4 get

Getting “OSError: [WinError 6] The handle is invalid” in VideoFileClip function

我的梦境 提交于 2019-12-20 00:08:28
问题 I am creating a program using python by importing moviepy library, but getting following error: from moviepy.editor import VideoFileClip white_output = 'videos/testVideo.mp4' clip1 = VideoFileClip("videos/testVideo.mp4") OSError Traceback (most recent call last) <ipython-input-40-f49638833528> in <module>() 1 white_output = 'videos/testVideo.mp4' ----> 2 clip1 = VideoFileClip("videos/testVideo.mp4") 3 white_clip = clip1.fl_image(process_image) #NOTE: this function expects color images!! 4 get

how to show all methods that i can choose in ipython notebook?

青春壹個敷衍的年華 提交于 2019-12-19 23:22:42
问题 I'm new to ipython notebook. When typing a code line, it should show all methods or attributes that I can choose. However, it didn't, and I'm not sure why. It should look like this: Does anyone know how I can get this to work? 回答1: Type the library name Type period symbol . Press tab At this point you will see drop down menu (showing all the methods) This works for both python 2 and python 3 回答2: That should be a new feature of IPython 6.0. But as mentioned in the official release post, is

how to show all methods that i can choose in ipython notebook?

青春壹個敷衍的年華 提交于 2019-12-19 23:19:47
问题 I'm new to ipython notebook. When typing a code line, it should show all methods or attributes that I can choose. However, it didn't, and I'm not sure why. It should look like this: Does anyone know how I can get this to work? 回答1: Type the library name Type period symbol . Press tab At this point you will see drop down menu (showing all the methods) This works for both python 2 and python 3 回答2: That should be a new feature of IPython 6.0. But as mentioned in the official release post, is

Is it possible to navigate to a parent directory in the jupyter tree?

泄露秘密 提交于 2019-12-19 18:53:57
问题 Normally, I launch jupyter from a new bash terminal: ~$ jupyter notebook and then navigate down the tree to the files I want to work at. I just did it from a terminal that was already running at a different path: ~/blah/blah/blah$ jupyter notebook and realized that that directory becomes the home for jupyter. I wanted to work at a file located at, say ~/blah/thingy/luis.ipynb , but couldn't find my way up . How do I navigate the directory tree upwards in jupyter notebook? 回答1: As explained in

Jupyter notebook new cell type default

只愿长相守 提交于 2019-12-19 17:41:29
问题 When I use a jupyter notebook, I would like new cells to be of type "markdown". By default, the type of new cells is "code". Which config file should I modify and which variable should I change? 回答1: Go to the site-packages directory of your python environment and modify site-packages/notebook/static/notebook/js/main.min.js Find something like Notebook.options_default = { // can be any cell type, or the special values of // 'above', 'below', or 'selected' to get the value from another cell.

How can I clear a model created with Keras and Tensorflow(as backend)?

不羁岁月 提交于 2019-12-19 12:54:47
问题 I have a problem when training a neural net with Keras in Jupyter Notebook. I created a sequential model with several hidden layers. After training the model and saving the results, I want to delete this model and create a new model in the same session, as I have a for loop that checks the results for different parameters. But as I understand the errors I get, when changing the parameters, when I loop over, I am just adding layers to the model (even though I initialise it again with network =

Import of matlab.engine works in IPython but not in Jupyter

被刻印的时光 ゝ 提交于 2019-12-19 11:52:19
问题 I just installed the MATLAB Engine API for Python to my home directory using $ python setup.py build --build-base=$HOME install --prefix=$HOME However, when I try to import matlab.engine from a Jupyter notebook, I get the following error: --------------------------------------------------------------------------- EnvironmentError Traceback (most recent call last) <ipython-input-2-833daa01cd46> in <module>() 8 import numpy as np 9 import matplotlib.pyplot as plt ---> 10 import matlab.engine 11

Lineplot doesn't show all dates in axis

為{幸葍}努か 提交于 2019-12-19 10:49:15
问题 I have the followings: fig, ax = plt.subplots(figsize=(40, 10)) sns.lineplot(x="Date", y="KFQ imports", data=df_dry, color="BLACK", ax=ax) sns.lineplot(x="Date", y="QRR imports", data=df_dry, color="RED",ax=ax) ax.set(xlabel="Date", ylabel="Value", ) x_dates = df_dry['Date'].dt.strftime('%b-%Y') ax.set_xticklabels(labels=x_dates, rotation=45) Result When I use a barchart ( sns.barplot ) the entire spectrum of dates are shown. Am I missing something for the line chart? I 回答1: The idea would be