Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Increase df column values decimals
Post: Increase df column values decimals

Hi, I have below datframe with numerical column marks df: name age marks A 14 12.34 B 12 34.1 C 29 19.567I want to increase marks column decimals to 6 desired output: name a...
SriRajesh Data Science 2 1,119 Nov-05-2022, 02:43 PM
    Thread: Add root node to xml
Post: RE: Add root node to xml

(Oct-15-2022, 02:26 PM)ndc85430 Wrote: Do you have a question? Why are you manipulating a string, instead of using objects to create the XML (e.g. with xml.etree.ElementTree)?I Have data frame, but ...
SriRajesh General Coding Help 3 1,058 Oct-15-2022, 02:29 PM
    Thread: Add root node to xml
Post: Add root node to xml

Hi, I generated xml string and want to add root node: #lets create a dataframe df=pd.DataFrame({'A':[1,2,3],'B':['a','b','c']}) def to_xml(df): def row_xml(row): xml = ['<item>'] ...
SriRajesh General Coding Help 3 1,058 Oct-15-2022, 02:20 PM
    Thread: how to expand each unique value in another column and fill zero if no match
Post: how to expand each unique value in another column ...

Hi, I have below df: first_name second_name X Y count A A1 0.1 0.4 1 A A1 0.2 0.2 2 B B1 ...
SriRajesh Data Science 0 844 Jul-10-2022, 09:21 AM
    Thread: How to plot seaborn heatmap on top of a background circle
Post: How to plot seaborn heatmap on top of a background...

Hi, I have below code to visualize data, and I want to ensemble a circle (heatmap inside big circle). data is below: helix1 phase helix 2 phase Energy -0.1 -0.1 1 -0.2 -0.2 0 -0.3 -0.3 0 -0.4 -0.4 2...
SriRajesh General Coding Help 0 1,421 Jul-09-2022, 04:00 AM
    Thread: How to move multiple columns to initial position
Post: RE: How to move multiple columns to initial positi...

I also tried create new data frame, but the problem is I do not now some time coulmns are more and some time less. but the columns I want to shift lways exists. Other columns are random. (Jul-02-20...
SriRajesh General Coding Help 4 1,439 Jul-02-2022, 09:39 AM
    Thread: How to move multiple columns to initial position
Post: RE: How to move multiple columns to initial positi...

I do pop, but it only allow one column at a time. Can we do pop() for multiple columns? (Jul-02-2022, 03:02 AM)deanhystad Wrote: I don't think shift does what you think it does. You are creating ...
SriRajesh General Coding Help 4 1,439 Jul-02-2022, 09:36 AM
    Thread: How to move multiple columns to initial position
Post: How to move multiple columns to initial position

Hi, I have below df and want to move multiple columns to initial position. df: wat tey step low tool tech category subj name 1 2 3 4 5 6 7 8 9 6 2 7 ...
SriRajesh General Coding Help 4 1,439 Jul-01-2022, 02:17 PM
    Thread: df column mean and count of unique
Post: df column mean and count of unique

Ji, I have below df, and I want to group by coulmn2,column3 and calculate mean of other columns and unique count. df: col1 col2 col3 col4 col5 A1 A x1 3 1 A2 A x1 2 ...
SriRajesh General Coding Help 0 1,121 May-07-2022, 08:19 AM
    Thread: df column aggregate and group by multiple columns
Post: df column aggregate and group by multiple columns

Hi, I have below df I want to calculate rank, age pos columns max, min, mean and group by Name, sub,school. I use can only calculate mean, but I want to calculate min, max at the same time. df.groupb...
SriRajesh General Coding Help 0 1,050 May-06-2022, 02:26 PM
    Thread: How split N days between specified start & end days
Post: RE: How split N days between specified start & end...

thanks
SriRajesh General Coding Help 2 1,337 May-06-2022, 02:12 PM
    Thread: How split N days between specified start & end days
Post: How split N days between specified start & end day...

Hi, I have start date and end date. I want to split it to N-equal days. start_date = "2022/04/10 00:00:00" end_date = "2022/04/14 00:00:00" I want to make list of N-equal days ["2022/04/10 00:00:00"...
SriRajesh General Coding Help 2 1,337 Apr-28-2022, 12:26 PM
    Thread: How to map by time stamp and name
Post: How to map by time stamp and name

Hi, I have two data frames of different size. I want to map name in df1 to in df2 name & time stamp. There are same name but different time stamp. I want to capture correct time stamp(early one ...
SriRajesh General Coding Help 0 1,151 Apr-09-2022, 12:49 PM
    Thread: map df1 to df2
Post: RE: map df1 to df2

out_df must only contain df1 rows and add col4 map to df2 out_df: col1 col2 col3 col4 A JY 1 0 C nY 13 45 MMS JY 41 67 K SA 94 100
SriRajesh Data Science 5 1,907 Mar-23-2022, 12:20 PM
    Thread: map df1 to df2
Post: RE: map df1 to df2

but I only want based on df1. I did as below but it also taking df2 rows. df1['new_col'] = df.merge(df,how=left,on=['col1','col2'])It also considering df2 even if col1, col2 row not present in df1.
SriRajesh Data Science 5 1,907 Mar-19-2022, 06:26 AM
    Thread: map df1 to df2
Post: map df1 to df2

Hi, I have two data frames: df1: col1 col2 col3 A JY 1 C nY 13 MMS JY 41 K SA 94 df2: df1: col1 col2 col4 A JY 0 C nY ...
SriRajesh Data Science 5 1,907 Mar-18-2022, 11:19 AM
    Thread: Encrypt and decrypt in python using own fixed key
Post: RE: Encrypt and decrypt in python using own fixed ...

(Feb-19-2022, 01:03 PM)dboxall123 Wrote: Hi. I can't say that I've ever used the cryptography module, but I got this and modified this from the cryptography website: import base64 import os from cr...
SriRajesh General Coding Help 3 4,878 Feb-20-2022, 12:08 PM
    Thread: Encrypt and decrypt in python using own fixed key
Post: Encrypt and decrypt in python using own fixed key

Hi I want to encrypt an d decrypt. But I want to use fixed defined key for example: key = "Abcd123". Can some one help how to do it. Thanks in advance. I use below code. from cryptography.fernet impor...
SriRajesh General Coding Help 3 4,878 Feb-19-2022, 12:29 PM
    Thread: How to access previous row using itertuples
Post: RE: How to access previous row using itertuples

(Feb-04-2022, 03:57 PM)deanhystad Wrote: If you start at the first row there is no previous row. You can hang on to the previous row and print the previous row after you get the second row. import ...
SriRajesh General Coding Help 7 7,657 Feb-05-2022, 08:50 AM
    Thread: How to access previous row using itertuples
Post: RE: How to access previous row using itertuples

(Feb-04-2022, 07:28 PM)deanhystad Wrote: I think that was for demo purposes. If not, grabbing a column series would be MUCH fasterYes, I need every column, but just for simplicity I shown one colum...
SriRajesh General Coding Help 7 7,657 Feb-05-2022, 08:41 AM

User Panel Messages

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