python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Split a DataFrame into a Vector of DataFrames
I have a DataFrame
df = DataFrame(a=[1,1,2,2],b=[6,7,8,9])
4×2 DataFrame
Row │ a b
│ Int64 Int64
─────┼──────────────
1 │ 1 6
2 │ 1 7
3 │ 2 8
...
Georgery
Votes: 0
Answers: 1
Writing function methods for passing GroupedDataFrame in Julia
I have written a function like the following one:
gini(v::Array{<:Real,1}) = (2 * sum([x*i for (i,x) in enumerate(sort(v))]) / sum(sort(v)) - (length(v)+1))/(length(v))
This function works well wh...

Josep Espasa
Votes: 0
Answers: 1
How to prevent Columns from being Decimals in DataFrames when retrieved from Postgres
I have a DataFrame df which I retrieved from a Postgres database as follows
using DataFrames, LibPQ
con = LibPQ.Connection(con_string)
result = execute(con, "SELECT * FROM [table]")
df = Da...
Georgery
Votes: 0
Answers: 2
Sort Julia DataFrame in descending Order
I have a DataFrame
using DataFrames
using DataFramesMeta
using Chain
df = DataFrame(a=1:3,b=4:6)
that I want to sort descending by column :a. Doing it ascending is intuitive...
@chain df begin
@...
Georgery
Votes: 0
Answers: 2