ipython

How to update the packages in ipython like jupyter & spyder

廉价感情. 提交于 2021-02-10 12:25:13
问题 I wrote this !pip install seaborn to install the updated version of seaborn, then the system shows a warning that then I wrote this pip install --upgrade pip trying to update the pip, it shows that Instead of running it in ipython, where should i run this code? How could I update package in ipython like jupyter? 回答1: You just forgot put the ! before pip install --upgrade pip . Do this: !pip install --upgrade pip See this for more information, if you are using conda: https://jakevdp.github.io

IPython - cycle through blocks in input history?

送分小仙女□ 提交于 2021-02-10 07:12:40
问题 Say I input the following: def foo(): print(2) Then later, when I want to edit my function, I press the Up arrow key to rewrite it, and that cycles through my inputs one line at a time (i.e. first it shows print(2) , then def foo(): ). Is there any way to make it cycle through blocks of code the way IDLE does it? 回答1: I have this problem with an earlier version of iPython on Linux (11 I think). New versions do not do this. I currently still use 11, and my solution was to just use the iPython

IPython - cycle through blocks in input history?

左心房为你撑大大i 提交于 2021-02-10 07:01:05
问题 Say I input the following: def foo(): print(2) Then later, when I want to edit my function, I press the Up arrow key to rewrite it, and that cycles through my inputs one line at a time (i.e. first it shows print(2) , then def foo(): ). Is there any way to make it cycle through blocks of code the way IDLE does it? 回答1: I have this problem with an earlier version of iPython on Linux (11 I think). New versions do not do this. I currently still use 11, and my solution was to just use the iPython

No module named 'dolfin' using Spyder

有些话、适合烂在心里 提交于 2021-02-09 07:23:24
问题 I can't, for the life of me, get dolfin running with Spyder . That's what I thought at first. I managed to get it running somehow, but not in a convenient way. Here is the situation: The error conda activate fenics , spyder , from dolfin import * : No module named 'dolfin' . What works conda activate fenics , python , from dolfin import * : worked in the first place. conda activate fenics , ipython , from dolfin import * : worked after some tweaking. conda activate fenics , spyder , from

Save iPython Jupyter Notebook Widgets to PNG/PDF/JPG/GIF

怎甘沉沦 提交于 2021-02-08 19:50:15
问题 I was just wondering, if there's some way how to automatically save the content of the cell (including the cell output) to a PNG/PDF/JPG/GIF. I'd be happy with any of the alternatives. For documentation purposes I'd like to save the state of a VBox/Hbox containing multiple iPython Widgets. There are many possible combinations of the widgets settings, I can iterate over these settings with my code, but I'd like the corresponding visual setting of the widgets to any of the possible above

iPython: cannot import module named sklearn

扶醉桌前 提交于 2021-02-08 13:37:09
问题 I am able to import sklearn using the python interpreter, but when I try to do the same in an iPython notebook, iPython throws an ImportError. Any idea what is causing this issue? I need to use a module in iPython. I'm not sure if this will be helpful, but here is a subset of the packages that I have installed on my machine. I followed the instructions here regarding the installation process: http://shanshanchen.com/2013/05/29/install-numpy-scipy-scikit-learn-on-mac-os-x-for-data-miners/ 回答1:

Spyder 4 is not displaying plots and displays message like this 'uncheck “Mute Inline Plotting” under the Plots pane options menu.'

孤者浪人 提交于 2021-02-08 13:27:30
问题 I wrote this code. It should display the plots in spyder ide. import pandas as pd import numpy as np import matplotlib.pyplot as plt from IPython.display import display from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_absolute_error import scipy.signal import scipy.stats from sklearn.model_selection import train_test_split train = pd.read_csv("train.csv", nrows=9000000,dtype={'acoustic_data':np.int16,'time_to_failure':np.float64}) train.rename({"acoustic

Using grep from python console

流过昼夜 提交于 2021-02-08 08:59:26
问题 Using python how can I make this happen? python_shell$> print myPhone.print_call_log() | grep 555 The only thing close that I've seen is using "ipython console", assigning output to a variable, and then using a .grep() function on that variable. This is not really what I'm after. I want pipes and grepping on anything in the output (including errors/info). 回答1: Python's interactive REPL doesn't have grep , nor process pipelines, since it's not a Unix shell. You need to work with Python objects

Using grep from python console

给你一囗甜甜゛ 提交于 2021-02-08 08:59:17
问题 Using python how can I make this happen? python_shell$> print myPhone.print_call_log() | grep 555 The only thing close that I've seen is using "ipython console", assigning output to a variable, and then using a .grep() function on that variable. This is not really what I'm after. I want pipes and grepping on anything in the output (including errors/info). 回答1: Python's interactive REPL doesn't have grep , nor process pipelines, since it's not a Unix shell. You need to work with Python objects

Updating R that is used within IPython/ Jupyter

僤鯓⒐⒋嵵緔 提交于 2021-02-07 19:41:31
问题 I wanted to use R within Jupyter Notebook so I installed via R Essentials (see: https://www.continuum.io/blog/developer/jupyter-and-conda-r). The version that got installed is the following: R.Version() Out[2]: $platform "x86_64-w64-mingw32" $arch "x86_64" $os "mingw32" $system "x86_64, mingw32" $status "" $major "3" $minor "1.3" $year "2015" $month "03" $day "09" $svn rev "67962" $language "R" $version.string "R version 3.1.3 (2015-03-09)" $nickname "Smooth Sidewalk" I have attempted to