Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: substring function to create new column
Post: RE: substring function to create new column

Hi There, I am expecting the final table should be like below: Output:id direction position aa11bc north, south, east, west north bb22cd north, south, east, west north cc33ef no...
Chandan Data Science 6 2,468 Feb-14-2020, 02:40 AM
    Thread: substring function to create new column
Post: RE: substring function to create new column

Hi There, I tried with the below code, but the results are not what I am expecting. new_col=[] for i in df["id"]: if i[1:3].lower()in ('a1','b2'): new_col=df["direction"].str.split(',')....
Chandan Data Science 6 2,468 Feb-14-2020, 01:22 AM
    Thread: substring function to create new column
Post: substring function to create new column

Hi There, I am new to python so please be kind to me. Below is the data frame and the requirement: data = {'id': ['aa11bc', 'bb22cd', 'cc33ef', 'dd44gh', 'ee55ij','ff66kl','gg77mn','hh88op'], ...
Chandan Data Science 6 2,468 Feb-13-2020, 09:19 AM
    Thread: multiple conditions
Post: RE: multiple conditions

Hi metulburr, Heros is the data frame. I went through some of the code which was posted in the forum and I replicated that here, will go through some document to understand better. Hi snippsat, Yes, ...
Chandan General Coding Help 7 3,995 Jan-31-2020, 12:53 AM
    Thread: multiple conditions
Post: RE: multiple conditions

Hi, This is the code I have used and the following is the error message. def fun_check(): if name in ("spiderman","antman") and salary in range(1000,2000) and city not in ("boston","dubai")...
Chandan General Coding Help 7 3,995 Jan-30-2020, 12:48 PM
    Thread: multiple conditions
Post: RE: multiple conditions

(Jan-30-2020, 03:42 AM)metulburr Wrote: python code reads a lot like speech, so your requirement is not far off from the actual source code if name in ("spiderman","antman") and salary in range(1000...
Chandan General Coding Help 7 3,995 Jan-30-2020, 10:31 AM
    Thread: multiple conditions
Post: multiple conditions

Hi There, I am trying to replicate one of the SAS functions in Python, not sure how to do it. It would be great if you guys can assist me with this. Below is the requirement. I want to perform 2 di...
Chandan General Coding Help 7 3,995 Jan-30-2020, 12:55 AM
    Thread: Substring and If then Condition to create column
Post: Substring and If then Condition to create column

Hi There, I have a requirement to create a new column by classifying the roads as Main roads and local roads. If Road_No starting with H or M I want to classify it as Main roads, if not then local ro...
Chandan General Coding Help 2 2,352 Jan-23-2020, 05:02 AM
    Thread: Using Ab Operator in Query Function
Post: Using Ab Operator in Query Function

Hi There, I am practicing the query function using different conditions. However, when I use the below condition I am not getting the accurate output. When I run below syntax I can see all the Actor's...
Chandan General Coding Help 0 1,292 Jan-10-2020, 05:27 AM
    Thread: simple if elif conditions in Python
Post: simple if elif conditions in Python

Hi There, I am very much new to Python and to this forum. I am looking for code help. I have a SAS code as below and I would like to replicate this in Python. It would be great if you guys can assist ...
Chandan General Coding Help 2 2,063 Jan-08-2020, 02:00 PM

User Panel Messages

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