Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Not quite getting the correct Output from a function
Post: RE: Not quite getting the correct Output from a fu...

Thank you for the replies. I tried both recommendations and they worked wonderfully...and I learned two different approaches in the process. Much appreciated!
twinpiques General Coding Help 3 2,653 Aug-04-2019, 11:53 PM
    Thread: Not quite getting the correct Output from a function
Post: Not quite getting the correct Output from a functi...

Hello. I have a function that I'm trying to create. When receiving a non-empty string input, I want to return a string containing every other character 2n+2 times. (Where "n" is the 0-based index o...
twinpiques General Coding Help 3 2,653 Aug-01-2019, 06:02 PM
    Thread: Output issue
Post: RE: Output issue

(Jul-29-2019, 11:16 PM)Yoriz Wrote: That is because you are returning a tuple instead of a string or you are using my f string from above which has commas in, just remove the commas. return f'{name}...
twinpiques General Coding Help 6 3,161 Jul-29-2019, 11:21 PM
    Thread: Output issue
Post: RE: Output issue

Thank you for the help - much appreciated. So, I used "return" instead of "print". def intro( name, age): if name != "" and age > 0: #print (name, "was born in",2018 - age) re...
twinpiques General Coding Help 6 3,161 Jul-29-2019, 11:15 PM
    Thread: Output issue
Post: Output issue

So, I'm trying a simple "else if" and I am getting the correct output, however, it's also outputting "None". What am I doing wrong here? Thank you in advance. def intro( name, age): if name !=...
twinpiques General Coding Help 6 3,161 Jul-29-2019, 10:23 PM
    Thread: More recent package/library for difflib?
Post: RE: More recent package/library for difflib?

(Jul-11-2019, 10:01 PM)metulburr Wrote: the difflib module is part of the standard python library https://docs.python.org/3.7/library/difflib.html https://pymotw.com/3/difflib/ Thank you - I under...
twinpiques Data Science 2 8,089 Jul-12-2019, 01:34 AM
    Thread: More recent package/library for difflib?
Post: More recent package/library for difflib?

Hello. I was going to install the difflib package, so I went to get more information about it from PyPi.org. However, it no longer exists, apparently. Is there a more updated or recent package simi...
twinpiques Data Science 2 8,089 Jul-11-2019, 09:36 PM
    Thread: Py4JJavaError: An error occurred while calling o22720.csv.
Post: Py4JJavaError: An error occurred while calling o22...

Hello. Any ideas what's going on here? Full disclosure...I am relatively new to Python/Spark programming. I'm using the following code within Spark to look for common fourgrams within two sets of da...
twinpiques General Coding Help 0 3,971 Jul-11-2019, 12:41 AM
    Thread: Determining string intersection (embeddings) between two narrative (text) fields
Post: RE: Determining string intersection (embeddings) b...

(Jun-24-2019, 02:32 PM)ichabod801 Wrote: Have you looked at difflib? I think it would give better answers than sets, but it would be a lot slower. If you decided to go with set intersections, I woul...
twinpiques Data Science 2 2,226 Jun-30-2019, 05:41 PM
    Thread: Determining string intersection (embeddings) between two narrative (text) fields
Post: Determining string intersection (embeddings) betwe...

Hello. I am trying to solve a text analytics problem. I have two data sets (DS1 and DS2). DS1 contains a narrative text field (Description_S). DS2 contains a narrative text field (Description_C)....
twinpiques Data Science 2 2,226 Jun-24-2019, 02:19 PM
    Thread: Error Message: TypeError: unhashable type: 'set'
Post: RE: Error Message: TypeError: unhashable type: 'se...

(May-08-2019, 05:32 PM)DeaD_EyE Wrote: Quick and dirty solution with less Python knowledge: hashable_data = tuple(set(ITERABLE))Mutable objects don't have a hash, because they can mutate. Immutable ...
twinpiques Data Science 4 18,924 May-22-2019, 02:31 PM
    Thread: Error Message: TypeError: unhashable type: 'set'
Post: RE: Error Message: TypeError: unhashable type: 'se...

Ahhh, thank you. Much appreciated!
twinpiques Data Science 4 18,924 May-08-2019, 05:06 PM
    Thread: TypeError: expected string or bytes-like object
Post: TypeError: expected string or bytes-like object

Hi all. I'm trying run the following code and I keep getting the "TypeError: expected string or bytes-like object" error: df_sar['sar_details_sent'] = df_sar['sar_details'].apply(lambda x: nltk.sent...
twinpiques Data Science 1 25,748 May-06-2019, 08:19 PM
    Thread: Error Message: TypeError: unhashable type: 'set'
Post: Error Message: TypeError: unhashable type: 'set'

Hello. I am attempting to compare two columns sar_details_sent_norm_trigrams_ and caap_details_sent_norm_trigrams_ in a Pandas data frame. There are other columns as well, but these are the two I a...
twinpiques Data Science 4 18,924 May-06-2019, 12:47 AM

User Panel Messages

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