Posts by Flavio Moraes • 351 points
16 posts
-
0
votes2
answers93
viewsA: Date change of a monthly average of Pandas
Okay, there are two solutions to your problem ,but only one I found suitable. It consists of making a false offset on your Dataframe in which you subtract 14 days from all dates, calculate the…
-
0
votes4
answers191
viewsA: Can you make one simpler than that?
The above solutions differ from your code by the fact that most of them change I and F, while your loop uses auxiliary variables i and j to calculate I-i keeping the information in I. In case you…
-
3
votes2
answers49
viewsA: Len and Max Float together Python
the len serves for you to get the list size and not the index of a value. What you want to do is find the maximum index, but you need to be careful because there can be more than one maximum (two…
pythonanswered Flavio Moraes 351 -
0
votes1
answer35
viewsA: There is no error in the execution of the code, however the return I am having in the excel table is that is the problem
Your problem is that your list one_cliente that was being generated in the class Cliente contained n-times the same client, with a different id. To resolve this I suggest you use a static class…
-
1
votes1
answer26
viewsA: Installation of Tensorflow by Pip
Tensorflow only works with 64bit Python between versions 3.5 and 3.8. You can check the version of your python in the terminal by typing python -c "import sys; print(sys.version) If your system…
-
0
votes1
answer162
viewsA: How can I catch checking the diagonals of a word search?
let’s assume you want to look at the diagonal from top to bottom, from left to right. You can’t do a for diagonal in ... Because there is nowhere to look for the diagonal, then we will have to start…
-
2
votes1
answer83
viewsA: How do I return a character from a string in the Python function with Websockets and json library?
Before answering your question I will try to clarify a few things about what happens in this code that apparently you do not completely master. The first is what happens when you call the…
-
3
votes1
answer129
viewsA: Concatenate large python csv files
I’m going to list some things that I know you can try to do or even combine several of them and know that there are many others. First of all ensure that you have the latest version of pandas.…
-
0
votes1
answer56
viewsA: Use drop or iloc in Machine Learning modeling in Pandas?
What happens is this, the iloc receives two parameters, lines and columns: iloc[linhas,colunas]. Lines can be a single line or more than one (the same goes for column). If it is just one you simply…
-
1
votes1
answer702
viewsA: How to draw a straight using turtle geometry?
If you do not want to exceed the screen limit, the simplest option would be to make a loop in which the turtle walks small steps while not reaching the edge: w = turtle.window_width() h =…
-
-1
votes1
answer78
viewsA: Python best student lists
you need to know the position of the grade list that has the best grade and print the student name in the same position. Just add two lines: argmax = max(enumerate(ListaNotas), key=lambda x:…
pythonanswered Flavio Moraes 351 -
0
votes1
answer60
viewsA: Image reference path in Label Tkinter
This seems to be the classic problem of 'the image does not appear on Tkinter' that occurs when you try to create an image within a function. Within the functions its variables are local, but who…
-
2
votes1
answer30
viewsA: How to include a value in a matrix by separating a digit in each column?
If I understand correctly what you want is to type a number of three digits and the program plays each digit in a column, this for each row of the matrix. Right? Then your show could be like this:…
-
0
votes1
answer243
viewsA: Error importing pandas into Jupyter Notebook
You installed Python recently, didn’t you? This is a compatibility error of version 1.19.4 of numpy with python3.9. What you need to do is a downgrade of your numpy. Open a Windows prompt and type…
-
1
votes1
answer27
viewsA: Storing values in a function to be used later
If you want this value to be stored, do your load_app() function as a class method (within the class you define def load_app (self, user): and in the end you do self.loadapp = cursor.fetchall().…
python-3.xanswered Flavio Moraes 351 -
1
votes2
answers141
viewsA: Addition of columns in csv file - Python
Your code has two problems: First your problem is happening because your dia_mes_year variable will only store the last value of the loop, it makes all your months equal. According to pandas is an…