Questions tagged as 'python'

2
answers

using Split in Python

In my program, my Raspberry receives a call for a GSM module and for the serial receipt RING +CLIP: "633555999",161,"",0,"",0 every time it gives a tone (I've invented the number). What I need is that of all this string that sends me, se...
asked by 19.07.2017 / 17:27
1
answer

Link Pandas dataframes with a loop

I am chaining Pandas Dataframes in the following way: import os import pandas as pd file = [file for file in os.listdir() if file.endswith('csv')] dict = {} for file in file: d[file] = pd.read_csv(file) df_A = pd.concat([dict['A_0.csv'],...
asked by 13.11.2017 / 15:48
1
answer

Validate a form with django

I'm on my first project mounted on a server and I've chosen the django framework. I'm making an application that shows values from a mineral database that I've made, and that has a search field with the form tag: <div class="container" styl...
asked by 14.11.2017 / 21:43
2
answers

List index out of range

I am writing a code in Python that lists items in an alternative way. For example: [a, b, c], [1,2,3] → [a, 1, b, 2, c, 3]. But I get an error "List index out of range". This is my code: def unir_listas_alterno(lista1,lista2): nuevaLista =...
asked by 13.11.2017 / 17:26
1
answer

Error trying to package a program with cx_Freeze

I would like to know how to convert this file .py in a file .exe since trying to generate it with cx_Freeze gives me an error when executing it: cx_Freeze: Python error in main script --------------------------- Traceback...
asked by 17.01.2018 / 23:01
1
answer

In Python Pandas how can I filter a dataFrame with part of the content of a string?

I have a dataFrame that has a column named 'linea' . I want to filter the dataFrame only with the lines that have the word "GRANEL" in its content and discard all other lines. To filter currently I use the code: lista_produccion_t...
asked by 19.01.2018 / 20:37
1
answer

Load a tree from file

I have a tree with the following structure: Which I have stored in a file, with the following content:    1 - 2 3 4 * 2 - 5 6 7 * 5 - 11 12 13 14 * 11 - * 12 - * 13 - * 14 - * 6 - * 7 - * 3 - * 4 - 8 9 10 * 8 - 15 16 * 15 - * 16 - *...
asked by 22.01.2018 / 08:19
1
answer

How to date format a field obtained from the database?

I get a field from the string type database field = 20180117 I'm trying to do something similar to this datetime.strptime(campo, '%Y-%m-%d').strftime('%Y-%m-%d-T%H:%M:%S') 2018-01-17-T00:00:00 Any ideas or sug...
asked by 17.01.2018 / 21:38
1
answer

Problems importing pyodbc module using bottle

I am working in windows and using bottle to connect to a database of SQL server , for it install pyodbc with pip install pyodbc however when I want to load the program I always get the error ImportError: No mo...
asked by 27.04.2018 / 15:44
1
answer

python.exe or py.exe in Windows? [closed]

I'm using Python 2.7 in a virtual environment, but do not let me run the python console in the normal way, but: instead of using python manage.py runserver I must use py manage.py runserver Does anyone know what it is?   ...
asked by 21.04.2017 / 07:11