jupyter-notebook

Deleting blank lines from Jupyter notebook

浪尽此生 提交于 2020-01-24 05:06:05
问题 Is there an easy way of removing blank lines from IPython notebook? I have picked up a habit of blank lines from web development and my fingers tend to hit enter automatically. This makes IPython notebooks less(by taking too much of my 14" screen), not more readable in most cases. I was wondering if there is a way of automatically remove blank lines from the notebooks. In notebooks, I think preferred way of splitting the code is by placing each separate method to a different cell. Is commonly

Jupyter notebook Memory limit

醉酒当歌 提交于 2020-01-23 17:12:26
问题 I am using jupyter notebook with python3 on windows 10. My computer have 8GB RAM and at least 4GB of my RAM is free. But when I want to make a npArray with size of 6000*6000 with this command: np.zeros((6000, 6000), dtype='float64') I got this : Unable to allocate array with shape (6000, 6000) and data type float64 I dont think it could take more then 100MB RAM. I tried to change the number too see what happens. biggest shape i can make is (5000,5000). Do i made a mistake in estimate of RAM i

pygal charts not displaying tooltips in Jupyter / IPython notebook

冷暖自知 提交于 2020-01-23 12:56:34
问题 After much research, I finally managed to get tooltips working in pygal thus: Config = pygal.Config() Config.js = ['http://kozea.github.io/pygal.js/2.0.x/pygal-tooltips.js'] bar_chart = pygal.Bar(Config) # Then create a bar graph object bar_chart.add('Fibonacci', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]) # Add some values bar_chart.render_to_file('bar_chart.svg', force_uri_protocol='https') In the produced .svg, tooltips are now working nicely, but only when the file is opened in a browser .

Julia DataFrame output functions

喜欢而已 提交于 2020-01-23 07:58:46
问题 What Julia functions can output a DataFrame so it is converted into text other than the ones shown below? using DataFrames A = DataFrame(randn(10, 7)); print("\n\n\n", "A = DataFrame(randn(10, 7))") print("\n\n\n","print(A)\n") print(A) print("\n\n\n","show(A)\n") show(A) print("\n\n\n","show(A, true)\n") show(A, true) print("\n\n\n","show(A, false)\n") show(A, false) print("\n\n\n","showall(A)\n") showall(A) print("\n\n\n","showall(A, true)\n") showall(A, true) print("\n\n\n","showall(A,

Julia DataFrame output functions

旧巷老猫 提交于 2020-01-23 07:56:48
问题 What Julia functions can output a DataFrame so it is converted into text other than the ones shown below? using DataFrames A = DataFrame(randn(10, 7)); print("\n\n\n", "A = DataFrame(randn(10, 7))") print("\n\n\n","print(A)\n") print(A) print("\n\n\n","show(A)\n") show(A) print("\n\n\n","show(A, true)\n") show(A, true) print("\n\n\n","show(A, false)\n") show(A, false) print("\n\n\n","showall(A)\n") showall(A) print("\n\n\n","showall(A, true)\n") showall(A, true) print("\n\n\n","showall(A,

Get Jupyter notebook to display matplotlib figures in real-time

纵然是瞬间 提交于 2020-01-23 06:12:50
问题 I have a long running Python loop (used for machine learning), which periodically prints output and displays figures (using matplotlib). When run in Jupyter Notebook, all the text (stdout) is displayed in real-time, but the figures are all queued and not displayed until the entire loop is done. I'd like to see the figures in real-time, on each iteration of the loop. During cell execution, not when the entire cell execution is done. For example, if my code is: for i in range(10): print(i) show

Get Jupyter notebook to display matplotlib figures in real-time

前提是你 提交于 2020-01-23 06:12:30
问题 I have a long running Python loop (used for machine learning), which periodically prints output and displays figures (using matplotlib). When run in Jupyter Notebook, all the text (stdout) is displayed in real-time, but the figures are all queued and not displayed until the entire loop is done. I'd like to see the figures in real-time, on each iteration of the loop. During cell execution, not when the entire cell execution is done. For example, if my code is: for i in range(10): print(i) show

XGBoost crashing kernel in jupyter notebook

∥☆過路亽.° 提交于 2020-01-23 03:07:13
问题 I don't know how to make the XGBoost classifier work. I am running the code below on jupyter notebook, and it always generates this message "The kernel appears to have died. It will restart automatically." from xgboost import XGBClassifier model = XGBClassifier() model.fit(X, y) There is no problem with importing the XGBClassifier, but it crashes upon fitting it to my data. X is a 502 by 33 all-numeric dataframe, y is the set of 0 or 1 labels for each row. Does anyone know what could be the

Embed widgets with jupyter-cadquery (threejs): wrong position on load

白昼怎懂夜的黑 提交于 2020-01-22 18:57:25
问题 I am using jupyter-cadquery to visualize some 3D models made with CadQuery. When visualizing the models on a Jupyter notebook, everything works as expected. But when trying to embed the widget in an HTML document, it seems the camera, on load, is pointing to (0, 0, 0) , not as expected. Once you interact with the widget, the camera will point to the expected coordinate. Here is the code to reproduce the error and an animation of the mentioned problem (see instructions bellow on how to

Jupyter Notebook (only) Memory Error, same code run in a conventional .py and works

北慕城南 提交于 2020-01-22 14:06:09
问题 I have an assignment for a Deep Learning class, and they provide a Jupyter notebook as a base code, the thing is that after running the data import and reshape, jupyter notebook through a "Memory Error", after some analysis y tried to compile the same code in a normal .py file, and everything runs well. The thing is that I'm required (preferably) to use the Jupyter notebook as the base for development, since is more interactive for the kind of task. <ipython-input-2-846f80a40ce2> in <module>(