Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: pyspark help
Post: pyspark help

Hi, I need a help to convert this pandas df to pyspark dataframe df=df.groupby('key', as_index=False).agg({'key' : 'first', 'country' : ', '.join}) Appreciate your help/guidance on this. Thanks, ...
lokesh General Coding Help 0 753 Jan-03-2023, 04:34 PM
    Thread: convert numbers into list
Post: convert numbers into list

Hi, I need help to convert the following numbers into a list. 156788 987652 567891 234567 the output should be as below: [156788,987652,567891,234567] Appreciate your help. Thx in advance
lokesh General Coding Help 1 2,375 Jun-03-2021, 06:08 AM
    Thread: extract particular strings into a variable
Post: RE: extract particular strings into a variable

Thanks.. I resolved it my own Thx, Lokesh
lokesh General Coding Help 3 2,101 Dec-09-2020, 11:59 AM
    Thread: extract particular strings into a variable
Post: extract particular strings into a variable

Hi, I have a requirement to get the string data like below. str = "dsrc, combo, dsrc_hist, mapping, combo_hist" If a particular value contains "hist" needs to assign to one variable and if not "...
lokesh General Coding Help 3 2,101 Dec-09-2020, 10:38 AM
    Thread: Displaying duplicates in dictionary
Post: Displaying duplicates in dictionary

Hi, I am trying to below snippet of code but displaying duplicates. Can you please let me know where i did mistake. src_base_path="/data/infy" year_mth="2020-10-05" folder_names = "1, 2, 3" table_n...
lokesh General Coding Help 2 1,976 Oct-15-2020, 07:45 AM
    Thread: USZIPCODE error
Post: USZIPCODE error

Hi, I am wondering if anyone is facing the issue with uszipcode package error.till yesterday it works fine without any issues with latest version uszipcode==0.2.4. sometimes it is working and someti...
lokesh General Coding Help 1 1,935 Sep-15-2020, 03:25 PM
    Thread: extract version in a string
Post: extract version in a string

Hi, I need help to extract only version in the following string. str="psutil-5.4.5-cp27-none-win32.whl" output should be : 5.4.5 Appreciate help on this. Thx, Lokesh
lokesh General Coding Help 2 2,157 Oct-09-2019, 05:21 AM
    Thread: Need help to extract particular string
Post: RE: Need help to extract particular string

Hi, It is not working which i tried as below import re re.match("(.*)Process Start time(.*)", line): c= line.split("-")[3] print© output: ====== Process Start time ...
lokesh General Coding Help 3 2,262 Sep-04-2019, 06:21 PM
    Thread: Need help to extract particular string
Post: Need help to extract particular string

Hi, I want to extract particular string in a file.suppose file contains the following string. INFO 2019-02-19 20:59:56,178 - Process Start time : 2019-02-19 20:55:09.778793 INFO 2019-...
lokesh General Coding Help 3 2,262 Sep-04-2019, 05:35 PM
    Thread: Need help to retrieve a particular string
Post: RE: Need help to retrieve a particular string

Hi, I tried using the below but always it should be the last record in a file. with open(r'C:\Users\lokesh\file.txt') as f: print(f.readlines()[-1].split()) and even the output is showing lik...
lokesh General Coding Help 3 1,743 May-27-2019, 05:19 PM
    Thread: Need help to retrieve a particular string
Post: Need help to retrieve a particular string

Hi, I need your help to retrieve/display particular string in a file. file1: ===== 567812345676-123 p-45yt7u75402 I want to get the record starts with p- record in a file. Appreciate...
lokesh General Coding Help 3 1,743 May-27-2019, 04:36 PM

User Panel Messages

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