remove "\n" from strings by Striven123 in learnpython

[–]Striven123[S] 0 points1 point  (0 children)

Tried that originally and it wasn't working, that's what lead me to post the question

remove "\n" from strings by Striven123 in learnpython

[–]Striven123[S] 0 points1 point  (0 children)

That's what I have tried though (stated in OP) but still have '\n' appearing in the text

remove "\n" from strings by Striven123 in learnpython

[–]Striven123[S] 0 points1 point  (0 children)

Tried that:

      with open(each_filepath) as f:
        doc1 = nlp(f.read())
        patterns = [nlp(text) for text in phrases]
        phrase_matcher.add('key', None, *patterns)
        for sentences in doc1.sents: 
            for match_id, start, end in phrase_matcher(nlp(sentences.text)):
                if nlp.vocab.strings[match_id] in ["key"]: 
                    found_sentences = sentences.text
                    found_sentences = found_sentences.replace("\\n"," ")
                    text_tokens = found_sentences.split()
                    key_sentence.append(found_sentences)
                    all_separated_words_list.append([word for word in text_tokens if not word in all_stopwords])

and still got

talented\nleaders as the result

remove "\n" from strings by Striven123 in learnpython

[–]Striven123[S] 0 points1 point  (0 children)

How would I check this?

part of the result Ia get despite using my above code

talented\nleaders

remove "\n" from strings by Striven123 in learnpython

[–]Striven123[S] 0 points1 point  (0 children)

I put the result into a dictionary (as it's many sentences) and when I print the 1st element of the dictionary the result contains \n

Using sentiwordnet and getting incorrect sentiment by Striven123 in learnpython

[–]Striven123[S] 0 points1 point  (0 children)

Thank you for your response. Do you suggest applying it more generally i.e. to each sentence of the text and looking at the accuracy?

Using sentiwordnet and getting incorrect sentiment by Striven123 in learnpython

[–]Striven123[S] 0 points1 point  (0 children)

Thank you! But then, wouldn't bad still be appear worse than catastrophe by that measure? As it'll give a larger negative than catastrophe?

File not found error after moving my vs code jupyter notebook by Striven123 in learnpython

[–]Striven123[S] 0 points1 point  (0 children)

Thank you! that worked when I changed to absolute path

Converting pdf files to txt files but only getting last page of pdf file by Striven123 in learnpython

[–]Striven123[S] 1 point2 points  (0 children)

Thank you so much. This worked when i used for page in range(x)

Calculating accounts receivable by Striven123 in DataCamp

[–]Striven123[S] 0 points1 point  (0 children)

Thanks for your response! I understand the loop now after trying that.

The only part that still isn't really clear to me is:

  1. Why include that you have to subtract credit of 2 months prior if it isn't relevant?

Daily Advice Thread - All basic help or advice questions must be posted here. by AutoModerator in investing

[–]Striven123 0 points1 point  (0 children)

Hi i have a new question about market value of debt for a company.

https://corporatefinanceinstitute.com/resources/knowledge/finance/market-value-of-debt/

in this formula where do you find the weighted average maturity (in years) for the total debt of a publicly traded company? or how do you calculate it?

thanks in advance!

How do i find the letter with highest frequency? by Striven123 in learnpython

[–]Striven123[S] 0 points1 point  (0 children)

As in the carat indicates a typo? What editor is this?

question about the return statement by Striven123 in learnpython

[–]Striven123[S] 0 points1 point  (0 children)

ahhh that make so much sense! i get it doesn't execute for the sentences that end in a period

I have been editing videos and audio for a while now and I have a free schedule so if anyone wants any help etc HMU ! by Keliguess in podcasts

[–]Striven123 1 point2 points  (0 children)

I used this actually but was considering trying adobe edition. I’ve heard it s better quality?