61408

IPython Notebook previous cell content

Is it possible in an IPython-Notebook cell to get the previous (above) cell content ?

I can see previous output with %capture magic function but I don't find how to get the previous cell content.

Answer1:

I didn't find how to get the previous content cell in a cell.

But I found another solution, creating a custom magic notebook function to capture the cell content and work with that.

Answer2:

You can get content of the last executed cell with:

In[len(In)-2]

Recommend

  • Button commands in Tkinter
  • Adding custom gesture to iCarousel items
  • Create a JSON file from a Flask view to be used with D3
  • Why can't I import statsmodels directly?
  • Can't install scipy
  • iPython Notebook not printing Dataframe as table
  • PE file - what's missing?
  • iPhone: 5 seconds video capture
  • Printing out Japanese (Chinese) characters
  • Passing a Scala type to a function
  • Pass nested C++ vector as built-in style multi-dimensional array
  • How to set a thread specific environment variable in Python?
  • Ruby: FileUtils.cp truncates file; FileUtils.mv it does not?
  • Python adding lots of things to PATH. How do I stop?
  • Center align outputs in ipython notebook
  • Android application: how to use the camera and grab the image bytes?
  • custom UITableViewCell with image for highlighting
  • Ionic 2 storage is not cleaning up on uninstall - Only for signed APK
  • preg_replace Double Spaces to tab (\\t) at the beginning of a line
  • Ajax jQuery multiple calls at the same time - long wait for answer and not able to cancel
  • DotNetZip - Calculate final zip size before calling Save(stream)
  • Sending data from AppleScript to FileMaker records
  • Deserializing XML into class C#
  • vba code to select only visible cells in specific column except heading
  • Updated Ionic CLI but shows previous version (Windows)
  • Do create extension work in single-user mode in postgres?
  • Function pointer “assignment from incompatible pointer type” only when using vararg ellipsis
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • R: gsub and capture
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • Comma separated Values
  • Load html files in TinyMce
  • Free memory of cv::Mat loaded using FileStorage API
  • python draw pie shapes with colour filled
  • Binding checkboxes to object values in AngularJs
  • How to Embed XSL into XML
  • Conditional In-Line CSS for IE and Others?
  • Net Present Value in Excel for Grouped Recurring CF
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize
  • How to load view controller without button in storyboard?