Questions tagged as 'pandas'

1
answer

Import csv as float

Good morning! I have the following problem, I'm importing a base for python, but I can not manipulate it (average), because it's like str, I need to import all the values to come as float. data = pd.read_csv ('C: \ path \ df.csv', index_co...
asked by 07.07.2018 / 14:48
1
answer

Stack multiple txt files using pandas

I wanted to do a routine that accumulates the data I extract from google analytics every day, but my code has an error that I can not solve: import pandas as pd import os import glob my_dir = 'N:/E-Commerce/Relatorios/Bases/Source/Canais' fil...
asked by 26.06.2018 / 23:46
0
answers

As the pandas reads timestamp data and converts to HDF5 (HDF5)

I am creating a C # application that generates a hdf5 document in which one of the columns in the dataset is a timestamp (using unix), and I would like this file to be read by the pandas so that it reads the timestamp as a datetime64 (which is t...
asked by 14.06.2018 / 20:07
1
answer

How to save in CSV or Excel a table generated from another table with pandas or pivot table?

I have a table with data for several years from 2000 to 2015 in CSV format. In my code I ask the user to type a year that he wants to see and return on the screen only the years he requested. Ex .: 2000. And I want this data to be saved in a...
asked by 24.06.2018 / 23:19
2
answers

Customize / set the order X axis graph bars matplotlib

I generated a chart, with values for each year, from 2011 to 2015. but the generation of the graph, on the X-axis, the years are grouped according to the values, are not in the correct sequence (2011, 2012, 2013, 2014, 2015). What command can I...
asked by 07.06.2018 / 04:36
0
answers

Interaction with pandas

import pandas as pd import numpy as np df = pd.read_excel('resultados.xlsx') df Con b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 1 30 22 2 1 17 8 4 19 20 11 14 6 21 7 23 3 2 29 13 14 6...
asked by 21.06.2018 / 04:36
0
answers

Raise XLRDError - Indicating name of Python Sheet_name

Good morning. I'm starting with Python and I have a problem. I have N files in Excel and I need to read the sheet_name of each one stating their name, the code I have so far is this: os.chdir("work path") fileLista = glob.glob('*.xls') arqFine...
asked by 21.05.2018 / 16:57
0
answers

PANDAS WHILE COM STRING

Hello, I'm trying to loop through a column of my DataFrame and return the row amount of it giving a limit to go through to 'Prov' I'm using for for looping through the column and using while to return line values, but this one giving error for be...
asked by 15.05.2018 / 20:43
1
answer

How to add a sheet to a pre-existing xlsx file with pandas?

Follow my attempts. And still unsuccessful. import pandas as pd def data_frame(): return pd.DataFrame([{'link': 'http://brito.blog.incolume.com.br', 'title':'Blog'}{'link':'http://google.com', 'title':'Pesquisa'}]) def toExcel0(): d...
asked by 16.05.2018 / 20:29
0
answers

How to create dataframe in pandas from series with dictionaries?

In Python3 and pandas I have a series with lists. In each line of the series there is a list, with dictionaries inside. It was obtained from a file: import pandas as pd geral = pd.read_csv("mandados_12_abr_2018_RJ.csv",sep=';',encoding = 'lat...
asked by 13.04.2018 / 14:53