Questions tagged [julia-dataframe]
51 questions
8
votes
2 answers
How do you apply a shift to a Julia Dataframe?
In python pandas, the shift function is useful to shift the rows in the dataframe forward and possible relative to the original which allows for calculating changes in time series data. What is the equivalent method in Julia?

ndw
- 513
- 6
- 14
6
votes
1 answer
Plot simple moving average over dataframe in Julia
I have an excel file with dates and stock prices. I read this data into a dataframe with DataFrames.jl
using DataFrames, StatsPlots, Indicators
df = DataFrame(XLSX.readtable("Demo-sv.xlsx", "Blad3")...)
This works great and here I print the first…

hbrovell
- 547
- 6
- 17
6
votes
2 answers
How to convert String Series to Datetime Series in Julia
I have a csv file which looks like below,
20×2 DataFrame
│ Row │ Id │ Date │
│ │ Int64 │ String │
├─────┼───────┼────────────┤
│ 1 │ 1 │ 01-01-2010 │
│ 2 │ 2 │ 02-01-2010 │
│ 3 │ 3 │ 03-01-2010 │
│ 4 │ 4 │…

Mohamed Thasin ah
- 10,754
- 11
- 52
- 111
5
votes
1 answer
How to remove/drop rows of nothing and NaN in Julia dataframe?
I have a df which contains, nothing, NaN and missing. to remove rows which contains missing I can use dropmissing. Is there any methods to deal with NaN and nothing?
Sample df:
│ Row │ x │ y │
│ │ Union…? │ Char…

Mohamed Thasin ah
- 10,754
- 11
- 52
- 111
4
votes
2 answers
Reading Strings as Vectors Julia
I currently have a Julia dataframe of the form
A
B
"[1,2]"
"[3,4]"
and would like to make it of the form
A1
A2
B1
B2
1
2
3
4
or of the form (where the vectors are no longer strings).
| A | B |
|---|---|
|[1,2]|[3,4]|
is there…

numbersguy132
- 137
- 6
4
votes
2 answers
How to declare a shared DataFrame in Julia for parallel computing
I have a large simulation on a DataFrame df which I am trying to parallelize and save the results of the simulations in a DataFrame called simulation_results.
The parallelization loop is working just fine. The problem is that if I were to store the…

Moshi
- 193
- 6
4
votes
1 answer
Julia load dataframe from s3 csv file
I'm having trouble finding an example to follow online for this simple use-case:
Load a CSV file from an s3 object location to julia DataFrame.
Here is what I tried that didn't work:
using AWSS3, DataFrames, CSV
filepath =…

Merlin
- 1,780
- 1
- 18
- 20
4
votes
1 answer
Find a row in a Julia DataFrame
What's the canonical way of finding a row in a DataFrame in DataFrames.jl?
For instance, given this DataFrame:
│ Row │ uuid │ name
│ │ String │ String …

GLee
- 5,003
- 5
- 35
- 39
4
votes
1 answer
how to create dictionary from julia dataframe?
I have a df like below, I want to get dictionary from the df.
df = DataFrame(id=[1, 2, 3, 4], value=["Rajesh", "John", "Jacob", "sundar"], other=[0.43, 0.42,0.54, 0.63])
│ Row │ id │ value │ other │
│ │ Int64 │ String │ Float64…

Mohamed Thasin ah
- 10,754
- 11
- 52
- 111
4
votes
1 answer
How to add suffix or prefix for duplicate columns in julia?
I have a two df and both dfs have some common columns which are not included in on list. If I add makeunique parameter it creates new column with suffix of _n where. Is there anyway I can pass prefix values such as ['_left', '_right'] to the result…

Mohamed Thasin ah
- 10,754
- 11
- 52
- 111
3
votes
2 answers
Multiple conditionals in Julia DataFrame
I have a DataFrame with 3 columns, named :x :y and :z which are Float64 type. :x and "y are iid uniform on (0,1) and z is the sum of x and y.
I want to a simple task. If x and y are both greater than 0.5 I want to print z and replace its value to…

Moshi
- 193
- 6
3
votes
2 answers
Trying to save a DataFrame using Arrow.jl gives: ArgumentError: type does not have a definite number of fields. Tuples of tuples of ints
I have a dataframe that I'd like to save using Arrow.write().
I can save a subframe of it by omitting one column. But if I leave the column in, I get this error:
ArgumentError: type does not have a definite number of fields
The objects in this…

Sort of Damocles
- 179
- 7
3
votes
1 answer
Julia - data slicing not working in for loop - but working without for loop
I am trying to extract data of specific stock symbol from the data of all stocks through for loop. When I use the code out of for loop the code is working while the same code is not working in for loop.
Below is the code -
Working -
df =…

Harneet.Lamba
- 195
- 9
3
votes
1 answer
How do I check if all elements of DataFrame are non-negative?
Suppose I have a DataFrame with numeric elements. I want to check that all the elements are non-negative. I can do something like:
df .> 0
which results in a DataFrame of ones and zeros. How do I reduce it to a one true/false value?
user468311
3
votes
1 answer
What is missing in JuliaDB to use it as production database in a website backend?
I have some difficulties to understand the pros and the cons of using JuliaDB as a main backend database for a production website.
https://juliadb.org/
My use case is a collaborative data sciences platform. The client request 1 million unique…

Morgane
- 155
- 8