Posts by user20273 • 663 points
21 posts
-
2
votes2
answers62
viewsQ: Remove numbers and special characters from a text, but not within a word
I would like to remove numbers and/or special characters from a text, but not within a word. Example: texto = "ol@ mundo, eu bebo H20 e nao fumo cig@rro !#& 123" The result should be: ol@ mundo,…
-
2
votes3
answers99
viewsQ: Replace all arguments (of all strings) that exist in a Dict with . format
I wonder if there is any pythonica way to replace all the arguments (of all strings) that exist in dictionary with . format . For example: dicionario = {"nome": "{nome_usuario}", "idade": 26,…
-
4
votes1
answer164
viewsQ: Problems with interpreter R
I did the installation of R4intellji and selected a program in R. However when I ask to run (run) the program gives the following error: The R interpreter is not specified Could someone help me?…
-
3
votes1
answer229
viewsQ: Typeerror: a float is required
This is my code: ### BIBLIOTECAS import scipy.special as sps import numpy as np import matplotlib.pyplot as plt import pandas as pd import scipy as sp from scipy.stats import norm from scipy.stats…
-
2
votes0
answers228
viewsQ: Generate multiple samples
I’m trying to generate 500 samples of size 50 each, but it’s not working. The program follows below. require("gsl") n=50 amostra = 500 alpha = 2 beta = 3 X=NULL X<-matrix(0,nrow=n,ncol=amostra)…
-
6
votes1
answer289
viewsQ: Argument of a function is another function
I would like to know how to put as an argument of a function another function. For example, let’s say I want to solve an integral by a given numerical method of approximation of an integral. And I…
-
2
votes1
answer249
viewsQ: Colorize a region of the graph
I would like to color only the region within the circle, but I’m not getting it. The program and the image are: theta <- seq(0, 2 * pi, length = 200) r = exp(1i*theta) fx=function(r) { x = r-1…
-
2
votes1
answer1017
viewsQ: Product of a function
Hi, I was wondering if there are any commands to perform the production of a function in Python. I’m creating a function to make the product of another function. def fx(a, v, t): return (…
-
0
votes4
answers788
viewsA: Generate random values from a distribution in Python
Since the default for the terminal is python 3, the problem arises that numpy has no support for python 3. So one solution I had is to use python 2 and install the modules: python2-numpy…
-
5
votes4
answers788
viewsQ: Generate random values from a distribution in Python
Hello! I’m trying to generate random values of a distribution (Gamma, normal and etc) in python, but I’m having trouble importing the library. I am using the following library "import scipy.special…
-
0
votes2
answers43
viewsA: Doubts when using the "rle" function
What I wanted to do was this: x = rnorm(10,0,1) limite = 1 teste = rle(x > limite) evento = which(teste$values == TRUE) acumulada_lengths= cumsum(teste$lengths) fim = acumulada_lengths[evento]…
-
2
votes2
answers43
viewsQ: Doubts when using the "rle" function
I’m using the rle function. x = rnorm(10,0,1) l = 1 teste = rle(x > l) evento = teste$lengths[teste$values=="TRUE"] I’m having trouble extracting what are the values of my vector x, which has…
-
2
votes2
answers379
viewsQ: Repeating structure of a function
Hello! I am having trouble finding my error in the program below. I want to generate allele values from a level vector, however I want my function to return an array of generated values. My program…
-
4
votes1
answer1219
viewsQ: Filter and save to csv
I would like to perform a filter on R. I have a database with 5 variables and more than 5000 lines. One of my variables is "room", in which I have 29 room (ex:Sala1,sala2...). I would like to…
-
3
votes4
answers13845
viewsA: How to install the Pandas library in Python 3
I used the command: sudo pacman -S python-pandas And it worked :)
-
2
votes4
answers13845
viewsQ: How to install the Pandas library in Python 3
I would like to know how to install the Pandas library in Manjaro, in Python version 3.4.3 -
-
7
votes2
answers11102
viewsQ: How to import an xls file to Python?
I’m starting my studies in Python and would like to import a database that is on .xls for Python. Someone could help me? NOTE: Python version 3.4.3.
-
2
votes2
answers1941
viewsA: Word cloud in R
Just use a transformation, the problem is solved: corpus_clean <- tm_map(corpus, content_transformer(tolower))
-
3
votes2
answers1941
viewsQ: Word cloud in R
I’m using the following program: library("wordcloud") library("tm") library("RColorBrewer") dados=read.csv("C:/teste/dados.csv", sep=";", dec=",",header=TRUE) capa=dados$mensagem corpus <-…
-
7
votes3
answers2670
viewsQ: Know the frequency of words
Hello, I wonder if there is a function/command in R that I can know which are the most frequent words in a text and how often it appears. For example, I have a very large database, but it is a…
-
2
votes1
answer161
viewsQ: Size of a predefined range within a vector
I wonder how I can calculate the amount of elements I have in a predefined range, within a vector. For example: Let’s say I have a size 10 vector. My intention for example is to want to know how…