Hot answers tagged

23

CoCalc provides Jupyter notebooks with realtime collaboration, unlike Colab, Kaggle, etc. You just make a project drag and drop ipynb and data files, add collaborators, and everybody can edit everything simultaneously. You can also share content publicly at the share server. I think CoCalc is currently the overall most mature of the realtime Jupyter ...


18

See: Graphviz's executables are not found (Python 3.4) and graphviz package doesn't add executable to PATH on windows #1666 and Problem with graphviz #1357 - it's a reoccurring problem (for that program) with the PATH environment variable settings. Installing particular versions, or in a particular order, or manually adding a PATH fixes the problem. It's ...


15

fillna fills the NaN values with a given number with which you want to substitute. It gives you an option to fill according to the index of rows of a pd.DataFrame or on the name of the columns in the form of a python dict. But interpolate is a god in filling. It gives you the flexibility to fill the missing values with many kinds of interpolations between ...


15

There are several collaboration platforms with hosted notebooks that can be shared like: Google Colab Kaggle Kernels Deepnote Binder Curvenote Etc. However the base idea of collaborating and sharing notebooks is actually a base function of jupyter. As you might have noticed it is a server-hosted application which by default opens a local server for you to ...


10

There is an awesome library called MPLD3 that generates interactive D3 plots. This code produces an HTML interactive plot of the popular iris dataset that is compatible with Jupyter Notebook. When the paintbrush is selected, it allows you to select a subset of data to be highlighted among all of the plots. When the cross-arrow is selected, it allows you to ...


10

You can do: Open the jupyter notebook you want to run. Click on: Raw Save Ctrl+S Remove: .txt Now navigate to the directory where notebook is downloaded in jupyter notebook and open it.


8

There is an option to convert the notebook to HTML. If the non programmer just have to view the notebook, do that then upload it in google drive or any website or you can share it even through mail. I do this every time when I want to present using a Jupyter notebook so that it will be supported on any system.


7

GitHub has built in support for showing a notebook. You will just need to run the notebook yourself, then upload the file to Github like all other file types. Your viewer will be able to see your notebook without any installation.


6

Welcome to DataScience.SE! This is not currently possible. You could change the cells to Raw.


6

In my case I am able to find graphviz executables manually in anaconda3\Library\bin\graphviz, but I still would get the GraphViz's Executables not found error. I have unsuccessfully tried zhangqianyuan's suggestion as well as specific orders of module installation and using python-graphviz (official solution, widely discussed here). Only thing I didn't try ...


6

Try this: jupyter nbconvert --to pdf --TemplateExporter.exclude_input=True my_notebook.ipynb This also works for html output. You will find the documentation for this and other options here. FYI, for complex notebooks, this may generate errors depending on your version of nbconvert, LaTeX and other components. In that case try to convert to html then print ...


5

Have a look at IPyWidgets. I've used it to create interactive dashboards in IPython/Jupyter. It's very concise and powerful. You define a function: def f(x): return x And you connect it to a widget using the Interact() function. interact(f, x=10); This generates a widget (a slider in this case) automatically and updates your function with new input when ...


5

If the tutorial is a GitHub repo, sure. Clone the repository. Run jupyter-notebook and open the notebook there.


4

Try something like this: import matplotlib.pyplot as plt plt.figure(figsize=(30, 20)) # the size you want # your code goes here


4

If it's important for your use cases, you could try switching to Apache Zeppelin. As all Spark notebooks there share the same Spark context, same Python running environment. https://zeppelin.apache.org/ So what you're asking happens natively in Zeppelin. Or to be complete, it is an option to share the same Spark context / same Python envrionment between ...


4

Try 32-bit Chrome or Firefox, it may significantly lower memory usage. Remember, it is surprisingly difficult to estimate physical memory consumption of given app: https://dzone.com/articles/windows-process-memory-usage-demystified Also - unused RAM is wasted RAM. Do not blame browser for taking and using, what's available. When overall memory usage will ...


4

What can I do with this information? You can do a lot of things with this data. You can visualize it, you can use the vectors for prediction or regression, whatever the task at hand. However, there are a few restrictions of PCA that you need to keep in mind. For eg. its very memory intensive, so you need to have a "lot" of RAM to use PCA on certain data-...


4

Found a way to get Miniconda working in Google colab. For now, use source activate, not conda activate in the 2nd cell. Still working out the bugs with using conda to activate. Full Notebook demo here: https://donaldsrepo.github.io/Notebooks/GoogleColabCondaCreateEnv.html github with demo notebook: https://github.com/donaldsrepo/SampleNotebooks/blob/master/...


3

You can register a new cell magic, for example: from IPython.core.magic import register_cell_magic @register_cell_magic def run_and_save(line, cell): 'Run and save python code block to a file' with open(line, 'wt') as fd: fd.write(cell) code = compile(cell, line, 'exec') exec(code, globals()) Now, you can use the run_and_save magic: %...


3

Plotly is by far the best interactive visualization library/platform I have used, and it works very well with IPython/Jupyter too. There are tutorials on Plotly's docs which help you integrate it with Jupyter. Another tutorial.


3

I would prefer this to be a comment instead of an answer, as my intention is not to plug/advertise, but I am currently working on my thesis which may be of interest to you as it kind of does what you want. In reality it is a clustering visualization tool, but if you use k-means with k=1 you have an interactive plot where you can search for terms, select an ...


3

Assuming the rest of your configuration is correct all you have to do is to make spark-csv jar available to your program. There are a few ways you can achieve this: manually download required jars including spark-csv and csv parser (for example org.apache.commons.commons-csv) and put them somewhere on the CLASSPATH. using --packages option (use Scala ...


3

One option is to strip the output from the .ipynb file. Then the git diff would only track the cell data. One package that strips the output Jupyter Notebook is nbstripout.


3

MemoryError is exactly what it means, you have run out of memory in your RAM for your code to execute. When this error occurs it is likely because you have loaded the entire data into memory. For large datasets you will want to use batch processing. Instead of loading your entire dataset into memory you should keep your data in your hard drive and access ...


3

This is a tool that I came across to run Jupyter notebooks: Binder. You just need to input the repo you are looking at, the branch and the path. Then you can interactively run the notebook. The notebook gets hosted by the website, so you don't need to worry about computing power on your machine or installing all the required packages.


3

First try this: conda remove {failing_packages} conda install {failing_packages} Where {failing_packages} is/are the package(s) for which an error is reported. If that fails, you could try forcing an over-install (this solution is very handy and will likely fix many issues): conda install -f {failing_packages} So, for example, for the original poster of ...


3

TL;DR GPU runs faster than CPU (31.8ms < 422ms). Your results basically say: "The average run time of your CPU statement is 422ms and the average run time of your GPU statement is 31.8ms". The second experiment runs 1000 times because you didn't specify it at all. If you check the documentation, it says: -n: execute the given statement times ...


3

Using a notebook, you can always convert it to a python script if you just go to "File > Download as > Python (.py)". Then, you can share it with your teammates and have handwritten comments on a printed form of it, regardless of how unusual this practice sounds.


3

According to the scikit-learn model persistence docs, it may be better to use joblib instead: Save model from joblib import dump dump(model, 'filename.joblib') Load model from joblib import load model = load('filename.joblib')


Only top voted, non community-wiki answers of a minimum length are eligible