• Register

Recent questions tagged pandas

0 votes
1 answer 3 views
Problem: I am currently trying to build a naive Bayes classifier. Referring to the line X_new_tfidf = tfidf_transformer.transform(X_new_counts) under the Training the Classifier subheading, I had a similar line, X_new_counts = count_vect.transform(input.plot_movie) in my code which ... that input.plot_movie is of type unicode and decided to convert it to a string. I encounter the same error again.
asked 1 day ago jamuna1 30.2k points
0 votes
1 answer 3 views
Problem: I am using tensorflow's models. I set up environment by seeing this web site.It was success until Add Libraries to PYTHONPATH. But when I run python object_detection/builders/model_builder_test.py in models/research directory,AttributeError: module 'pandas' has no attribute 'computation' What should I do to fix this?What is wrong in my code?
asked 1 day ago sumaiya simi 43.9k points
0 votes
1 answer 5 views
Problem: "Boolean Series key will be reindexed to match DataFrame index. from ipykernel import kernelapp as app" After searching for a solution people suggested I used '&', but after using that I get a other error..menu_sub= menu[menu["Trans Fat"]==0 & menu["Cholesterol (% Daily Value)"]= ... item(), a.any() or a.all(). Is there a way to do this in one line? or do have to create 3 different lines?
asked 1 day ago sumaiya simi 43.9k points
0 votes
1 answer 3 views
Problem: I am using tensorflow's models. I set up environment by seeing this web site. .It was success until Add Libraries to PYTHONPATH. But when I run python object_detection/builders/model_builder_test.py in models/research directory,AttributeError: module 'pandas' has no attribute 'computation'What should I do to fix this?What is wrong in my code?
asked 1 day ago sumaiya simi 43.9k points
0 votes
1 answer 2 views
Problem: I am learning Python to put together a project for web-scraping skills. I am having trouble downloading a table for football statistics. I am getting the following error:FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?Any help great appreciated.
asked 2 days ago Humaira ahmed 50.7k points
0 votes
1 answer 5 views
Problem: I have two dataframes df1 df2with the same numbers of rows and columns and variables, and I'm trying to compare the boolean variable choice in the two dataframes. Then use if/else to manipulate the data. But something seems wrong when I try to compare the boolean var.Can anyone explain more in detail please ?
asked 2 days ago Humaira ahmed 50.7k points
0 votes
1 answer 6 views
Problem: I'm trying to delete the first 24 rows of my pandas dataframe. Searching on the web has led me to believe that the best way to do this is by using the pandas 'drop' function. However, whenever I try to use it, I get the error: AttributeError: 'numpy. ... should do to delete the first 24 rows of my dataframe. (This was all done using Python 3 on a Jupyter notebook on my local machine)
asked 2 days ago muktaa 34.4k points
1 vote
1 answer 3 views
Problem: I have a query which returns about 20 columns , but i need it to be distinct only by one column. my data looks something like that Copy Code id val1 val2 val3 1 33 m k 1 32 m k 2 34 j v 4 47 h l the result should be Copy Code id val1 val2 val3 1 33 m k 2 34 j v 4 47 h l I have Select Distinct id, val1, val2, val3 FROM table1 Group by doe not work either...
asked 3 days ago PkGuy 23.5k points
0 votes
1 answer 2 views
Problem: I have build a model with sklearn Naive Bayes classifier. I need to know how to predict a sentence with input when i just hardcode the sentence its work fine, look like this new_sentence = ['its so broken'] new_testdata_tfidf= tfidf.transform(new_sentence) ... predict it. the classificaiton out, the class is -1 which is the correct answer How to resolve this? any help really appreciated.
asked 3 days ago Humaira ahmed 50.7k points
0 votes
1 answer 4 views
Problem: colleagues! I have panel data: Company year Beta NI Sales Export Hedge FL QR AT Foreign 1 1 2010 -2.2052800 293000 1881000 78.6816 0 23.5158 1.289 0.6554 3000 2 1 2011 -2.2536069 316000 2647000 81.4885 0 21.7945 1.1787 0.8282 22000 3 1 2012 0.3258693 ... ), R does not show the error, but it's significant to stay NA data and companies in the data. Please, tell me to do with this problem
asked 5 days ago Yeamin 21.4k points
0 votes
1 answer 2 views
Problem: I have a dataframe that consist of hundreds of columns, and I need to see all column names. What I did: In[37]: data_all2.columns The output is: Out[37]: Index(['customer_id', 'incoming', 'outgoing', 'awan', 'bank', ... ', 'overdue_3months_feature86', 'loan_overdue_3months_total_y'], dtype='object', length=102) How do I show all columns, instead of a truncated list?
asked 5 days ago muktaa 34.4k points
0 votes
1 answer 4 views
Problem: I am stuck now .. need some suggestions .. please help me .. Can only compare identically-labeled dataframe objects
asked Apr 26 Ifra 34.7k points
1 vote
1 answer 5 views
Problem: I need solution of this error; Valueerror: numpy.dtype has the wrong size, try recompiling.
asked Apr 26 PkGuy 23.5k points
0 votes
2 answers 6 views
Problem: I want to extract "Twitter for iPhone" part from this string. But I have different values in the place of "Twitter for iPhone" in 1000s of columns in a dataframe. I only need the values after ">" and before "<" from the following set of strings. ... for Samsung|Twitter for others)') which extracts only those 'Twitter for iPhone' values but not the others and the rest are filled with NaNs.
asked Apr 26 anika11 32k points
0 votes
1 answer 3 views
Problem: Trying to read CSV file using pandas in Pycharm for a python project. Getting an error when i run the code I tried all the past solutions like adding "r" or double slash or mentioning the encoding. It doesnt seem to work Using ... \parsers.pyx", line 686, in pandas._libs.parsers.TextReader._setup_parser_source UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0-
asked Apr 25 ochena 22.1k points
0 votes
1 answer 10 views
Problem: When I tried to read a pickle file that saved by a former version of pandas, it yielded an ImportError. ImportError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a package There was no hit on stackoverflow so i would like to share my solution for this particular problem.
asked Apr 25 sumaiya simi 43.9k points
0 votes
1 answer 20 views
Problem: I've got some order data that I want to analyse. Currently of interest is: How often has which SKU been bought in which month? Here a small example: import datetime import pandas as pd import numpy as np d = {'sku': ['RT-17']} df_skus = pd.DataFrame(data=d) print ... ? Or I'd be even fine with loosing the data of a sale here and there if I can just 'skip' over the error, is this possible?
asked Apr 24 ochena 22.1k points
1 vote
1 answer 13 views
Problem : I want to know > How to deal with SettingWithCopyWarning in Pandas
asked Apr 24 Abik Dey 4k points
0 votes
1 answer 15 views
Problem: I am trying to try pandas methods in a csv file I've made which looks like: Location Time Number Seoul Nov.11 5 Jinju dec.22 2 wpg 3 june.6 2 something like this. It is giving me an error message in the title. How can I fix this and what position is it referring exactly?
asked Apr 24 Humaira ahmed 50.7k points
1 vote
1 answer 13 views
Problem: Any one here to help me with this please? The result of the sum of the elements present in each row or column of the grid is always the same.
asked Apr 23 PkGuy 23.5k points