Posts by Vinicius Barcelos • 141 points
9 posts
-
1
votes1
answer110
viewsA: problem in converting normal matrix to numpy
What happens is that y is always a matrix, the output of the function OrdenaMatriz() is a list of matrices (vectors). This is: >>> y = np.matrix([[-1,1,4],[2,-2,7],[10,7,1]]) >>> y…
-
1
votes1
answer3034
viewsA: How to customize the x-axis of a graph with two y-axes, for text?
Before we begin I remind you that a praiseworthy practice is to provide an example of your data for fast and accurate replicability. Suppose you have the following Dataframe: import pandas as pd…
-
0
votes2
answers111
viewsA: List in HTML table separated by category
You want an output like this? <table class="tg"> <tr> <th class="tg-0lax">nome</th> <th class="tg-0lax">categoria</th> <th class="tg-0lax">tempo</th>…
-
0
votes2
answers180
viewsA: Find values in a list that are equal to the index they are in. How to optimize?
I tried the solution below for all cases raised by @Pedro von Hertwig and they worked instantly: import random random.seed(42) def listSearch(x): ''' Procura o primeiro índice i tal que x[i]=i.…
-
2
votes2
answers1368
viewsA: Is it a good idea to use JSON as a database?
Complementing the Alex Ayub: If your database is relational (that is, each dataset is a table with fixed columns) then you can use Sqlite (import sqlite3 as lite). However, if you plan to keep this…
-
1
votes1
answer106
viewsA: How can I build a table result using "eventReactive" in Shiny
Let me get this straight. You want to go fill in the table? (0) beginning c01 c02 r01 r02 (1) Col='col02'; Row='row01' and Value=1 ---> ok c01 c02 r01 1 r02 (2) Col='col01'; Row='row02' and…
-
0
votes1
answer324
viewsA: How to plot data from a variable in Shiny UI
The code you provided was all problematic. Starting with the lack of (), {}, ... correctly closing enviroments, functions, etc. Be more careful to facilitate the life of those who will analyze your…
shinyanswered Vinicius Barcelos 141 -
0
votes2
answers98
viewsA: Python problem using . Join
If you’re gonna use .join then this solution will suit you: >>> ':'.join([addr[x-2:x] for x in range(2, len(addr)+2,2)]) '0a:1b:2c:3d:4e:5f'
python-3.xanswered Vinicius Barcelos 141 -
3
votes1
answer272
viewsA: Error creating column in Pandas dataset
You probably downloaded this data from Yahoo Finance. I did the same and here they are: Date,Open,High,Low,Close,Adj Close,Volume…