Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Game of Life (neighbors)
Post: RE: Game of Life (neighbors)

I found something like this: for x in range(S): for y in range(S): total = (tablica[x, (y-1)%S] + tablica[x, (y+1)%S] + tablica[(x-1)%S, y] + tablica[(x+1)%S, y] + ...
pawlo392 Game Development 5 3,987 Jun-20-2019, 02:32 PM
    Thread: Game of Life (neighbors)
Post: Game of Life (neighbors)

How to count the sum of all eight neighbors for this table?: table = np.random.choice(stan, 100*100, p=[0.2, 0.8]).reshape(100, 100)I started to create a Game of Life and I have problem with it. At fi...
pawlo392 Game Development 5 3,987 Jun-08-2019, 07:52 PM
    Thread: The combination of four columns in two.
Post: The combination of four columns in two.

I have csv file with fake data. This is part: Quote:Name1,Telephone1,Name2,Telephone2,Duration Alice,085 646 4923,Shawn,085 388 3678,7 Derek,082 467 5217,Justin,082 245 8825,9 Derek,082 467 5217,Kim,0...
pawlo392 Data Science 2 2,124 May-31-2019, 09:13 AM
    Thread: How to filter data using a panda.DateFrame.loc
Post: How to filter data using a panda.DateFrame.loc

I do not know why I am getting such a mistake. Error: File "C:\Anaconda3\lib\site-packages\pandas\core\frame.py", line 2726, in _getitem_array indexer = self.loc._convert_to_indexer(key, axis=1) ...
pawlo392 Data Science 1 2,656 May-27-2019, 07:36 PM
    Thread: Histogram and text file.
Post: Histogram and text file.

I have such a text file: breast-cancer I want to create a histogram and any other graph. Bu I have a problem. I wrote this: import matplotlib.pyplot as plt import numpy as np from sklearn.datasets imp...
pawlo392 Homework 1 4,130 May-23-2019, 07:10 PM
    Thread: Einsum- ValueError
Post: RE: Einsum- ValueError

OK. Error:Traceback (most recent call last): File "<ipython-input-44-981ebe7a58f3>", line 1, in <module> runfile('C:/Users/Paweł-Kusz/Desktop/zadania python-20190326T002157Z-001/za...
pawlo392 Homework 3 3,227 May-22-2019, 11:02 AM
    Thread: Einsum- ValueError
Post: Einsum- ValueError

I don't know why I getting error: Error:ValueError: operand has more dimensions than subscripts given in einstein sum, but no '...' ellipsis provided to broadcast the extra dimensions.My code: from t...
pawlo392 Homework 3 3,227 May-22-2019, 10:21 AM
    Thread: Scaling elements of marix.
Post: Scaling elements of marix.

I have a matrix 682x10 and I have problem with one task. I want to do for each j-column Xj=(Xj-min(Xj))/(max(Xj)-min(Xj)). Of course, I know how to do this with for. But I have to use numpy library.I ...
pawlo392 Homework 1 2,172 May-16-2019, 10:15 PM
    Thread: Correct errors in text file.
Post: RE: Correct errors in text file.

I have now: def correct(to_file): with open(to_file, 'r') as f: text = f.read() for word in text.split(" "): if len(word) == 2: print(word) x = int(inp...
pawlo392 Homework 2 2,250 Apr-17-2019, 07:55 PM
    Thread: Correct errors in text file.
Post: Correct errors in text file.

I trying to write a program, which will correct errors in text file, for example TOm--> Tom, EUrope-->Europe, but if word has two letters, for example IT, program will ask the user if he wants t...
pawlo392 Homework 2 2,250 Apr-17-2019, 02:48 PM
    Thread: Changing small letter.
Post: Changing small letter.

I want to write generator, which will be change the first letter of the names from list. I have to use "for" and "yield". I thought about something like that: def names(lis): for i in lis: ...
pawlo392 Homework 1 1,746 Apr-05-2019, 12:49 PM
    Thread: Monoalphabetic cipher
Post: Monoalphabetic cipher

Hello! I wrote this code: keys={'a':'z','b':'y','c':'x','d':'w','e':'v','f':'u','g':'t','h':'s','i':'r','j':'q','k':'p','l':'o','m':'n'} reverse_keys={} for key,value in keys.items(): reverse_keys...
pawlo392 Homework 1 12,796 Apr-01-2019, 08:33 PM
    Thread: Dictionary comprehension
Post: Dictionary comprehension

Hello! I want to write a function ,def count_words_starting_with_given_letter(text, letter):, for example: print(count_words_starting_with_given_letter('Tom has tiger ', 't') == {'Tom': 1, 'tiger': 1...
pawlo392 Homework 1 1,861 Mar-28-2019, 10:58 PM
    Thread: Amicable numbers.
Post: RE: Amicable numbers.

Thank You!
pawlo392 Homework 2 2,493 Mar-21-2019, 09:47 PM
    Thread: Amicable numbers.
Post: Amicable numbers.

I want to create a program, which will find pairs of amicable numbers lower than n. I wrote a cod : def sumdiv(n): Sum = 0 for x in range(1, n // 2 + 1): if n % x == 0: Sum...
pawlo392 Homework 2 2,493 Mar-21-2019, 09:20 PM
    Thread: Doubling every second letter.
Post: Doubling every second letter.

Hello! I have to create a program, which will be doubles every second letter. Foe example: input:Tom has cat. output: Toom hhass caat. I wrote this cod : def double(s): return ''.join(x * (y% 2 + ...
pawlo392 Homework 1 1,584 Mar-11-2019, 11:57 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020