Questions tagged as 'python-2.7'

2
answers

Dictionaries within a dictionary, python 3

I have a dictionary with lists: d1 = { 'frutas': { ' manzanas': [' verdes', ' 7', ' rojas', ' 5'], 'uvas': [' negras', ' 5', ' verdes', ' 3'] }, ' verduras': { 'papa': ['negras', ' 50', ' blancas', ' 20'], 'cebol...
asked by 15.10.2018 / 22:15
2
answers

try to simulate the command tail and head with python in windows

I'm trying to create software that simulates being the linux terminal (bash) #-*- coding: utf-8 -*- import subprocess import os def clear(): subprocess.call(["cmd.exe","/c","cls"]) def ls(): dirlist = os.listdir('.') for file in...
asked by 04.04.2018 / 02:39
1
answer

How to use python3 by default in mac?

I'm starting to use python on mac and I have a problem that I can not solve. I have installed the latest version of python 3.6.4 in macOS High Sierra. In sublime text I have installed the sublimeREPL package, with which I use the option: "...
asked by 17.03.2018 / 20:15
1
answer

Doubt about float and int

I have a program that reads me file data excel and csv and writes them in txt . The problem I have is that one of the columns that he reads are decimals and when writing them he puts them all as decimal. The issue is that I j...
asked by 15.01.2018 / 12:28
2
answers

.py a .exe Python

I'm trying to make an .exe with a .py file. I read the tutorial link and it worked perfectly. My problem is when instead of making a code as easy as the tutorial print "Hello world" I place functions such as: def main(): a = 14...
asked by 13.12.2017 / 04:54
1
answer

Get a list with the contents of a column of a csv file

I'm looking to access all the values in the ddomain field in my list and create another new list with those values. I think that with a for item in your_list it could be done but I can not find the form. with open("Top20_Media_10...
asked by 11.12.2017 / 19:07
1
answer

Matplotlib Python Values in X axis

With the following code I want you to show me a couple of other things. I want you to show me on the x axis from 0 to 23 that are the amount of data per day that there is and only shows me now 0,5,10,15 and 20. On the other hand I want that in e...
asked by 05.12.2017 / 16:00
2
answers

Use variables when formulating query to filter data from a table

I am working with Python and MySQL in a Tkinter application. I'm trying to do a search filter to only show me the entries in my table that correspond to what I entered with the keyboard but I do not know how to set it in the SQL statement. Th...
asked by 26.12.2017 / 18:46
2
answers

Excel data extraction to create Python list

I have the following excel file: connection A auto connection A camioneta connection A puerta connection B camioneta connection B puerta connection B capo and I'm looking to put together a diction in python like this: Li...
asked by 31.10.2017 / 03:45
2
answers

How to create a DataFrame from an array of listings?

How to create a DataFrame from an array of non-indexed listings by indexing it over the arrays? For example [[{'count': 6L, 'item_id': 11313}, {'count': 6L, 'item_id': 11348}, {'count': 1L, 'item_id': 11338}, ],[{'count': 4L, 'item_id': 113...
asked by 10.07.2017 / 10:38