Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How to set CPU and memory resource
Post: How to set CPU and memory resource

Hi, I am running my python script on server, most of the time resource is distributed and occupied by other scheduled jobs. I want to minimize my program queue time by lowering the resource required, ...
SriRajesh General Coding Help 1 193 Aug-16-2021, 11:50 AM
    Thread: Find factor to match test curve to golden curve
Post: Find factor to match test curve to golden curve

Hi, I have a golden curve and test curve, I want to find a factor to multiply each value in test data such as to match (close to) golden curve slope & golden curve values. Actually golden curve va...
SriRajesh General Coding Help 0 274 Jun-17-2021, 04:39 AM
    Thread: dataframe cell conditional format by row
Post: dataframe cell conditional format by row

Hi, I have below dataframe: df: Name gender age rank code Mek m 29 2 23 ABK f 20 23 56 SGH f 23 19 12 JKL m 17 33 19threshold_mek = 12 threshold_ABK = ...
SriRajesh General Coding Help 0 574 Apr-24-2021, 11:51 AM
    Thread: How to overwrite file
Post: RE: How to overwrite file

Windows7, python version: 3.6.8 |Anaconda 4.3.1 (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)] DO I need to import anything or do anything?
SriRajesh General Coding Help 3 2,218 Apr-14-2020, 12:17 AM
    Thread: How to overwrite file
Post: How to overwrite file

Hi, I am writing some log file, and when I run each time I want to flush out everything (don't want to keep any previous data) I use the below code, but it is not working, I also tried with "w+", "a",...
SriRajesh General Coding Help 3 2,218 Apr-12-2020, 11:29 AM
    Thread: dataframe column mean skip na
Post: dataframe column mean skip na

Hi, I have below dataframe: df: c1 c2 c3 A 1 0 0 B na 1 C 1 1 1I use below code: df.mean(axis = 1, skipna = True)but I am getting NaN. my desired output: c1 c2 c3 1 0.5 0.66
SriRajesh Data Science 0 1,921 Mar-03-2020, 01:26 PM
    Thread: How to highlight dataframe columns
Post: How to highlight dataframe columns

Hi, I have below dataframe, I want to highlight P with green, F with red. df: c1 c2 c3 A P na P B F F P C P P naand write to excel. I use below code, df.conditional_format('B2:D4', {'type': ...
SriRajesh Data Science 1 935 Feb-28-2020, 03:22 PM
    Thread: How to define index column name using df.to_csv
Post: How to define index column name using df.to_csv

Hi, I have dataframe, and I want to write to csv. But when write to csv, the first column name disaaper (which is Index) Before write, Index c1 c2 A 2 5 B 5 9 I use below command, summar...
SriRajesh General Coding Help 0 743 Feb-13-2020, 03:45 PM
    Thread: How to get row row index of matching row
Post: How to get row row index of matching row

Hi, I have dataframe, df1: Name rank A na B na C na D nadf2: Category names rank std B 2 normal D 4I want to loop through df1, and if name in df1 exist in df2,...
SriRajesh General Coding Help 0 521 Feb-13-2020, 02:35 PM
    Thread: How to modify data frame row value
Post: How to modify data frame row value

Hi, I have dataframe: df3: name type score combined A t1 0 A_t1 B t2 0 B_t2 C t2 1 C_t2 A t2 1 A_t2 C t1 0 C_t1 B t3 0 B_t3summary_table: nam...
SriRajesh Data Science 0 653 Feb-12-2020, 05:46 PM
    Thread: How to make table
Post: How to make table

Hi, I have data as below: name category date score Z s1 2020-02-12 A s1 2020-02-12 B s2 2020-01-23 U s1 2020-02-06 A s2 2020-01-26 B s3 2020-0...
SriRajesh Data Science 0 556 Feb-12-2020, 03:53 PM
    Thread: How to calculate unique rows column sum and percentage
Post: RE: How to calculate unique rows column sum and pe...

Name category score A s1 1 B s1 0 A s2 0 C s1 0 B s2 1 A s3 1desired output: nansum average by name, and coulumns should be category, add on...
SriRajesh General Coding Help 4 1,239 Feb-12-2020, 02:21 PM
    Thread: How to calculate unique rows column sum and percentage
Post: RE: How to calculate unique rows column sum and pe...

I want to write the result to csv, and merge rows of similar name. I use below code, import pandas as pd df = pd.read_csv(r'D:\PythonCodes\tmpdata.txt', delimiter= '\s+', index_col=False) df['catego...
SriRajesh General Coding Help 4 1,239 Feb-08-2020, 07:47 AM
    Thread: How to calculate unique rows column sum and percentage
Post: How to calculate unique rows column sum and percen...

Hi, I have below data in txt file, and I want to calculate same rows column sum and percentage of passed. I use below code, but I can not get my desired output. Each name has different categories. I w...
SriRajesh General Coding Help 4 1,239 Feb-07-2020, 02:19 PM
    Thread: How to get full path of specified hidden files matching pattern recursively
Post: RE: How to get full path of specified hidden files...

Thanks. Got it.
SriRajesh General Coding Help 4 1,252 Jan-18-2020, 07:12 PM
    Thread: How to get full path of specified hidden files matching pattern recursively
Post: RE: How to get full path of specified hidden files...

I want to check in the Linux system.
SriRajesh General Coding Help 4 1,252 Jan-18-2020, 02:22 PM
    Thread: How to get full path of specified hidden files matching pattern recursively
Post: How to get full path of specified hidden files mat...

Hi, I want to get the full path of hidden files of matching pattern (file name: .daily.log) The hidden file name: ".daily.log" from pathlib import Path for filename in Path('D:\Backupdata\*\*').rglo...
SriRajesh General Coding Help 4 1,252 Jan-18-2020, 08:20 AM
    Thread: Read all csv files, and store the last line from each folder
Post: RE: Read all csv files, and store the last line fr...

Actually the last layer (sub)directory does not know (not fixed). But the file will be saved into this last folder. Hence I want to use the wild card. The file is available at :D:\Mekala_Backupdata\*...
SriRajesh General Coding Help 4 3,579 Jan-17-2020, 12:13 AM
    Thread: Read all csv files, and store the last line from each folder
Post: RE: Read all csv files, and store the last line fr...

I use below code. Here, the there will be 4 levels (subfolders) so I use Exammple: Rootfolder/project/cataegory after this I do not know folder names, but there will be 4 more subfolders and in the ...
SriRajesh General Coding Help 4 3,579 Jan-16-2020, 05:17 PM
    Thread: Read all csv files, and store the last line from each folder
Post: Read all csv files, and store the last line from e...

Hi, I want to read all csv files and read each file and capture last line form each file. I use the below code, but I struck. import os from glob import glob PATH = "D:\data\project\*\*\InputFiles" E...
SriRajesh General Coding Help 4 3,579 Jan-16-2020, 12:02 PM

User Panel Messages

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