Questions tagged as 'python'

1
answer

BINARY 32 BITS TO REAL CONVERTER

It turns out that I must convert the given binary with the following formulas, using point product for the summation. I designed this code import numpy as np #Creamos el arreglo bs que me separa individualmente los elementos del stri...
asked by 28.02.2018 / 01:36
1
answer

Get list of child nodes in XML

I have a problem with a Python exercise in which I have to use an XML file, the statement is this:    In a list we have different province identifiers, show the name of the provinces and all the municipalities corresponding to the identifiers...
asked by 15.02.2018 / 18:02
1
answer

Change attributes of html tags from a template that inherits the content from a base.html file

I have a template base.html of which the rest of my templates expand it by means of the label extends , an example of the code of the file base.html is the following: {% load static %} <!DOCTYPE html> <html> <...
asked by 26.02.2018 / 20:45
1
answer

As you attach two Python Dictionaries to another dictionary

I'm new to Python but I have a matrix of several columns column 0 has (01/02/18 to 02/28/1) the column in column 2 I have ('8-6 ENL TIC-DZT', '4-2 ENL PLD-STA-NRI ',' 6-12 ENL ALT-TMO ',' _0-16 MALPASODOS-TABASCO ',' 3-1 ENL MAN ',' 4-7 CHO 4...
asked by 16.02.2018 / 18:37
1
answer

Copy data and formats of an excel sheet python

I have the following problem, when I want to copy the data of an excel sheet and besides its formats, I only copy the data. import pandas as pd template = pd.read_excel('Template_sugerencia.xlsx', sheet_name='template') writer = pd.ExcelWrite...
asked by 16.02.2018 / 21:26
2
answers

Filter queryset by group

I have a model called ColaNotificaciones. class ColaNotificaciones(models.Model): class Meta: unique_together = (('remitente', 'destinatario', 'asunto','producto'),) remitente = models.CharField(max_length=20) destinatario...
asked by 12.02.2018 / 11:50
1
answer

Draw polygon and point

I'm calculating the distance between a point and a polygon from shapely import wkt polys = ('POLYGON((-58.612406970999984 -34.55196600599993, -58.61272573499997 -34.552244351999946, -58.611851334999983 -34.552907077999976, -58.611473561999958...
asked by 05.04.2018 / 16:25
1
answer

how can I sort the following data using regex in python?

I have a file that has the following structure: Nombre1 = Funcion(New func("")) 'comentarios Nombre2 = Funcion(New func("")) 'comentarios Nombre3 = Funcion(New func("")) 'comentarios I need that where there is double quote or double quotes,...
asked by 12.03.2018 / 15:04
2
answers

Remove items from lists in the dictionary

I have the following code which is a dictionary with lists inside. What I want to do is erase a certain element from all the lists. For example: delete everything in position 2 of each list (bike, 2 and C). dicc={} dicc['lista1']=['coche',...
asked by 02.02.2018 / 11:42
1
answer

In python 3 and Pandas, how to add data from a dictionary to a dataFrame, only if they do not exist?

In my Python script I have generated a dictionary with several data, which I want to add to a CSV file, only if the dictionary keys do not exist inside the file, or if they exist then they are overwritten so they do not duplicate . How can I...
asked by 31.01.2018 / 21:45