Posts by Claudio Gonçalves Filho • 199 points
10 posts
-
2
votes1
answer1399
viewsA: Creating a bar graph to compare data
Good afternoon Victor, all right? Following this code provided by the matplotlib site : Matplot Barplot Tutorial We can see that it defines the index as a fixed value, in the case of 5(variable N)…
-
0
votes2
answers1542
viewsA: Sum of Integer Numbers in a txt File
It’s Jeferson, all right? Knowing that the two files would always be the same size, you can iterate under the range of size(len) from the list previously read, for example the list y. Being as…
-
0
votes1
answer1457
viewsA: Insert a new column in dataframe like another column only without special characters
Speak my dear, good morning, all right? If I understand what you want, it can be done this way: tabela['NOVACOL'] = tabela['COLUNAREF'].apply(lambda x: x.replace('/','') .replace('.','')…
pythonanswered Claudio Gonçalves Filho 199 -
1
votes1
answer92
viewsA: Custom sorting in Python
Hello, you can use the following: foo = ["BCB", "CAB", "CBC"] bar = "ACB" foo_new = sorted(foo, key = lambda ordenar: [bar.index(i) if i in bar else ord(i) for i in ordenar]) Or this, which uses…
-
1
votes2
answers4838
viewsA: Changing a value with the pandas library
Good afternoon Mauricio, all right? I believe that if the pandas is identifying the '/' character, you can use the 'apply' function'. novodf = antigodf.apply(lambda x: x.replace('/','0')) This way…
-
0
votes2
answers2157
viewsA: Create function hexadecimal and octal conversion function in python
Talk Danilo, got it, see if this code below that cool, it is in the topic I told you about before. def todec2(hexa): x = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',…
-
1
votes1
answer851
viewsA: Python pandas formatting
It’s Thomas Caio, all right? I believe you could include the line "df.sort_values(by='IMC')" to a variable, and then apply the "round" on top of this variable next to the print, getting: novodf =…
-
2
votes2
answers2157
viewsA: Create function hexadecimal and octal conversion function in python
Good afternoon, champ, all right? Do you really want to do it this way, say "in the nail" ? For python already has functions implemented for such a task. It is usually done as shown below, in a more…
-
1
votes1
answer173
viewsA: Pandas Python, I’m having trouble figuring out which store sold the most in the last month
Good morning, all right? I did as follows, I collected only the values you showed, being 4 dates of February and 1 January. Then, I make the comparison as follows in date with type "datetime64[ns]"…
-
2
votes1
answer2078
viewsA: xlrd opens files in xls format?
Good morning, all right? As it says in the presentation of this page below, it is possible yes. I believe that there is no difference at least of the basic part between . xls and . xlsx with xlrd…