Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item()
Post: ValueError: The truth value of a Series is ambiguo...

I want to calculate Accuracy based on the new compound column. The if statement is giving me an error. Error is # Importing Libraries import numpy as np import pandas as pd import nltk #nltk.down...
bongielondy General Coding Help 2 14,142 Nov-27-2019, 01:23 AM
    Thread: Referencing class
Post: Referencing class

I used VADER for sentiment analysis. However the examples I used to customise my code reference the class when printing the accuracy_score. VADER is an unsupervised learning method. Why is 'class' ref...
bongielondy Data Science 0 1,453 Nov-23-2019, 11:58 PM
    Thread: Calculate Rating Score for Reviews Containing Specific Words
Post: Calculate Rating Score for Reviews Containing Spec...

I want to calculate the average rating score for reviews that contain any of the words, 'food, buffet, breakfast, supper'. I would like to find out if the food quality affects the hotel rating. The co...
bongielondy Data Science 1 2,098 Nov-15-2019, 01:34 PM
    Thread: ValueError: Found input variables with inconsistent numbers of samples: [5, 6]
Post: RE: ValueError: Found input variables with inconsi...

The range was incorrect. The file had 6 reviews but the code was; for i in range(0, 5): I have corrected that and code works fine
bongielondy Data Science 6 25,930 Nov-09-2019, 10:57 AM
    Thread: ValueError: Found input variables with inconsistent numbers of samples: [5, 6]
Post: RE: ValueError: Found input variables with inconsi...

The full output is; Error:(5, 9) (6,) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipyth...
bongielondy Data Science 6 25,930 Nov-07-2019, 04:41 PM
    Thread: ValueError: Found input variables with inconsistent numbers of samples: [5, 6]
Post: ValueError: Found input variables with inconsisten...

I am working on a small test data. I am getting a ValueError: Found input variables with inconsistent numbers of samples: [5, 6]. How can I make the X and y shapes to be the same size. I added the lin...
bongielondy Data Science 6 25,930 Nov-07-2019, 03:26 AM
    Thread: Convert csv to tsv
Post: RE: Convert csv to tsv

I have re-written the code and not getting a KeyError on the newly converted tsv file import csv with open("../AfricanPride7.csv",'r', encoding='utf-8') as csvin, open("../output.tsv", 'w', newline=...
bongielondy General Coding Help 2 8,504 Nov-06-2019, 10:54 PM
    Thread: Convert csv to tsv
Post: Convert csv to tsv

I have converted a file from csv to tsv and get a KeyError when reading it using Python. So I want to ensure that the file was well converted. The code to convert from csv to tsv was; import csv csv....
bongielondy General Coding Help 2 8,504 Nov-06-2019, 03:32 AM
    Thread: KeyError -read multiple lines
Post: RE: KeyError -read multiple lines

Thank you. I have updated the code to for i in range(0, 1000): # column : "Review", row ith try: review = re.sub('[^a-zA-Z]', ' ', dataset['Review'][i]) ...
bongielondy General Coding Help 2 3,454 Nov-06-2019, 01:33 AM
    Thread: KeyError -read multiple lines
Post: KeyError -read multiple lines

I am new to Python. An example reviews code has single line reviews and runs well. Mine has multiple lines. I converted the csv file to tsv. The reviews file has 2 columns, Review and Liked. Liked con...
bongielondy General Coding Help 2 3,454 Nov-04-2019, 09:19 PM

User Panel Messages

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