Most voted "pandas" questions
Pandas is an open source library, which provides high performance data structures and data analysis tools for the Python programming language.
Learn more…646 questions
Sort by count of
-
0
votes0
answers27
viewsIteration of DF’s in pandas
This is guys speaking. Assuming I have a df1 with only one ID column, and another df2 with information I want to register in that df1. But I need q each id of df1 repeat for all df2 information For…
-
0
votes2
answers280
viewsReplace use of dataframe with pandas . apply
I have a function that iterates a spreadsheet, which makes some controls. I looked over and saw about . apply, but I couldn’t implode. I would like to know if you could in that case, replace the use…
-
0
votes1
answer83
viewsComplete values in a table, with values of the table itself?
I have the table data ativo valor ajuste arquivo 17/07/2020 teste1 4,35 nan 9032800000190015197.txt 16/07/2020 teste1 nan nan 9032800000190015197.txt 15/07/2020 teste1 3,12 nan…
-
0
votes2
answers174
viewsHow to create class correctly with pandas by applying methods?
I have a 'data.csv' file, with the data below: turma,nome,code,motivo,atividade,trofeus,data 9º Ano Fundamental A,Maria Joana,9X4YK,Realizar atividade Astromaker,Lição A,3,21/02/2020 11:44:11 9º Ano…
-
0
votes0
answers32
viewsInclude the frequency table in the Dataframe (range of values)
Hello! I have a dataframe with several prices. I calculated the amount of ranges (Sturges) and would like to include in a column in which range that price fits. The expected exit would be something…
pandasasked 4 years, 2 months ago Daiane Klein 3 -
0
votes0
answers206
viewsshow more Abels(xticks) on x-axis in Pandas/Pyplot charts
Hello I have this data in a CSV file (here only two lines were written, but the real file has several). Ano;Mes;Valor;Qtde;Tipo 2013;01;3982168388.81;562405;C 2014;01;4332471647.33;570833;C When I…
-
0
votes1
answer278
viewsRelate two Dataframes in pandas and return value in python
I have two Dataframes, both in csv that import in pandas, one with the history of protocol records and one with a list of people authorized to make changes in the records of procotolos. How can I…
-
0
votes1
answer202
viewsHow to generate a horizontal multiple graph using python
Good afternoon, I’m doing a job for the college where I need to generate a multiple graph in horizontal bars. I’m using the following code: df_escolaridade['Espacialidades'] =…
-
0
votes1
answer74
viewsPython - How to get the date of the last Google Spreasheets update?
Personal talk! Next, I needed to check if there were any updates to the Google Spreasheets shared document. I thought I’d bring this field: as a date or as a timestamp in python and check with the…
-
0
votes1
answer53
viewsFilter Dataset from a groupby
I have the following dataframe (df_reviews) and need to remove the App versions that were downloaded less than 10 times and tried to do the steps below and a for to perform the filter on the…
-
0
votes2
answers66
viewsPython - Create dynamic variable for firebase
I have a code that you receive from a spreadsheet CodProduto, Descrição and Quantidade and then inserts them into the database. Only it does this 1000x looping. How can I create variables with this…
-
0
votes1
answer33
viewsAttach only one line to a CSV file with pandas
I am making a login system using very basic csv tables, because it is not the purpose of the program. def criar_conta(self, respostas): framelogin = pd.read_csv('C:\TCC\Aplicacao\Arquivos…
-
0
votes1
answer308
viewsHow to create a condition for each dataframe subset in pandas?
I wrote the following in order to create a condition for a subset of a dataframe in which case the cell value is higher than the average of that same subset(in this case the initial subset is small…
-
0
votes2
answers509
viewsFilter data from a Dataframe pandas by a specific column and the last four dates of a set of dates
I have 2 dataframes in Pandas where: Data Frame A - contains information of the available time of announcements in each program DFTmpDisp sinal cod_programa data tempo_disponivel 0 SP1 XXXX…
-
0
votes0
answers48
viewsHow to set the columns in Sklearn’s Onehotencoder?
I’m having a small problem making an ML code for sorting set when using Onehotencoder to perform categorization. I am following a course that used the resource in the following way: dados =…
-
0
votes0
answers49
viewsCreating new dataframes and using merge
I used yahooquery to import a historical data series of 100 exchange-traded assets. I created a dataframe with this data for a period of 6 months: df = tickers.history(period='6mo', interval="1d") I…
-
0
votes2
answers312
viewsHow to fill a column of a DF Pandas using, as a comparison, a specific column between this and another DF?
I have a Pandas dataframe, in which I need to add a new column called codprojeto. To do this, I created this new column and inserted zeros, so that it has the type int64, as follows:…
-
0
votes0
answers43
viewscreating a dataframe from pairs of columns in Python
Using the yfinance library I imported data from a list of 80 assets: tickers=['xxx','yyy'] data = yf.download(tickers, start="2020-01-01", end="2020-12-04") data = data['Close'] I used a function…
-
0
votes1
answer204
viewsError while trying to import pandas data into Jupyter Notebook
I am trying to import data using pandas, but I always get the following error: File "<ipython-input-15-fb05c39e0291>", line 1 temperaturasDasCidades =…
-
0
votes0
answers51
viewsError renaming columns in dataset using pandas
While trying to rename the dataset columns using pandas, SyntaxError: expression cannot contain assignment, perhaps you meant "=="? Below the error with the line of code I’m using: File…
-
0
votes2
answers63
viewsIs there any way pd. Grouper, how much used for time frequencies, adds lines even when there are no records in a time interval?
I need to merge between two tables where the base table is grouped at 5 minute intervals, however in an interval that has no record to be grouped the corresponding row is not created I am dealing…
-
0
votes1
answer122
viewsAdd a new column in a Dataframe after comparing data with another Dataframe?
I have a dataframe df_currency and need to insert new column based on comparison with another dataframe df_quotation. Below I have dataframe only with the names of coins:…
-
0
votes0
answers51
viewsError generating python exe with pandas-gbq
I am trying to convert a font to exe. Type the command: pyinstaller --onefile arquivo.spec Shows that it was performed successfully, but when I click on exe, the message appears ImportError: Missing…
-
0
votes1
answer227
viewsDataframe Pandas - Apply the groupby of a column to other rows
Hello, I have a dataframe with a 'Time' column and 6 other columns. I only need data based on duplicate values of 'Time'. So, I already used groupby and created the "Pico" column which is where the…
-
0
votes0
answers70
viewsPython error: Typeerror: 'numpy.float64' Object is not iterable
I am having the following problem when compiling this program in google collab: Typeerror: 'numpy.float64' Object is not iterable He points out the error in the line…
-
0
votes0
answers47
viewsIn Python, how to delete " n" from . txt files?
I’m at Jupyter Notebook working with Python. I am importing the txt files with the following code: allLines = [] path = '../data/txt/' fileList = os.listdir(path) for i in fileList: file =…
-
0
votes1
answer113
viewsError when using If parole
I am trying to analyze the data from the following table. This is a Trades record just to make it clear. DATAFRAME: def lista_preco(): #ainda falta resolver os trades depois de 19h lista_dias =…
-
0
votes1
answer85
viewsPython/Pandas: Treatment of TXT
The ERP I’m working on is generating a . txt in the following format: ID:;1;Evento;Estado;Serial;Qtde VM;LIBERADO;471;2 Data;id_m;id_c;Data inicial;Data final 01/01/2021…
-
0
votes2
answers45
viewsHow to create independent dataframes in Python
I have a problem in python, as I create independent dataframe? What can I think of: >>> PREMISSAS['QTD_ESTOQUE_MEDIO'] 0 628.5 1 20202.5 2 42902.0 3 50036.0 4 8561.5 ... 12646 14356.5 12647…
-
0
votes0
answers35
viewsData structure, bag of words, doubts about code structure
Hello! I am studying feeling analysis for the conclusion of a scientific initiation, whose theme is "The influence of social networks on the financial market" In the code are present twitter data…
-
0
votes1
answer202
viewsHow to add columns of different pandas dataframes?
I am trying to add columns between two tables "daily" and "monthly" as a way to update the columns "sum" and "Count". However, for some lines the sum returns empty. The file "diario" has 4800 lines…
-
0
votes1
answer81
viewsPython 3 - CSV to Excel conversion problem with list output
Good afternoon. I am facing a problem while converting a CSV file to an Excel file, via openpyxl. The code structure aims to convert a PDF to Excel, and paste the PDF information into a Sheet from…
-
0
votes2
answers63
viewsHow to add a new column with the group average in pandas?
I’m trying to insert a new column with average home goals per team . I calculated the average, but I cannot insert this value in a new column. database: https://www.football-data.co.uk/brazil.php My…
-
0
votes0
answers59
viewsnp.savetxt No download file CSV(Jupyter Notebook)
I developed a code to help me analyze data faster than I’ve been doing before. All the development was adapted to Jupyter Notebook used in Google Chrome, this because the company I work does not…
-
0
votes2
answers43
viewsmove data left in pandas
import pandas as pd import numpy as np import matplotlib.pyplot as plt from unicodedata import normalize tabelas =…
-
0
votes1
answer343
viewsImport CSV files from Drive into Google Collab
Good afternoon, I’m having trouble importing the files in csv to the collab. Keeps popping up the same error message that my files cannot be located in the folder I specified (and they are there) I…
pandasasked 3 years, 9 months ago Luis Henrique Batista 46 -
0
votes1
answer38
viewsHow do I convert string values or items from an object column into binary with pandas?
I’m trying to convert a column into a data set where there is 'negative' and 'positive' for binaries or numeric items like 0 and 1, but I don’t know if I’m doing it right with the Pandas library.…
-
0
votes1
answer66
viewsFilter a header inside df in pandas
I’m new to pandas and I’m having a hard time. I need to filter the columns in my dataframe, check if they are in a defined list and, if they are, group the columns and add up the values. It sounds…
-
0
votes1
answer203
viewserror while opening . csv file with/ python/ pandas
I am new to the language and I am using Python 3 in jupternotebook inside anaconda. I followed the steps below. But it’s making a mistake I can’t decipher, please help me setting the work directory…
-
0
votes0
answers44
viewsWhy does the comma disappear when converting an HTML to str in Python?
I’m extracting some data from a scraping page following a tutorial I saw on Youtube. Follow the code: import requests import pandas as pd from bs4 import BeautifulSoup from selenium import webdriver…
-
0
votes0
answers70
viewsWould anyone like to explain why this came up"Exception has occurred: Missing optional dependency import 'xlrd'"?
I’m using vscode to use pandas in python My code from IPython.display import display import pandas as pd df = pd.read_excel(r"Vendas.xlsx") display(df) and I got this information on the line of "df…
-
0
votes1
answer142
viewsDoubt Column Label - Seaborn Python
I have a Doubt when Plotting a chart in Seaborn, where the label of the Axis of Column is very large However, I would like to "break" this line in 2, or 3 Lines, to get smaller the label box and…
-
0
votes1
answer77
viewsRemove row and column numbering from the Dataframe of an Array
I am making a program that reads a table in CSV and transforms it into an array in python using pandas, I was able to transform it but Dataframe numbered the rows and columns and I wish to delete…
-
0
votes1
answer321
viewsI need to add some specific lines in a data frame
I need to add the value of the lines in which appears "Resposnsável C', in a practical way I need to add lines 3, 4 and 9 from column 2, the result should be 112. So far I’ve been able to print the…
-
0
votes2
answers45
viewsValue Replace with Python and Pandas
Hello, I’m trying to remove a character from a base that I extracted from a TXT file, I loaded the file with pandas but I can’t remove it using replace command, below the values I have in a certain…
-
0
votes1
answer32
viewsCalculating difference between first and last line in a dataframe pandas
I have a pandas dataframe with five rows 3 three columns. I want to create a function where my code returns columns where the last row is larger than the first row. In the example of my code I want…
-
0
votes1
answer100
viewsSelecting a column from a conditional loop in a pandas dataframe
I have a pandas dataframe with five rows 3 three columns. I want to create a function where my code returns which columns the value of the last row is greater than the first row. In the example of…
-
0
votes1
answer51
viewsIncorrect value of Agg Mean
I need to get the same result of the media, fashion and average of this table Televisores/dia Freq. absoluta 0 |----- 20 5 20|----- 40 25 40|----- 60 40 60|----- 80 15 80|----- 100 10 100|----- 120…
-
0
votes1
answer24
viewsEmpty table ("Empty Dataframe") and ambiguity of comparison in Pandas
Hello, I’ve been trying for a few days to set up a program, the bulk of it is working but there are two demands that do not come true at all. who are they: Amount and total amount of tests involving…
-
0
votes2
answers392
viewsI need to join several excel files in a single split into python folders. I did this method but wanted to create a function:
I made this function that receives the destination directory and the month that was generated the reports, I wanted to make it smaller using a for that goes through this list: ufv_name = ['CB1',…