Questions tagged as 'pandas'

2
answers

How to read a CSV file in Python and extract the maximum and minimum value per minute?

I used this code to extract the data from a CSV file, filter it and even organize it per minute, but I would like your help to create a cycle that allows me to update the information per minute, determining the maximum and the minimum value. i...
asked by 29.01.2018 / 06:17
1
answer

Error "IOError: [Errno 22] invalid mode ('w') or filename" when creating csv file

I need to convert this Python code that I use in MAC to some that I can use in Windows 10 with the same version of Python (2.7). Basically I open a csv and I load it in a DataFrame, I group by one of the columns and create a new csv for each...
asked by 08.12.2017 / 00:07
1
answer

Error "Single positional indexer is out of bounds" when reading csv

When I run the following code: from pandas import Series from matplotlib import pyplot from statsmodels.tsa.seasonal import seasonal_decompose series = Series.from_csv('GOOG.csv', header=0) result = seasonal_decompose(series, model='multiplica...
asked by 03.12.2017 / 18:56
1
answer

List times a column is repeated

Good morning! I have to obtain the number of times that a complete line appears repeated in my dataframe, to then show only those lines that appear repeated and show in the last column how many times those lines appear repetitions. This sh...
asked by 16.11.2017 / 20:35
1
answer

Pandas, selec_index.loc [] same sentence, different results when printing

I do not understand why I get so disparate results presentations with these two sentences that, in principle, are the same (ini = 0 in the script): >>> print (selec_index.loc[0, "Fecha"]) 2017-09-12 00:00:00 >>> print ("Fech...
asked by 12.11.2017 / 21:00
2
answers

Date format when importing from Excel

I am learning to work with DataFrames in Pandas. In my case, the original format in the Excel sheet is "dd-mm-YY". When importing to a DataFrame with pandas, using the statement df = pd.read_excel(file, parse_dates=['Fecha'], dayfirst =...
asked by 24.09.2017 / 23:08
1
answer

Django Sb Admin 2 Pandas

I'm doing a statistical portal, with Django and for the calculations I want to use Pandas, I'm trying to show some tables in the following way: Views.py def tabla(request): engine = create_engine('postgresql://postgres:xxxx@localhost:54...
asked by 26.09.2017 / 15:23
1
answer

Convert datetime column dataframe

Good morning, My script reads a csv with various columns. In the pandas function read_csv reads: data = pd.read_csv(filepath, index_col='Target', parse_dates=True, infer_datetime_format=True) The dataframe looks like...
asked by 21.06.2017 / 10:09
1
answer

How to categorize a dataframe with python

I am using python and pandas to sort a dataframe that I have catogorized using a column with Boolean data like the following: df: X Y PROB 2 4 False 3 5 False 3 2 False 4 4 True 3 7 True 2 4 False 2...
asked by 31.08.2017 / 21:32
1
answer

How to fill the columns of a matrix A that are in a matrix B and missing in A?

I have two matrices P and Q and I want to do a matrix calculation P*Q.T . Then I need the same number of columns. P have m_p subscriber and n_p hashtags and m_q with m_p advertisements (which we call "eclipse") per...
asked by 07.06.2017 / 15:59