Python Definition and 661 Threads

PYTHON was a Cold War contingency plan of the British Government for the continuity of government in the event of nuclear war.

View More On Wikipedia.org
  1. NATURE.M

    Python Logistic regression: Stochastic Gradient Ascent (in python)

    So I've been following through a online course in machine learning offered by Stanford university. I have been recently reading up on logistic regression and stochastic gradient ascent. Here is a link to the original notes: http://cs229.stanford.edu/notes/cs229-notes1.pdf (pages 16-19). Here...
  2. cpscdave

    Python [Python] Function pointers & array of objects

    Maybe I am going about this the wrong way. I'm trying to build a form to display & update information in a object. The objects are stored in an array since I'll have 1-N of them. What I've done now is created an array of dictonaries which hold the information about the form fields, it...
  3. nomadreid

    Python Python for Dummies: what does scipy.inf really do?

    First, I am not even sure this is the right forum for this question, so if anyone wants to switch it to a more appropriate one, I would be grateful. Secondly, the question here is on one specific point of Python from a mathematical point of view. I neither know nor am learning how to program...
  4. I

    Python Verlet alghoritm and Lennard Jones simulation in Python

    Hello, I created script which draw plot of Lennard Jones potential for two particles. Now i want to create 2D simulation for 10 particles with verlet alghoritm but I have no idea how to create that. My problem is implementation of verlet alghoritm and calculating forces. I implemented boundaries...
  5. fluidistic

    Python [Python] Trying to debug my program

    Hi people, I'm trying to figure out what's wrong with my code. My goal is to calculate the average number of stones it takes so that 2 stones become adjascent on a 19x19 goban (the board of the game of go), when we randomly pick an intersection and place a stone on it. The answer should be...
  6. Shreyas Shree

    Python Make an android app in eclipse using python

    How to make an android app using python on eclipse.
  7. BiGyElLoWhAt

    Python Python Strings: Revising & Altering for AI Programming

    I'm revisiting python, because recently our physics department decided to adopt it as our computational language, and I missed the class. I've also been given the impression that it's a very good language for algorithms and what-not. According to...
  8. cpscdave

    Python How Do You Include Header Files in Python?

    In c I quite often build header files with a bunch of predefined data. Fill it with structures or what not. Then to include that information in my program its a simple #include "myHeader.h" Is there a way I can do this in python? I've created another file "myHeader.py" Have put in some code to...
  9. S

    Python How can I plot the Voigt Profile function with varying values of a in Python?

    I very new to python and this might look relatively easy to some of you. I need to write a code so that H(a,u) = \frac{a}{\pi} \int_{-\infty}^{\infty} \frac{e^{-y^2}}{a^2+(u-y)^2}dy it plots the above function for different values of the a parameter, so that ultimately i will have a graph of...
  10. D

    Python [Python] Importing csv files and creating numpy arrays

    So I am fairly new to Python and feel somewhat comfortable with it. I am trying to do something what I think seems kind of simple however am not too experienced with loading files into Python (or any programming language for that matter). What I am trying to do is I have csv files that contain...
  11. A

    Python Python program to sort negative numbers and even numbers?

    Homework Statement I have to make a program that would end when entered a 0 and print out negative numbers and even numbers separately but what I have so far is not working. The Attempt at a Solution numbers = [] negative_numbers = [] while True: number = input("Enter a number: ")...
  12. B

    Infrared spectroscopy to find water absorption lines

    Hi I am currently trying to find the water absorption lines by using a Michelson interferometer, as a detector I am using an ocean spectrometer. The data obtained is thus the spectrum's "received" by the spectrometer. Am I right to assume that in order to find the absorption peak/peaks I should...
  13. M

    Python Python, solving Schrodinger equation using Runge-Kutta

    Homework Statement I'm currently working on a project in which I have to solve the energy eigenvalues of the Schrodinger equation to compute the mass of certain Mesons. We've been taught very little programming (so apologies that my understanding is very basic), and are therefore given any...
  14. A

    How to change a two-dimensional array print into normal?

    Homework Statement I made a two-dimensional array program, but now I need some help to alter the program in the print zone. The Attempt at a Solution import sys students = [] grades = [] while True: student = input ("Enter a name: ").replace(" ","") if...
  15. A

    Python Python: How to show entered input results when entering a 0

    Homework Statement So, I have a program, which I am finishing but I apparently ran into a problem. In the program I have to make that whenever I enter a 0 in the input, the program will stop and print the results. Here's the program before I continue saying anything else: The Attempt at a...
  16. sk1105

    Python [Python] Custom tick marks in matplotlib

    I've looked around for this and so far haven't found anything close enough to what I'm after. In matplotlib, I want to get a specific tick on the x-axis to label a particular value. I know how to use axvline to get a vertical line marking that point, which is good, and I know how to add...
  17. A

    Python Python: how to break two times to results

    Homework Statement I need a program, which would break and show results once a 0 is entered in input name and input grade. I figured how to do that in name, but how do I add another break? Like grade !="0"? Homework EquationsThe Attempt at a Solution students = [] grades = [] while True...
  18. A

    Python Fix Python Print Problem: Get Student Grade Averages

    Homework Statement I made a program that would some up a grade average. Everything seems fine, the only problem, when I run the program at the end it prints out like this: Jack 5 10 6 7.0 Stacy 10 8 9 9.0 Jack 5 10 6 7.0 Stacy 10 8 9 9.0 Jack 5 10 6 7.0 Stacy 10 8 9 9.0 How can I make the...
  19. A

    Python How to continue this Python program?

    Homework Statement I need a program where the program needs to ask me a name of a student and then a grade. 1) The program needs to end if a 0 is entered. 2) If the name has a number in it, the program should ask the user to enter another name. 3) After the name is correctly entered the program...
  20. A

    Asking a user for a correct input until they give a correct response

    Homework Statement I need a program (in PYTHON), which would ask a user his name and grade, then print them both. 1) If the name has a number it, the program has to ask the same question again until the name is entered correctly 2) The same with the grade. If it's higher than 10, the program...
  21. Avatrin

    Python Animating wave packet with Python

    Homework Statement So, I start off with initial condition: \psi(x,0) = e^{\frac{-(x-x_0)^2}{4a^2}}e^{ilx} This wavepacket is going to move from x_0 = -5pm towards a potential barrier which is 1 MeV from x = 0 to x = 0.25 pm, and 0 everywhere else. a = 1 pm l = 2 pm-1 Homework Equations I...
  22. A

    Python Python checking numbers in a given name

    Homework Statement I need to write a Python program, which would: 1) Ask for a name (input function) 2) Keep asking for the name if it is not entered correctly(if it has a digit in it) 3) If the name is entered correctly it will print the name Homework Equations How should I continue the...
  23. P

    Python What is a Eye Diagram - create it in Python

    I am self learning Python and developing Communication signals concept by coding programs. But I am not sure how to develop Eye Diagram code in Python - cause I do not know the formulas / concept to do so - say I have a signal bits like - 1 1 1 0 0 0 1 1 So what formulas of concept I should...
  24. A

    Python Help with Python Program: Calculate Student Grades & Averages

    I really need help with a big Python program. Our professor has been MIA for the whole term and now we need to submit a program. I thought I was doing and learning fine on my own, but the program simply does not work for me. I need it till Thursday and I am ripping my hair out because I cannot...
  25. sk1105

    Python [Python] Why is my syntax invalid?

    global m_mu = 106.0 global M_Z = 91200.0 global a = 1.0/128.0 global theta_w = asin(sqrt(0.23152)) global g_e = sqrt(4*pi*a) global g_Z = g_e/(cos(theta_w)*sin(theta_w)) I have written this code in Python 2.7 using Enthought Canopy, and each line throws up a syntax error, but I have no idea...
  26. S

    Python Good problems and exercises in C, Python, Ruby and Scala

    I have previously learned C and Python. I'm just starting out with Ruby and Scala. But I need to become more proficient in these languages, so could someone suggest good sources of problems/exercises in each of these languages sources could include websites, books, etc.
  27. NaughtyBear

    Python Programming Question (Python) - Boolean Binary Search

    So I am in my Intro to CS course and they are going over Binary searches via an algorithm to search for simple things. The code goes as this: Set first to 0 Set last to length-1 Set found to FALSE WHILE (first <= last AND NOT found) Set middle to (first+last)/2 IF...
  28. S

    Fitting an ellipse through 3-d data

    Hey, sorry if this is not the right section to post in, the topic is a bit ambiguous. I've generated a set of coordinate points for the orbit of Mercury (3d cartesian) and now I want to fit an ellipse through it so I can get an accurate estimate of the location of the perihelion. I am using...
  29. Alexi-dono

    Python [python] How can I get my OS to pick this up as entropy?

    So I am going to be making some keys; and I want to make them more random... So I made this: #I know that the code is pretty crude, but it works. #P.S. it is an infinite loop, run at your own risk import random from random import randint import string import time x=1 n=randint(5,90)...
  30. Venerable R

    Python Max Distance from which a python detects infrared radiation

    Homework Statement A python can detect thermal radiation with intensity greater than .60 W/m2. A typical human body has a surface area of 1.8 m2, a surface temperature of 30°C, and an emissivity e=0.97 at infrared wavelengths. What is the maximum distance from which a python can detect your...
  31. A

    Python Python help with sequences and elements?

    Homework Statement My professor wants us to program on Python, where we have a certain sequence, for example: sequence = ("one", "two", "three", "four") I need to replace one of the sequence elements (example: "one") with another element (example: instead of the word "one", I need to put...
  32. P

    Python Need Help Learning Python Quickly?

    Do anyone know of a good detailed book or website that would help me learn Python quickly? I have assignments that must be done in Python for one of my physics courses. I'm supposed to know how to do it since last semester but had a greater deal of trouble picking up on it and didn't have much...
  33. DrClaude

    Python Computational physics textbook using python

    I'm looking for a textbook on computational physics based on python. For now I have found Computational Physics with Python by Mark Newman, which I am trying to evaluate. If you have experience with this book or a similar book, I would like to hear from you. (And only if you have knowledge...
  34. G

    Python CATIA Questions about python script

    Hello,ALL Have somebody used python to Instanciate UDF in CATIA ? I have some question with it As follows: Traceback (most recent call last): File "D:/VSProjects/Python/instantiateTemplate/insTemplateDlg.py", line 80, in on_buttonApply_clicked...
  35. Cake

    Python Python 2.7.3 or 3.4.1? Which to Learn for Physics/Math

    I have a book for learning python that teaches it with python3 in mind. I also have been using codecademy.com to learn in a more structured way. The thing is that codecademy teaches python from when the most recent form of python was 2.7.3. Their reasoning behind this is that python3 isn't very...
  36. J

    Need help on designing a conceptual HALE UAV

    Hi everyone, I am a High School student (final year) and am doing an extra-curricular project. Having complete autonomy on what we do the project on, I choose to design a High-Altitude Long-Endurance (HALE) UAV, such as the QinetiQ Zephyr [http://www.airforce-technology.com/projects/zephyr/] or...
  37. Kostas Tzim

    Python Installing Python - Step-by-Step Guide

    Hello, i want to start learning python, but i can't install it after i download python3.4.2 from python's site..then i don't know what to do...it's complicated cause i 've never occupied with programming and it seems hard for me, i'd really appreciate your help
  38. D

    Python Systems simulated by a simple percolation model using python

    I'm a first year physics student, and one of my assignment for my programming class is about percolation. I need to create some disks randomly distributed in an area (this is a 2-D), and then by varying the density of the disk, I need to figure out the percolation threshold such that the two...
  39. W

    Python Python - trajectory of a mass in a gravitational frield

    Homework Statement This is just a project for fun, not homework. I'm writing something in python that takes in an apple's initial position vector and initial velocity vector, and for a given gravitational field due to a planet, returns the next position vector after a small time increment...
  40. M

    Interpolation and linear algebra

    Homework Statement As a string in my program. Homework Equations Solving a system with the forward phase of row echelon reduction and a consecutive back substitution. All done by numpy here. (The book suggested MATLAB, etc). The Attempt at a Solution import numpy """ In a wind tunnel...
  41. C

    Exploring Chaotic Billiards: A Simulation and Analysis

    What am I trying to do? I'm trying to implement a simulation of a chaotic billiard system, following the algorithm in this excerpt. How am I trying it? Using numpy and matplotlib, I implemented the following code What is the problem? When calculating phi_new, the equation has two solutions...
  42. L

    Python How Can I Implement a Three-Variable Advection Equation in Python?

    Homework Statement What I'm trying to achieve is an advection equation that will run using 3 variables. I must confess I don't have a great grasp over this part of my course. Its pretty complicated! Homework Equations The code I have at the moment is: def SolveAdvectionEquation(a, b, t0...
  43. F

    Python Python code using Process class

    Homework Statement I have the following code (please see below). I want it to return [2,4,6,8,10] which is the function evaluated at the given list [1,2,3,4,5]. I want to do this using the process command. My problem is: print A returns [None, None, None, None, None] But I want it to return...
  44. P

    Python Is it possible to simulate gravitational waves using python?

    Hello all, Well, I am on my master project named 'General Relativity & Gravitational Waves'. My supervisor asked me if you can simulate gravitational waves by programming it would be a plus. But only programming language I am currently learning is python. Is it possible to simulate some kind of...
  45. E

    Python How do I run a downloaded python script in github?

    I downloaded a script for python and have no idea how to run it. Do I go into the python GUI or the windows command prompt? Is there any way I can use this in github? Someone told me on another forum said the following. 1. cd /path/to/file 2. python script.py <options here> Which commands do...
  46. J

    Python Model an FPGA FM Radio Demodulator in Python

    I am trying to model an FPGA FM radio demodulator in Python. I will have a mixer that converts an FM channel to 36MHz IF, and I plan on undersampling this IF signal. If in the digital world (my Python model), I have a high sample rate FM signal at 1.2MHz, should I be able to resample to a...
  47. D

    Python Solve Python 3 Question Homework: Ear Infection Diagnosis

    Homework Statement You're going to create some medical diagnoses software. You are going to ask the user if they have a fever, a rash, if they have a stuffy nose, and if their ear hurts, and give one of the following responses: Don't have a fever and don't have a stuffy nose: Hypochondriac...
  48. adjacent

    Python Learning Python & C#: Advice from Real Programmers

    I have am learning python nowadays. I want to learn C# as well. But I fear that I may forget some things of python if I learn C#. I would like to know, from real programmers how you learn all types of programming languages and still remember them. I still haven't learned much python. Just...
  49. adjacent

    Python Increasing the efficiency of a python code.

    Here is a python function to check whether a given list or string contains duplicate values: def has_duplicates(x): t = [] for i in x: if i not in t: t.append(i) if t != list(x): return True else: return False But I am sure this approach will be slow for...
  50. adjacent

    Python [Python] Keeping the session alive

    I am experimenting with capatcha images. I have a capatcha.php in my local host which will generate an image and that image will be put into the form Here is my python code to get the image, extract the text in it and send them back to the form. And finally save the resulting form as html...
Back
Top