Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Does this code need to be so long?
Post: RE: Does this code need to be so long?

(Sep-26-2022, 09:47 PM)duckredbeard Wrote: but the code is kinda long. It works, but I just want to see if I can make it simpler.Are you looking for constructions like this? all_leds = [ledgreen, le...
ibreeden General Coding Help 4 122 Yesterday, 09:36 AM
    Thread: Write sql data or CSV Data into parquet file
Post: RE: Write sql data or CSV Data into parquet file

I don't understand everything from the code you show us. I see you are using variables that are not defined. I guess the code produces an error message. You should always include the full error messag...
ibreeden General Coding Help 2 94 Sep-26-2022, 08:21 AM
    Thread: Stock Return calculation problem
Post: RE: Stock Return calculation problem

Hi, welcome to the forum. I would like to help, but I find your explanation hard to understand. Your program looks quite nice at first sight. (Sep-22-2022, 02:13 PM)LFin Wrote: I don't know what is...
ibreeden General Coding Help 10 275 Sep-23-2022, 08:57 AM
    Thread: Memory Error While generating cheksum no
Post: RE: Memory Error While generating cheksum no

f.read() will try to read the entire file. You tell us the file is 60GB. If your computer does not have 60GB of memory you will get a memory error. Solution: read the file in chunks of let's say 10240...
ibreeden General Coding Help 2 155 Sep-16-2022, 08:47 AM
    Thread: Saving progress in a Python program to use later
Post: RE: Saving progress in a Python program to use lat...

(Sep-08-2022, 06:16 PM)Led_Zeppelin Wrote: I have a program that takes forty-five minutes to run. That makes it harder to debug. It takes 40 minutes to get to the critical areaI am not sure what e...
ibreeden General Coding Help 9 383 Sep-10-2022, 07:39 AM
    Thread: help with adding duplicates elements together in a list
Post: RE: help with adding duplicates elements together ...

It is a pity you are not allowed to use a dictionary. This makes it difficult to create a nice script. As stated by Yoriz, this forum requires you to produce a program yourself and then you will get h...
ibreeden Homework 5 460 Sep-09-2022, 08:57 AM
    Thread: Pymysql delete specific rows in tableview
Post: RE: Pymysql delete specific rows in tableview

I agree with Rob101, it is best to prevent unwanted data to be written to the database. But if this cannot be done, you will need to execute the following regularly. delete from TABLENAME where PROD1 ...
ibreeden General Coding Help 2 219 Aug-18-2022, 09:50 AM
    Thread: KeyError: 2
Post: RE: KeyError: 2

Apparently "row" does not contain what you expect. So in such cases always add a print statement just before the line where the error occurs. print(row)What does it show? Furtheron it is good pract...
ibreeden General Coding Help 8 296 Aug-16-2022, 05:17 PM
    Thread: access is denied error 5 for network drive mapping ?
Post: RE: access is denied error 5 for network drive ma...

What happens if you open the Windows File Explorer and type "\\192.168.7.9\Import\8" in the address bar? Remember you need to give permissons (on the server) both on the share and on the folder (and/o...
ibreeden General Coding Help 2 256 Aug-14-2022, 07:15 AM
    Thread: Undefined
Post: RE: Undefined

(Aug-01-2022, 04:20 PM)Led_Zeppelin Wrote: It says that feature_importances_ is not defined. In the code one can see that it is.Is it perhaps defined in an if or else block?
ibreeden General Coding Help 4 383 Aug-01-2022, 04:28 PM
    Thread: Parsing JSON
Post: RE: Parsing JSON

Hi @pyStund , welcome to the forum. I see you studied the manuals of AWS and boto3 quite well. I am sorry to say I didn't, I know nothing about AWS and boto3. But perhaps I can help by analyzing what...
ibreeden General Coding Help 4 337 Jul-31-2022, 11:13 AM
    Thread: converting to int
Post: RE: converting to int

Yeah, great book, "The C Programming Language" from Kernighan and Ritchie. But about your problem, @Skaperen , I still believe regular expressions are most efficient for solving this. Let me first su...
ibreeden General Coding Help 11 721 Jul-24-2022, 08:51 AM
    Thread: [Solved]Help comparing 2 databases
Post: RE: Help comparing 2 databases

Is there a reason why you store these tables in separate databases? This complicates the solution. To benefit from a database you should let the database do the work. To have the database do the work,...
ibreeden General Coding Help 2 361 Jul-15-2022, 08:13 AM
    Thread: Adding string after every 3rd charater [SOLVED]
Post: RE: Adding string after every 3rd charater [SOLVED...

(Jul-10-2022, 03:15 PM)AlphaInc Wrote: If (which I think will be the case) this is too complex and there is a far easier method, please let me know :)Congratulations, well done. But indeed there is ...
ibreeden General Coding Help 2 390 Jul-11-2022, 09:22 AM
    Thread: Delete multiple lines from txt file
Post: RE: Delete multiple lines from txt file

(Jul-10-2022, 05:32 AM)Lky Wrote: What will be the condition for A. B. C. D.?Introduce a boolean variable e.g. "do_copy". If this variabel is true, copy the line. Else not. When a line contains: "Q...
ibreeden General Coding Help 6 521 Jul-10-2022, 07:14 AM
    Thread: Delete multiple lines from txt file
Post: RE: Delete multiple lines from txt file

The best way to do this is: Copy the lines of the original file to a temporary file, but don't copy the lines you do not want. If no errors occurred: remove the original file. Rename the temporary f...
ibreeden General Coding Help 6 521 Jul-09-2022, 06:00 PM
    Thread: Error in Int object is not subscript-able.
Post: RE: Error in Int object is not subscript-able.

You show 2 parts and the second part seems to be from an error console, but it is not the same as the first part so it is not clear what you mean. But one thing I can say: (Jul-06-2022, 06:40 AM)kaku...
ibreeden General Coding Help 2 335 Jul-06-2022, 08:31 AM
    Thread: File not found error
Post: RE: File not found error

(Jul-03-2022, 09:32 AM)saisankalpj Wrote: Sftp.put(localPath=“ C:/Users/documents/TestEDI.txt",remotePath=“ /Users/authentucation/")Your localPath and remotePatch start with a space. I think this is...
ibreeden General Coding Help 10 535 Jul-03-2022, 05:38 PM
    Thread: Need help formatting dataframe data before saving to CSV
Post: RE: Need help formatting dataframe data before sav...

Please show the complete error message. And which line in your program causes this error?
ibreeden General Coding Help 16 680 Jun-30-2022, 07:10 AM
    Thread: Extract text
Post: RE: Extract text

Also have a look at this thread: Extract a string between 2 words from a text file.
ibreeden General Coding Help 6 536 Jun-27-2022, 11:21 AM

User Panel Messages

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