Questions tagged as 'python'

1
answer

Try and Except in ruby

I'm learning how to program in ruby, my main language is python, so I was hesitant if there is any equivalent to try and except for python in ruby: try: print("No hubo errores") except: print("Si hubo errores") Is there something si...
asked by 10.07.2018 / 18:09
1
answer

Error importing matplotlib in python

As you can see I'm using Anaconda, and in that python environment v. 3.6.6. Just run "import matplotlib.pyplot" the application "breaks". I have searched in StackOverflow anglosajon, but nothing useful. I think it's about version problems....
asked by 24.08.2018 / 00:33
1
answer

Interval of integers in regular expression

I was solving something and I found this test and I do not understand well what is happening. Doubt is, it shows me 3456'7 'Why does 7 appear on the exit if I am delimiting [3-6] ? What is prevailing over the limit that I put in brac...
asked by 29.07.2018 / 22:21
2
answers

Multiply Python arrays

I would like to understand the flow of these loops for at each round, since according to what I understood of matrix multiplication and according to the loop: in the first round    i, j and k would have a value of zero, therefore in...
asked by 23.11.2018 / 19:01
1
answer

Function of key and lambda in functions "max ()" or "min ()", Python [closed]

I would like to understand what is the operation and the creation of "keys" or "lambdas" that can condition the max () or min () functions, applied to lists, dictionaries or tuples.     
asked by 24.11.2018 / 10:08
1
answer

Read a .json from python

I have a .json with the following structure: [ { "Country": "Spain", "Age": "14" }, { "Country": "China", "Age": "16" }, ] I try to read it with the following method: import json from pprint import pprint with ope...
asked by 19.07.2018 / 10:14
1
answer

How to use an attribute of the User model that Django has by default?

What I want to do is, be able to use the first name of the user that is registered in the database using the User model that django has by default, my idea is to use its name as a sort of selector with a foreign key, so that when I save my docum...
asked by 28.05.2018 / 22:37
1
answer

How to condition serializer? DjangoRestFramework

I have the following serializer: class PerfilSerializer(serializers.ModelSerializer): usuario = UserSerializer() seguidores = serializers.PrimaryKeyRelatedField(many=True, read_only=True) looks = LookSerializer(many=True, read_only...
asked by 16.05.2018 / 16:18
1
answer

how can I see the Tkinter library code in python

   I would like to know how the interfaces are programmed (in raw) in python, in this case how is Tkinter built     
asked by 11.08.2018 / 05:52
1
answer

how to propose the following sentence in python?

I have an algorithm in which it is stated as such and I have to execute certain commands in python as the algorithm raises so I can not modify, how can I raise the following sentence? where An is an angle, and everything with the root...
asked by 28.06.2018 / 02:13