Questions tagged as 'python'

2
answers

Operations between elements of different Python lists

I need to perform a division operation between items from two different lists. import pandas as pd df = pd.read_csv('este_mes_subastas2.csv', sep=',') a = list(df['Subastas']) b = list(df['Impresiones']) print a >>> [39496098, 828...
asked by 14.01.2018 / 20:59
1
answer

Get common elements from two lists without repetitions

I have to implement the following statement:    Design a function that receives two lists and returns common elements to   both, without repeating any (intersection of sets).   Example: if you receive the lists [1, 2, 1] and [2, 3, 2, 4], you...
asked by 08.01.2018 / 13:47
1
answer

Delete rungs from a Python csv

With the following code I convert an XLSX into CSV. I need to delete the first 10 lines of the resulting csv. How could I do it? # encoding=utf8 import sys import xlrd import csv reload(sys) sys.setdefaultencoding('utf8') def csv_from_excel...
asked by 20.12.2017 / 18:17
1
answer

Unable to call the "list" object when using Session.add_all [closed]

I am inconvenienced with this code generates me error:    id_ccf = input ("Type the name of the CCF"))])   TypeError: 'list' object is not callable I do not understand why, I do not have any object named 'list'. This is the relevant part...
asked by 14.12.2017 / 01:45
1
answer

Refresh in current date fullcalendar

I am working with full calendar but I have a problem, my calendar has data since 2016, and it is required to change several of the events, implement the edit event, all good, but the problem is that when I save a data and I'm in 2016, the page i...
asked by 08.12.2017 / 19:17
1
answer

List of CSV lists in Python

Through the CSV that I leave at the end of the code I get the information that will be modified with my code. The problem is that when I have the information I want and I want to save it in a new CSV I can not because I only copy the first row o...
asked by 07.12.2017 / 15:07
1
answer

How to know accounts lines have a csv file?

I want to know stories lines I have in a csv file with a tab delimiter. I try the following in a file countRowsCSV.py : import csv with open('archivo.csv',"r") as f: reader = csv.reader(f,delimiter = "\t") data = list(reader)...
asked by 02.12.2017 / 20:58
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