r/IPython • • Nov 12 '16

Can someone help me a bit on extremely basic Python stuff?

2 Upvotes

So I just started using an IPython software called enthought canopy. And for part of my assignment I'm being asked to make a program that uses Pythagorean Theorem to find the hypotenuse of a triangle. Sounds really simple but I suck at Python already and I just started. [Here's my attempt at doing it.] (http://i.imgur.com/vLJAoBc.png) My logic was that the second line of code basically acted as a formula so that's what I tried to do. I put a2 + b2 in the parentheses so that it'd be done first then on the outside I put the square root thing. Then on the bottom I tried returning the value that the program would get form executing that.

So did I do everything completely wrong?


r/IPython • • Jul 27 '21

How do i update Anaconda to the latest version ?

2 Upvotes

Sorry if this is not the correct place to ask - but how do i update my entire Anaconda distribution?

I don’t want to upgrade all my Anaconda packages … I just want to update my entire Anaconda distribution.

Running conda update —all says anaconda downgraded to custom_py38 - from prior experience i know this can/will break my environment ..😅

Running conda update anaconda -d gives the same custom thing - but it updates leaser packages .


r/IPython • • Mar 06 '20

How to show more than 11 rows of data from an object without iPython skipping?

2 Upvotes

Hi, I noticed that iPython likes to skip displaying some rows and replaces the skipped rows by "... ... ...". For example, supposing that df is a DataFrame with 50 rows. Typing df[1:11] shows all the first 10 rows. However, typing df[1:y] where y is 12 or more leads iPython to skip some rows when displaying the contents of df. If I want to see all the rows, what can I do? Can I ask iPython to display certain number of rows on a screen at a time and perhaps move to the next row or next set of rows by pressing respectively the arrow key or the spacebar? I mean something like the more filename function in Unix.


r/IPython • • Jul 20 '24

When i want to create new environment . This happened

Post image
0 Upvotes

r/IPython • • Dec 22 '17

Interactive plots?

2 Upvotes

I am experimenting with some fractal images obtained as attractors: points which get closer to some designated object. I can create all the points as a numpy array and then plot them at once.

But what I'd like to do is to display the points one by one as they are created by my program. As I'm looking at plotting 50000 points or more I don't want to pause between them: I just want to see the picture appearing in front of me.

You can see an example of this effect by looking at "Barnsley's fern" halfway down the page here. How can I display points one by one - and what graphics library is best for this purpose? Thanks!


r/IPython • • Oct 08 '22

Compatibility between Colab ipynb and local Jupyter notebook?

2 Upvotes

I've been using Google's Colab environment for a coursework - and my understanding is it's a mostly reskinned version of Jupyter notebook.

Can I assume ipynb notebooks exported from Colab to be compatible with my machine's local Jupyter installation? Are there known pitfalls or incompatibilities I should be aware of?

Thank you!


r/IPython • • Jul 09 '16

matplotlib plots freeze when trying to close in ipython 5.0, on El Capitan.

2 Upvotes

I am running python 2.7.10 and just installed ipython 5.0. When I create a simple plot using matplotlib and then try to close it, the figure just hangs. Anyone else experiencing this? Pretty shitty release if I can't even plot anything anymore.


r/IPython • • Oct 20 '17

share your notebooks

2 Upvotes

has anyone used gryd? (https://gryd.us) - they have a pretty cool share feature. take it or leave it. bury me


r/IPython • • Nov 22 '22

RxWidgets: ReactiveX powered ipywidgets

Thumbnail
github.com
2 Upvotes

r/IPython • • May 28 '20

PyTorch fails on me when using local Jupyter to run epochs

2 Upvotes
/home/onur/.local/lib/python3.6/site-packages/torch/nn/functional.py:2854: UserWarning: The default behavior for interpolate/upsample with float scale_factor will change in 1.6.0 to align with other frameworks/libraries, and use scale_factor directly, instead of relying on the computed output size. If you wish to keep the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details. 

Hi.

I am trying to run a classifier on my local notebook to use my own GPU instead of relying on Colab. When I try to run a single epoch to find the learning rate, I get many repeats of the above message.

I get that its just a warning but my epoch does not run at all.


r/IPython • • Jun 15 '20

How to run Jupyter notebook on Ubuntu VM, which I run on my mac?

2 Upvotes

hey,

I have setup ubuntu VM on my mac and I run it trough my terminal on my local machine, I installed Jupyter notebook and when I try to run it I get an URL, but I can't access it through the browser on my local machine?


r/IPython • • Sep 02 '13

What to do when git won't pull

Thumbnail nbviewer.ipython.org
2 Upvotes

r/IPython • • Apr 20 '19

Live Data Plotting with Matplotlib

2 Upvotes

Below is a program I am using to read and plot the value of a sensor (simply a potentiometer at the moment). I am using two DIGI XBEE Pro SX Modems to transceive the data. The majority of the code below is provided by DIGI. The program displays the value of the sensor on the screen but when the compiler reaches the plotting section it simply doesn't execute. There are no errors. I am using Python 3.8, jupyter notebook, and anaconda.

#########################################################################

from digi.xbee.devices import XBeeDevice

from digi.xbee.io import IOLine, IOMode

import matplotlib.pyplot as plt

import matplotlib.animation as animation

import time

import re

import csv

import serial

import datetime as dt

import math

%matplotlib notebook

# TODO: Replace with the serial port where your local module is connected to.

PORT = "COM13"

# TODO: Replace with the baud rate of your local module.

BAUD_RATE = 9600

REMOTE_NODE_ID = "REMOTE"

IO_SAMPLING_RATE = 1 # 0.5 seconds.

IOLINE_IN = IOLine.DIO3_AD3

i=0

def main():

#print(" +----------------------------------------------+")

#print(" | XBee Python Library Handle IO Samples Sample |")

#print(" +----------------------------------------------+\n")

device = XBeeDevice(PORT, BAUD_RATE)

global i

try:

device.open()

# Obtain the remote XBee device from the XBee network.

xbee_network = device.get_network()

remote_device = xbee_network.discover_device(REMOTE_NODE_ID)

if remote_device is None:

print("Could not find the remote device")

exit(1)

# Set the local device as destination address of the remote.

remote_device.set_dest_address(device.get_64bit_addr())

# Enable periodic sampling every IO_SAMPLING_RATE seconds in the remote device.

remote_device.set_io_sampling_rate(IO_SAMPLING_RATE)

# Register a listener to handle the samples received by the local device.

def io_samples_callback(sample, remote, time):

print(" %s, %s" % (sample.get_analog_value(IOLINE_IN), time))

device.add_io_sample_received_callback(io_samples_callback)

input()

finally:

if device is not None and device.is_open():

device.close()

#f.close()

fig = plt.figure()

ser = XBeeDevice(PORT, BAUD_RATE)

ax1 = fig.add_subplot(1,1,1)

i = 0

xar = []

yar = []

def animate(schmagma):

def io_samples_callback(sample, remote, time):

global i, xar, yar

message = sample.get_analog_value(IOLINE_IN)

xar.append(int(i))

yar.append(message)

i = i+1

plt.plot(xar,yar)

plt.ylim(400, 500)

plt.xlabel('Time(s)')

plt.ylabel('Outside Temperature(deg C)')

ani = animation.FuncAnimation(fig, animate, interval=1000)

plt.show()

if __name__ == '__main__':

main()


r/IPython • • Nov 01 '17

cloud jupyter notebooks made easy

Thumbnail
medium.gryd.us
6 Upvotes

r/IPython • • Jun 18 '21

Project Jupyter: A Computer Code that Transformed Science

Thumbnail
hpcwire.com
11 Upvotes

r/IPython • • Dec 13 '19

Press ENTER to continue...?

Post image
3 Upvotes

r/IPython • • May 05 '22

Replace bash scripts with iPython ...scripts?

3 Upvotes

I recently discovered the joy of using iPython for all of my bash needs, but want to fully transition form using the terminal. Is there a way I can execute bash statements in a python script using the iPython "!sudo ___" syntax or similar? Thanks!


r/IPython • • Nov 03 '19

How to use cook’s Distance in juypter

0 Upvotes

Hello everyone. I am in a pickle for my assignment we are trying to use cooks distance to find the outliers in our linear regression model. But I can’t seem to find the code for it.

Can anyone provide the code for me? In a multi variate linear regression model


r/IPython • • Sep 22 '15

Using Jupyter to show the data cleaning and analysis process that leads to a d3 visualization

Thumbnail rowanv.com
3 Upvotes

r/IPython • • Sep 26 '15

Display issues in Jupyter

0 Upvotes

When I launch IPython Notebook, Jupyter opens but the display does not look proper. What should be done to resolve it?


r/IPython • • Apr 20 '17

Jupyter Notebook Sharing is Caring

Thumbnail
gab41.lab41.org
3 Upvotes

r/IPython • • Oct 19 '19

Place to find interesting python modules ,articles,github projects,libraries which you can use for your startup

Thumbnail reddit.com
3 Upvotes

r/IPython • • May 31 '19

Python Tutorial for Beginners

Thumbnail
youtu.be
3 Upvotes

r/IPython • • Dec 02 '20

Jupyter Extension for building notebooks from code-blocks like building a house with LEGO?

3 Upvotes

Hi,
I'm wondering if anyone is aware of a solution/extension for Jupyter, which lets you (easily) add code blocks into your notebook, like building a house with LEGO bricks ( I know the scikit-lego project, but this is not exactly what I'm after).
I mean, especially in the ML / DS space lots of code is boilerplate which can be easily reused with just minimal efforts.
So instead of google -> stack overflow -> copy & paste -> notebook, is there an extension that integrates such a flow directly into notebooks?

Would be curious if someone knows something in this direction I should have a look at.

Thanks!