Questions tagged as 'pandas'

1
answer

How to filter, select and count data in a pandas.DataFrame?

How to get multiple records based on multiple columns of a given name? My dataframe looks something like this: import pandas as pd df = pd.DataFrame([["1111", True, True, False, True, True], ["2222", True, False, True, T...
asked by 24.09.2018 / 19:01
2
answers

Grouping table

I have this table and would like to set up a list or another table users_ID_User Material Rating 0 A "Hey Pogo!...from citation to fulltext" 5 1 B...
asked by 28.08.2018 / 02:44
1
answer

Error TypeError: a float is required

This is my code: ### BIBLIOTECAS import scipy.special as sps import numpy as np import matplotlib.pyplot as plt import pandas as pd import scipy as sp from scipy.stats import norm from scipy.stats import gamma from math import exp import oper...
asked by 23.12.2016 / 13:16
1
answer

Find the most repeating value

I'm trying to analyze a shoe sales data, but I'm having a hard time creating a function to find the number that the customer bought the most in the previous year. I have a table with this data: Cód. Cliente CPF Nome...
asked by 29.08.2018 / 19:46
1
answer

Problems with incorrect data in a dataset (using Pandas)

I have a dataset called Auto.csv, which has the form: mpg cylinders displacement horsepower weight acceleration year origin name 18 8 307 130 3504 12 70 1 chevrolet chevelle malibu 15 8 350 165 3693 11.5 70 1...
asked by 28.05.2018 / 00:41
2
answers

How to compare if the contents of two string columns of a data frame are similar

I have a date frame where I need to compare how much the contents of two columns look like. For example: coluna a = “José Luiz da Silva” and coluna b = “José L. Silva” . How can I do to indicate that column a and column b are sim...
asked by 01.07.2017 / 03:42
1
answer

Grouping of groupby pandas table

I have a table in this format User Material Nota 1 youtube 5 2 facebook 4 3 facebook 3 4 facebook 5 6 youtube 2 7 orkut 3 8 twitter 4 and would like to group so that in th...
asked by 17.07.2018 / 17:10
1
answer

How to correctly use the styling of pandas?

Python code From the examples from documentation the following code was created: import pandas as pd import os import webbrowser import io def highlight_max(s): ''' highlight the maximum in a Series yellow. ''' is_max = s...
asked by 18.12.2018 / 20:04
1
answer

Adding a new data to an empty pandas dataframe

I am creating a code to read several CSV files and extract some parameters and mount a new dataframe with pandas, however I am facing a problem in this construction. Initially, I wanted to create an empty dataframe and as I read the CSVs I wo...
asked by 18.11.2018 / 19:36
2
answers

DataFrame Pandas - Calculate column based on other

I have a dataframe in the following format: colunas = [ 'COMEDY', 'CRIME', 'Classe Prevista' ] precisao_df = pd.DataFrame(columns=colunas) precisao_df['COMEDY'] = y_pred_proba[:,0] precisao_df['CRIME'] = y_pred_proba[:,1] precisao...
asked by 31.10.2018 / 05:31