Questions tagged as 'pandas'

0
answers

How can I create report with Python from mongoDB Excel format?

I am looking for an option to generate a document in excel format, with information from a MongoDB database using the panda module, but until now I do not get it, it only generates the empty document and gives an error Code that I use: impo...
asked by 09.08.2018 / 17:01
0
answers

Check in a pandas.Dataframe for each line if the values match with another dataframe and execute an action

I have a series of dataframes that execute orders in an automaton, the dataframe is collected from a data base that has been filled "in any way" for more than ten years, so there are thousands of records. Now we want to standardize the values...
asked by 25.07.2018 / 20:03
0
answers

Jupyter notebook. IndexingError: Unalloble boolean Series provided as an indexer (index of the boolean Series and of the indexed object do not match

I run Spyder correctly, the following script: # Selección de indicadores para paises de la CEE def indicadores_CEE (indicator_code, indicator_name, year): df_ind_CEE = data[(data.CountryCode == "ESP") | (data.CountryCode == "PRT") | (dat...
asked by 17.07.2018 / 16:18
0
answers

change column format of a pandas data frame

Hi, upload a csv file data =pd.read_csv("../temperaturas/2011/tmin/tmin2011-07/TodoJul2011.csv") but I get it in the date column with the following format: Date 1/7/2011 and I require it like this: Date 01/01/2011 ¿Cómo cambio el...
asked by 24.07.2018 / 19:37
0
answers

UnicodeDecodeError: 'utf-8' codec can not decode byte 0xd0 in position 2: invalid continuation byte

I have csv files in a folder and I want to concatenate with a few lines of code: what I do is read one at a time, save them and concatenate at the end. this is what I do data = pd.concat([data1,........,data100])     
asked by 24.07.2018 / 21:25
0
answers

Problem with the index attribute of two DataFrame

I am loading a pair of data sets, one using DataReader and the other one of a csv downloaded from yahoo finance. import datetime as dt import pandas_datareader.data as web import pandas as pd import scipy.stats as stats import matplotlib.pyplo...
asked by 03.07.2018 / 03:26
0
answers

to_json and read_json in Python Pandas

I'm trying to pass a DtaFrame or Series in Python to json format with to_json() and re-read it with read_json() , but it saves or retrieves it in the wrong format. The series that I try to convert is: pmes['ADS']['Junio']['Rentabi...
asked by 28.06.2018 / 14:52
1
answer

jupyter --InternalError: (pymysql.err.InternalError) (1054, "Unknown column 'index' in 'field list'")

I have a code in jupyter that what I want to do is insert the bd, it works well with the example that I have commented, but when doing it with the real csv, I deployed an error. import pandas as pd df = pd.read_csv('4763.csv',header=[2...
asked by 26.06.2018 / 21:07
0
answers

Error in formula of volatility with pandas

Good: I have these two lines of code where I want to calculate the returns of an action and the volatility of the action. GFG['Log_Ret'] = np.log(GFG['Close'] / GFG['Close'].shift(1)) GFG['Volatility'] = pd.rolling_std(GFG['Log_Ret'], window=...
asked by 26.06.2018 / 15:30
0
answers

Cycle for averages with Pandas, frequency every 5 minutes

Hi, I have this df. I am trying to obtain average values assigned to each hour of measured data with a frequency of 5 minutes. This is how I charge the df from MySQL: import mysql.connector from mysql.connector import errorcode import pa...
asked by 13.06.2018 / 00:45