I vaguely recall seeing split cells in jupyter notebook. I think this was done via changing the cell style to split. However, I can't find anything in jupyterlab that seems to do that. What I am trying to look for is the functionality to split one cell so that I can easily have a table and a chart next to each other.
Is that possible?
First install nbextensions:
conda install -c conda-forge jupyter_contrib_nbextensions
conda install -c conda-forge jupyter_nbextensions_configurator
Turn on 'split Cells Notebook in the configurator (see picture)
nbextension configurator
3. Use the addon inside the notebook to split a cell:
Inside the notebook
Just a work-around.
Create another untitled notebook.
separate original and new notebooks view in half.
move the desired cells to other notebook.
(you don't have to execute cells , just copy and paste in other notebook).
Related
Is there a way to select ALL the cells below the cursor (or above) in Jupyter Notebook with one command (not doing it one-by-one).
It may not be possible in Jupyter Notebook, but it is possible in JupyterLab using Shift + End, so by extension you can use it in RetroLab which is a Jupyter Notebook layout recreation using JupyterLab components.
Alternatively you can Select the given cell, then scroll to the bottom of your notebook and Shift + Select the last cell. This will select all cells in between.
How to freeze the top row in an Excel using WIN32COM python package? Searched almost everywhere, but could find examples with other packages, but not with "from win32com.client.gencache import EnsureDispatch" this one.
from win32com.client.gencache import EnsureDispatch
excel = EnsureDispatch('Excel.Application')
excel.Cells.Range("A2").Select()
excel.ActiveWorkbook.Windows(1).FreezePanes = True
This will freeze all rows above, and all columns to the left of A2
keyDown(shift) function is not working for Python pyautogui for Excel Automation
When I have to copy all values from above cell in Excel
Here is my code
import pyautogui
pyautogui.keyDown('shift')
pyautogui.hotkey('right','right','ctrl','up')
pyautogui.keyUp('shift')
pyautogui.hotkey('ctrl','d')
The only solution I found that can solve this issue is:
pyautogui.keyDown('shiftleft')
pyautogui.keyDown('shiftright')
pyautogui.hotkey('right','right','ctrl','up')
pyautogui.keyUp('shiftleft')
pyautogui.keyUp('shiftright')
So, you have to make left and right shifts down at the same time to activate this feature which is wired.
How can I avoid reloading data each time when I want to check if my script works? I work with spyder and python.
I have to load around 1000 .csv files, it takes just a few seconds but it is unnecessary to repeat this step each time I change a parameter or a name somewhere else in the code.
One simple option is to comment a part of code. What would be a more efficient way?
(Spyder maintainer here) You can use cells in Spyder, which are blocks of code delimited by comments of the form #%%. You can evaluate cells with keyboard shortcuts Shift+Enter (run and advance to the next cell) or Ctrl+Enter (run and stay in the same cell).
This way you can have a cell to load your files and then another cell to do you computations with them, like this
#%%
data = load_my_files('my-dir')
#%%
compute(data)
I'm curious if there is a possibility to insert an image (for example produced by Matplotlib) into an Excel sheet using xlwings. I've seen some tips regarding handling charts, but not images. If not, then I guess it's worth trying pywin32?
I'm using xlwings 0.19.5
sht.pictures.add(fig,name='Chart',left='A1',top='A1')
Should work to add a picture to Excel. Change fig to your image.