Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Breaking a loop in Multiple Random Walks
Post: RE: Breaking a loop in Multiple Random Walks
Cheers man, I removed it cause I saw what I posted was wrong. The While True was there all the time, but printed in bold, so I thought it was part of the #comment. |
|
PythonGainz |
Data Science |
10 |
4,187 |
May-01-2020, 03:04 PM |
|
|
Thread: Breaking a loop in Multiple Random Walks
Post: RE: Breaking a loop in Multiple Random Walks
Oh man... I really think I'm too dumb for Python..... |
|
PythonGainz |
Data Science |
10 |
4,187 |
May-01-2020, 02:31 PM |
|
|
Thread: Breaking a loop in Multiple Random Walks
Post: RE: Breaking a loop in Multiple Random Walks
That's quite some food for thought. Kinda disappointing that textbooks contain code that doesn't really work, though perhaps I'm getting it wrong somewhere else. Thanks for the input, I'll try to figu... |
|
PythonGainz |
Data Science |
10 |
4,187 |
May-01-2020, 09:48 AM |
|
|
Thread: Breaking a loop in Multiple Random Walks
Post: RE: Breaking a loop in Multiple Random Walks
The loop is in the random_walk file. Here is the code:
#Creating a randomwalk() Class
from random import choice
class RandomWalk:
"""A class to generate random walks"""
def __init__(se... |
|
PythonGainz |
Data Science |
10 |
4,187 |
May-01-2020, 06:33 AM |
|
|
Thread: Breaking a loop in Multiple Random Walks
Post: Breaking a loop in Multiple Random Walks
Happy Labor Day everyone!
Currently using Spyder(Python3.7)
I'm following an example from a textbook here:
import matplotlib.pyplot as plt
from random_walk import RandomWalk
#Generating multiple ... |
|
PythonGainz |
Data Science |
10 |
4,187 |
May-01-2020, 06:11 AM |
|
|
Thread: A Dictionary in a Dictionary Syntax
Post: RE: A Dictionary in a Dictionary Syntax
If I only change the keys the single quotes( 'aeinstein' and 'mccurie') I'm still getting an error message in the full_name line though, or do I need to change in other parts of the code? |
|
PythonGainz |
General Coding Help |
3 |
2,166 |
Apr-16-2020, 06:55 AM |
|
|
Thread: A Dictionary in a Dictionary Syntax
Post: A Dictionary in a Dictionary Syntax
I'm getting a syntax error for the following code that I copied form a text book:
Code:
users = {
"aeinstein": {
"first": "albert",
"last": "einstein",
"location": "princ... |
|
PythonGainz |
General Coding Help |
3 |
2,166 |
Apr-16-2020, 06:20 AM |
|
|
Thread: Importing Dataset
Post: Importing Dataset
Howdie!
Not sure if I can post this here, or if it belongs to data analysis.
So I'm importing a dataset and defining x and y.
Here's the code:
dataset=pd.read_csv("Data.csv", sep=",")
X=dataset.il... |
|
PythonGainz |
Data Science |
1 |
1,345 |
Apr-12-2020, 12:19 PM |
|
|
Thread: Checking for equality
Post: RE: Checking for equality
|
PythonGainz |
General Coding Help |
8 |
3,261 |
Apr-10-2020, 03:00 PM |
|
|
Thread: Checking for equality
Post: RE: Checking for equality
Here's what I found, if you use the following code:
import code
code.interact(local=locals())With this, I can use the console, but in the command prompt it doesn't work. I'm also not getting the >... |
|
PythonGainz |
General Coding Help |
8 |
3,261 |
Apr-10-2020, 01:30 PM |
|
|
Thread: Checking for equality
Post: RE: Checking for equality
I've typed "python" and "python3" into the command promt and the console. Doesn't do anything unfortunately. |
|
PythonGainz |
General Coding Help |
8 |
3,261 |
Apr-10-2020, 10:27 AM |
|
|
Thread: Checking for equality
Post: RE: Checking for equality
Thanks Buran,
unfortunately, this brings me to the next problem, how do I get into interactive mode? Searching the web, I keep getting the advice to simply type "python" or "python 3". This doesn't w... |
|
PythonGainz |
General Coding Help |
8 |
3,261 |
Apr-10-2020, 09:59 AM |
|
|
Thread: Checking for equality
Post: Checking for equality
Guys,I know this is so kindergarten, but I just can't find the answer.
So according to my textbook to check for equality in a simple example, all I need is:
car="bmw"
car=="bmw"and this should give ... |
|
PythonGainz |
General Coding Help |
8 |
3,261 |
Apr-09-2020, 01:44 PM |
|
|
Thread: Adding second message to simple loop error
Post: RE: Adding second message to simple loop error
Omg, I feel like such an idiot **doh** |
|
PythonGainz |
General Coding Help |
2 |
2,100 |
Apr-06-2020, 11:55 AM |
|
|
Thread: Adding second message to simple loop error
Post: Adding second message to simple loop error
Hello there,
hope I'm posting correctly this time.
So the loop works nicely for the first statement, but I'm getting a syntax error for the second one (ending\n)
This is what the console says:
Erro... |
|
PythonGainz |
General Coding Help |
2 |
2,100 |
Apr-06-2020, 11:15 AM |
|
|
Thread: Trying Comparison Operators
Post: RE: Trying Comparison Operators
The awesomeness of you guys is unbelievable. Many many thanks indeed! |
|
PythonGainz |
General Coding Help |
3 |
2,729 |
Mar-28-2020, 10:46 AM |
|
|
Thread: Trying Comparison Operators
Post: Trying Comparison Operators
Good morrow, guys!
Used this code from a textbook and can't find the error. It seems like something at the beginning already, but I cant figure it out.
Code:
i=10
j=15
if(i==j):
print("i is equa... |
|
PythonGainz |
General Coding Help |
3 |
2,729 |
Mar-28-2020, 07:33 AM |
|
|
Thread: VS Code missing in Anaconda
Post: VS Code missing in Anaconda
Hey guys,
I downloaded Anaconda and according to one of my textbooks it should contain VS Code. It doesn't though. Anyone know why and can I add it to Anaconda Navigator? Please know I am a bloody be... |
|
PythonGainz |
News and Discussions |
2 |
8,897 |
Mar-24-2020, 07:51 AM |
|
|
Thread: (Complete Novice) Code not working
Post: RE: (Complete Novice) Code not working
(Mar-21-2020, 05:32 PM)buran Wrote: you need to write it in the cmd window or terminal, or wherever you execute the script, i.e. where it prints What is your name?
These are 2 different examples.
In... |
|
PythonGainz |
General Coding Help |
9 |
4,109 |
Mar-21-2020, 05:41 PM |
|
|
Thread: (Complete Novice) Code not working
Post: RE: (Complete Novice) Code not working
(Mar-21-2020, 05:19 PM)buran Wrote: on line 10 you take input from user. That means when it print What is your name? you need to enter your name and press Enter
Where do I enter the name? But the na... |
|
PythonGainz |
General Coding Help |
9 |
4,109 |
Mar-21-2020, 05:27 PM |