473,554 Members | 2,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Forum

Python programming language - Ask questions about python interpreter, control flow, data structures, modules errors, classes, standard library, gui, databases, unit testing, object oriented, structured programming and more.
1
2,519
thread by: snowman12 | last post Oct 29 '20 by: dev7060
Hi guys, I just started learning python and i write a simple code using function but it is not showing me output in pycharm which i want it show me "Process finished with exit code 0" please help me out. Thanks in advance. x="volvo" def myfunc(): global x x="audi" print("This is " + x) myfunc()
3
5,638
thread by: IamSciFi | last post Oct 27 '20 by: Ishan Shah
I'm a new at python but have a little bit of exp so I typed a code:- x=input('Enter the number') y=input('Enter the number') print('The product of x and y is');x*y= END But it always saysTraceback (most recent call last): File "C:/Users/lapchief/Documents/Python/Python 1st program.py", line 3, in <module> print('The product of x...
3
3,661
thread by: ideku12 | last post Oct 23 '20 by: SioSio
Im trying to get the data stored in a file and put that data into a parallel array.
2
3,332
thread by: ideku12 | last post Oct 21 '20 by: ideku12
How do I get a percentage from a csv file and use counting occurrences to say how many percentage was above 50?
0
1,740
thread by: drunkenphd | last post Oct 11 '20 by: drunkenphd
Hi. My code below: def simulate_stock(start,rate,vol,days): daily_yields=np.random.normal(loc=(rate/252),scale=(vol/(252**0.5)),size=days) cumulative_yields=np.cumsum(daily_yields) daily_multipliers=np.exp(cumulative_yields) simulated_prices = np.round(start * daily_multipliers, 2) simulated_prices =...
1
3,908
thread by: RolandHall | last post Oct 6 '20 by: Rabbit
from tkinter import * import time import random # Set up Root root=Tk() root.geometry("1200x1000") root.title("Aliens Attack!!") # Set up Global variables
1
2,122
thread by: Aspect11 | last post Sep 27 '20 by: SwissProgrammer
So I have this code: https://pastebin.com/AzYEkgmr My current problem is when the 'else' statement on deleteNode() runs, it doesn't shift all the nodes upwards and instead leaves the node which is meant to replace a further up one there. Anyone got any ideas. I am using python 3.8.2 with pycharm community 2020.2.2
5
7,293
thread by: madankarmukta | last post Sep 10 '20 by: SioSio
dropna inplace not working. Can anyone help.
4
2,792
thread by: rao121 | last post Sep 6 '20 by: dev7060
I am using iterative method and recursion method to implement factorial but when finding the same for large numbers,it takes alot of time.Any way to change that?
2
4,038
thread by: ck25python | last post Aug 26 '20 by: madankarmukta
Hi There, I am very new to python environment. I am trying to replicate one of the SAS code in python. I want to create 3 columns based on multiple conditions: Below are the requirements: if year is 2019 i want to create a column as en2019 and assign value as 1 else assign value as 0 same goes for year 2020.
2
4,438
thread by: RockRoll | last post Aug 26 '20 by: madankarmukta
Hi, I have a large (Nx4, >10GB) array that I need to sort based on col.2. I am reading my data in chunks and sorting using Pandas. But I am unable to combine the sorted chunks to give me a final large Nx4 array that is sorted on Col.2. Here is what I have tried yet: chunks = pd.read_csv(ifile, chunksize=50000, skiprows=0, ...
2
2,966
thread by: RockRoll | last post Aug 25 '20 by: madankarmukta
Hi Everyone, I create an expandable earray of Nx4 columns. Some columns require float64 datatype, the others can be managed with int32. Is it possible to vary the data types among the columns? Right now I just use one (float64, below) for all, but it takes huge disk space for (>10 GB) files. For example, how can I ensure column 1-2 elements...
2
2,918
thread by: luffy3not2 | last post Aug 24 '20 by: luffy3not2
I am trying build a webpage which takes a large tab delimited .txt/.txt.gz file as user input from a form and using POST method(test.html) to send the data to cgi-bin directory to file.py which ideally should open the file read and put the data into a dataframe and do some analysis(which i have already wrttien in python and works well on terminal)...
5
2,896
thread by: sadash | last post Aug 21 '20 by: Ishan Shah
Hi, I want to create a desktop shortcut/icon for python file. How to make this?
1
2,930
thread by: CoderKnight | last post Aug 14 '20 by: Ishan Shah
Can anyone recommend me some Youtube (or other video courses) Python tutorials for either Tkinter or PyQt like the two below. (covering those widgets and layouts)
10
4,932
thread by: RockRoll | last post Aug 14 '20 by: RockRoll
Hey Everyone: Here is one interesting problem. Input: Input is two arrays (Nx4, sorted in column-2) stored in datasets-1 and 2 in HDF5 file (input.h5). N is huge (originally belonging to 10 GB of file, hence stored in HDF5 file). Output: Subtracting each column-2 element of dataset-2 from dataset-1, such that the difference (delta) is...
1
2,349
thread by: RockRoll | last post Aug 12 '20 by: Banfa
I want to save a particular number of values in maps I create. For example, when creating (4064x1) values, I want to save first (1000x1) in map1, next (1000x1) in map2 and so on. The last map will have remaining (64x1) elements. I need these maps later for fast processing. Now the issue is I want to automate this as the number 4064 varies based...
1
2,908
thread by: sashi kiran | last post Aug 8 '20 by: Banfa
def isPrim(n): if n <=1 : return False if n <=3: return True else: for x in range(3,n): if(n%x==0): return False return True
1
3,005
thread by: RockRoll | last post Aug 7 '20 by: Banfa
Hi Everyone, Here is an interesting problem I am trying to solve. I have a (Nx4) array and want to extract those rows which have their third column's element in certain range. Are there existing capabilities in NumPy? Below is a simple example. PS: I know how for loops can be used by comparing each element of col. 3; and saving the rows...
7
2,740
thread by: rompdeck | last post Jul 30 '20 by: SioSio
I download some jpg files (A4 size) from a website and convert all the files into a single pdf file and email it. The jpg files are in a url format of: http://URL.com/RPT/2020/07/26/<page no> The date today is 2020/7/26 and page number as 2 char (01-15) How can I automate the whole process so it does it automatically without any thing...
1
1,709
thread by: ck25python | last post Jul 22 '20 by: hussainmujtaba
Hi There, I have thousands of dictionaries saved in one jupyter notebook (controlled by IT), and i would like to utitlize some of the dicitonies in to my jupyter notebook.Is there a way i can achieve this. Example: IT-Jupyter notebook contains below dictionary (just a sample): dict_sample={'HR':'Human Resource','FIN':'Finance','LG':'Legal'}...
2
2,019
thread by: wnvhbop | last post Jul 15 '20 by: SioSio
I have a large text file which has a lot of links and I need python script to extract all the names of the files which end with .pdf format and (sorted without repeated result) ? sample example from the file: http://www.123.com/file.pdf http://www.123.com/pdfhello http://www.456.com/hello/one.file.pdf http://www.123.com http://www.123.com...
0
1,937
thread by: samlee916 | last post Jul 13 '20 by: samlee916
import requests import argparse from urllib.request import urlparse, urljoin from bs4 import BeautifulSoup # initialize the set of links (unique links) internal_urls = set() external_urls = set() total_urls_visited = 0
3
4,454
thread by: Lisv | last post Jul 10 '20 by: hussainmujtaba
while True: print("覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧") print("вміння:") print("напеши '+' щоб додати") print("напеши '-' щоб відняти") print("напиши '*' щоб умножиити") print("напиши '/' щоб поділити") print("напиши 'стоп' щоб все зупинити") ...
0
1,790
thread by: Nomadyb10 | last post Jun 9 '20 by: Nomadyb10
file Pathi and name,File Type, time holding program python to implement file search using shelve

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.