Questions tagged as 'pandas'

1
answer

string treatment in pandas

Good Night Sirs, I have the following Dataframe, imported from an xlsx. NUM_LEGISLACAO DSC_URL COD_SITUACAO ... DSC_TIPO num ano 264 89.272/1984 NaN 2.0 ... NORMATIVO 89.272 1984 265 90.396/1984 N...
asked by 15.06.2018 / 17:58
1
answer

Get range of values in pandas object.Dataframe

I have a pandas.Dataframe object with a date field of python. How do I get a recordset according to date range? An example of the data set (last 10 records): datpre codneg nomres modref preabe premax premin preult \ 153...
asked by 28.09.2017 / 14:49
1
answer

Change of sign of values in Pandas DataFrame

Hello, good evening. I have a set of vectors whose components (px, py, and pz) are stored in a Pandas DataFrame. I have written a function whose purpose is to change the signal of the vector components if the following condition is observed:...
asked by 03.12.2018 / 23:39
2
answers

Calculate how many NaN in each Python time

Good morning, I have a DF where you have NaN and I need to count how many NaN I have in each time. My df has a period of 31 days. I think I should use Groupby, but I'm not finding a way. import numpy as np import pandas as pd df...
asked by 17.03.2017 / 15:34
2
answers

Split a worksheet into several worksheets

I have a spreadsheet with 5000 rows that needs to be split into spreadsheets with 790 rows at the most. How can I do this ??     
asked by 26.05.2017 / 04:20
1
answer

How to store the result of an iteration in a new variable using python?

Good morning everyone! I'm parsing a conjunto de dados de compartilhamento de bicicletas . In this dataset there is a column named 'birthyear' , which indicates the year the user was born. I'm trying to turn this column...
asked by 09.09.2018 / 15:35
1
answer

Import and manipulate json in Python

I'm trying to import an .json file with the following structure: short_description:She left her husband. He killed their children. Just another day in America. headline:There Were 2 Mass Shootings In Texas Last Week, But Only 1 On TV date:201...
asked by 30.10.2018 / 00:15
1
answer

Select data from a worksheet

I read data from a spreadsheet using Python 3 libraries (xlrd / xlsxwriter / Pandas and Numpy). This worksheet has in the lines questions of the survey and in the columns the areas that answered the survey. Each sentence has a note, ranging from...
asked by 24.11.2017 / 01:02
2
answers

Python fill values with data from other rows

Good morning, I'm having a big data failure problem on my df . I need to find the CO2 value similar to another time using conditions I can not do with the line information. I have df of 1 year with values of 30 em 30 minut...
asked by 21.03.2017 / 14:13
1
answer

Transform query into dataframe [sqlalchemy + pandas]

I'm new to python and want to create a function that queries the database [mysql] and converts it to a dataframe so that it can be emailed in .csv format later. But I'm having trouble with this query conversion to the dataframe. Here's my...
asked by 06.10.2015 / 20:42