jupyter-notebook

Error! blahfile is not UTF-8 encoded. Saving disabled

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-09 12:00:26
问题 So, I'm trying to write a gzip file, actually from the net, but to simplify I wrote some very basic test. import gzip LINES = [b'I am a test line' for _ in range(100_000)] f = gzip.open('./test.text.gz', 'wb') for line in LINES: f.write(line) f.close() It runs great, and I can see in Jupyter that it has created the test.txt.gz file in the directory listing. So I click on it expecting a whole host of garbage characters indicative of a binary file, like you would see in Notepad. However,

Error when opening .ipynb in JupyterLab - “Close without saving?”

和自甴很熟 提交于 2020-07-09 11:59:48
问题 When I try to open my .ipynb , I get the following error. Other notebooks in the same directory work just fine. UI Error: Close without saving? File "cloner.ipynb" has unsaved changes, close without saving?Close without saving? File "cloner.ipynb" has unsaved changes, close without saving? Browser console errors: serverconnection.js:192 GET http://localhost:8890/api/contents/cloner.ipynb?type=notebook&content=1&1586015957921 400 (Bad Request) handleRequest @ serverconnection.js:192

Error when opening .ipynb in JupyterLab - “Close without saving?”

China☆狼群 提交于 2020-07-09 11:59:26
问题 When I try to open my .ipynb , I get the following error. Other notebooks in the same directory work just fine. UI Error: Close without saving? File "cloner.ipynb" has unsaved changes, close without saving?Close without saving? File "cloner.ipynb" has unsaved changes, close without saving? Browser console errors: serverconnection.js:192 GET http://localhost:8890/api/contents/cloner.ipynb?type=notebook&content=1&1586015957921 400 (Bad Request) handleRequest @ serverconnection.js:192

Jupyter Notebook error while using PySpark Kernel: the code failed because of a fatal error: Error sending http request

独自空忆成欢 提交于 2020-07-09 08:45:05
问题 I and using jupyter notebook's PySpark kernel, I have successfully selected PySpark kernel but I keep getting the below error The code failed because of a fatal error: Error sending http request and maximum retry encountered.. Some things to try: a) Make sure Spark has enough available resources for Jupyter to create a Spark context. b) Contact your Jupyter administrator to make sure the Spark magics library is configured correctly. c) Restart the kernel. here's the log also 2019-10-10 13:37

Is there a pure Markdown way to include two images side by side in Jupyter?

我的未来我决定 提交于 2020-07-09 06:24:27
问题 There is a useful Python solution here to put two images side by side in the notebook, but is there a language agnostic way that does the trick using only Jupyter's own markdown? Something like ![](path/to/image1) # insert magic here # ![](path/to/image2) that displays the images side by side? This would be useful in my case cause I would prefer not to break a markdown cell into two and put code in between, but I also would find this helpful in case the notebook is not running Python. I

Failing to launch tensorboard from jupyter

不想你离开。 提交于 2020-07-09 06:10:46
问题 I get the error below when I try launching tensorboard from my jupyter notebook . I am using a conda environment and using the env-specific kernel since tensorflow is only installed in my environment. What am I doing wrong? The error: %tensorboard --logdir logs ERROR: Failed to launch TensorBoard (exited with -6). Contents of stderr: [libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/descriptor_database.cc:393] Invalid file descriptor data passed to EncodedDescriptorDatabase:

Jupyter notebook SSH tunnel for two step ssh tunnel

♀尐吖头ヾ 提交于 2020-07-09 05:39:05
问题 I want to access a jupyter notebook via an SSH tunnel and follow this recipe https://hsaghir.github.io/data_science/jupyter-notebook-on-a-remote-machine-linux/ To sumarize - : 1. Log in remote machine user@local_host$ ssh user@remote_host remote_user@remote_host$ jupyter notebook --no-browser --port=8889 2.In a new terminal: user@local_host$ ssh -N -L localhost:8888:localhost:8889 remote_user@remote_host 3.Then go to a browser and go to localhost:8888 Now here is my problem: I can access the

Jupyter nbconvert LaTex Export Theme

送分小仙女□ 提交于 2020-07-09 05:28:28
问题 I am using Jupyter Notebook nbconvert (Save as menu) to export as pdf via Latex. However, the pdf file is not in a good shape. For example, some wide tables are shown well. I would prefer to have a box for tables to be resized to the width of the page. Is there any style, template that I can use to have nice reports and how I may ask nbconverter to use that style? Here is the Latex output: I would like something like this: 回答1: Looks like Pandas gained a ._repr_latex_() method in version 0.23

Automatically convert jupyter notebook to .py

瘦欲@ 提交于 2020-07-08 11:50:15
问题 I know there have been a few questions about this but I have not found anything robust enough. Currently I am using, from terminal, a command that creates .py, then moves them to another folder: jupyter nbconvert --to script '/folder/notebooks/notebook.ipynb' && \ mv ./folder/notebooks/*.py ./folder/python_scripts && \ The workflow then is to code in a notebook, check with git status what changed since last commit, create a potentially huge number of nbconvert commands, then move them all. I

Put the legend of pandas bar plot with secondary y axis in front of bars

半腔热情 提交于 2020-07-08 09:02:41
问题 I have a pandas DataFrame with a secondary y axis and I need a bar plot with the legend in front of the bars. Currently, one set of bars is in front of the legend. If possible, I would also like to place the legend in the lower-left corner. Any ideas appreciated! I have attempted to set the legend=false and add a custom legend, but it has the same issue. I've tried reordering the columns but there's no way to clear a space for this on the chart. import pandas as pd import matplotlib.pyplot as