public class DataFrame
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.lang.String> |
columnNames |
protected java.util.List<ILazyDataset> |
data |
protected int |
dtype |
protected int |
index |
protected java.lang.String |
name |
| Constructor and Description |
|---|
DataFrame() |
DataFrame(ILazyDataset data,
int dtype) |
DataFrame(ILazyDataset data,
int index,
java.util.List<java.lang.String> names,
int dtype) |
DataFrame(java.lang.String name) |
DataFrame(java.lang.String name,
int dtype,
Dataset... columns) |
DataFrame(java.lang.String name,
int dtype,
int... columnShape)
This constructor usually used for writing lazy data.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(ILazyDataset toAdd)
Append this dataset to the end of the data frame (last column)
NOTE: Although this takes a lazy dataset, it will load the data from it.
|
void |
add(int index,
ILazyDataset toAdd) |
boolean |
addAll(java.util.Collection<? extends ILazyDataset> c) |
boolean |
addAll(int index,
java.util.Collection<? extends ILazyDataset> c) |
void |
clear() |
DataFrame |
clone() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
equals(java.lang.Object obj) |
void |
forEach(java.util.function.Consumer<? super ILazyDataset> action) |
ILazyDataset |
get(int index)
Get the column of this name.
|
ILazyDataset |
get(java.lang.String name)
Get the column of this name.
|
java.util.List<java.lang.String> |
getColumnNames() |
int[] |
getColumnShape() |
java.util.List<ILazyDataset> |
getData()
This perhaps could be
|
int |
getDtype() |
int |
getIndex() |
NxsMetadata |
getMetadata() |
java.lang.String |
getName() |
int[] |
getShape()
Get the shape of the data.
|
int |
hashCode() |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty()
Test if this is a frame waiting for data to be filled.
|
java.util.Iterator<ILazyDataset> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<ILazyDataset> |
listIterator() |
java.util.ListIterator<ILazyDataset> |
listIterator(int index) |
Appender |
open_hdf(java.lang.String filePath,
java.lang.String h5Path)
Open the file for appending data yourself.
|
java.util.stream.Stream<ILazyDataset> |
parallelStream() |
DataFrame |
read_hdf(java.lang.String filePath)
Read a dataframe as LazyDatasets from the file.
|
ILazyDataset |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeIf(java.util.function.Predicate<? super ILazyDataset> filter) |
void |
replaceAll(java.util.function.UnaryOperator<ILazyDataset> operator) |
boolean |
retainAll(java.util.Collection<?> c) |
ILazyDataset |
set(int index,
ILazyDataset element) |
void |
setColumnNames(java.util.List<java.lang.String> names) |
void |
setColumnShape(int[] columnShape) |
void |
setData(ILazyDataset data) |
void |
setDtype(int dtype) |
void |
setIndex(int index) |
void |
setMetadata(NxsMetadata metadata) |
void |
setName(java.lang.String name) |
int |
size()
The number of columns in this frame.
|
void |
sort(java.util.Comparator<? super ILazyDataset> c) |
java.util.Spliterator<ILazyDataset> |
spliterator() |
Dataset |
stitch(int[] tileShape)
Stiches the images in this list into a single tile
using the shape suggested.
|
java.util.stream.Stream<ILazyDataset> |
stream() |
java.util.List<ILazyDataset> |
subList(int fromIndex,
int toIndex) |
DataFrame |
to_hdf(java.lang.String filePath,
java.lang.String h5Path)
This method writes the data in slices down the column axis.
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
java.lang.String |
toString() |
protected java.util.List<ILazyDataset> |
unpack(ILazyDataset stack,
java.util.List<java.lang.String> columnNames)
Unpacks the stack using the last dimension as the stack index.
|
protected java.lang.String name
protected int dtype
protected java.util.List<ILazyDataset> data
protected int index
protected java.util.List<java.lang.String> columnNames
public DataFrame()
public DataFrame(java.lang.String name)
public DataFrame(java.lang.String name,
int dtype,
int... columnShape)
throws DatasetException
name - - namedtype - - data typecolumnShape - - shape of columns we will be adding.DatasetException - if cannot write data.public DataFrame(java.lang.String name,
int dtype,
Dataset... columns)
throws DatasetException
DatasetExceptionpublic DataFrame(ILazyDataset data,
int dtype)
public DataFrame(ILazyDataset data,
int index,
java.util.List<java.lang.String> names,
int dtype)
public DataFrame to_hdf(java.lang.String filePath, java.lang.String h5Path) throws java.lang.Exception
filePath - java.lang.Exceptionpublic Appender open_hdf(java.lang.String filePath, java.lang.String h5Path) throws NexusException, java.io.IOException
filePath - h5Path - java.io.IOExceptionNexusExceptionpublic DataFrame read_hdf(java.lang.String filePath) throws NexusException, java.io.IOException, DatasetException
filePath - NexusExceptionjava.io.IOExceptionDatasetExceptionpublic java.lang.String getName()
public void setName(java.lang.String name)
public NxsMetadata getMetadata()
public void setMetadata(NxsMetadata metadata)
public int hashCode()
hashCode in interface java.util.Collection<ILazyDataset>hashCode in interface java.util.List<ILazyDataset>public boolean equals(java.lang.Object obj)
equals in interface java.util.Collection<ILazyDataset>equals in interface java.util.List<ILazyDataset>public DataFrame clone()
public int size()
size in interface java.util.Collection<ILazyDataset>size in interface java.util.List<ILazyDataset>java.lang.NullPointerException - if the columnNames are not set.public int[] getColumnShape()
public void setColumnShape(int[] columnShape)
public int[] getShape()
protected java.util.List<ILazyDataset> unpack(ILazyDataset stack,
java.util.List<java.lang.String> columnNames)
stack - to unpack.public Dataset stitch(int[] tileShape)
throws DatasetException
tileShape - - shape of tilesDatasetException - - if cannot stitchpublic int getDtype()
public void setDtype(int dtype)
public java.util.List<ILazyDataset> getData()
public void setData(ILazyDataset data)
public int getIndex()
public void setIndex(int index)
public java.util.List<java.lang.String> getColumnNames()
public void setColumnNames(java.util.List<java.lang.String> names)
public ILazyDataset get(java.lang.String name)
throws DatasetException
name - of columnDatasetException - - If cannot get slice for columnjava.lang.NullPointerException - if name is not known.public ILazyDataset get(int index)
get in interface java.util.List<ILazyDataset>index - - index of columnDatasetException - - If cannot get slice for columnpublic boolean add(ILazyDataset toAdd)
add in interface java.util.Collection<ILazyDataset>add in interface java.util.List<ILazyDataset>DatasetException - - If cannot get slice for columnpublic void add(int index,
ILazyDataset toAdd)
add in interface java.util.List<ILazyDataset>public boolean isEmpty()
isEmpty in interface java.util.Collection<ILazyDataset>isEmpty in interface java.util.List<ILazyDataset>public void forEach(java.util.function.Consumer<? super ILazyDataset> action)
forEach in interface java.lang.Iterable<ILazyDataset>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<ILazyDataset>contains in interface java.util.List<ILazyDataset>public java.util.Iterator<ILazyDataset> iterator()
iterator in interface java.lang.Iterable<ILazyDataset>iterator in interface java.util.Collection<ILazyDataset>iterator in interface java.util.List<ILazyDataset>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<ILazyDataset>toArray in interface java.util.List<ILazyDataset>public <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<ILazyDataset>toArray in interface java.util.List<ILazyDataset>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<ILazyDataset>remove in interface java.util.List<ILazyDataset>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<ILazyDataset>containsAll in interface java.util.List<ILazyDataset>public boolean addAll(java.util.Collection<? extends ILazyDataset> c)
addAll in interface java.util.Collection<ILazyDataset>addAll in interface java.util.List<ILazyDataset>public boolean addAll(int index,
java.util.Collection<? extends ILazyDataset> c)
addAll in interface java.util.List<ILazyDataset>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<ILazyDataset>removeAll in interface java.util.List<ILazyDataset>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<ILazyDataset>retainAll in interface java.util.List<ILazyDataset>public void replaceAll(java.util.function.UnaryOperator<ILazyDataset> operator)
replaceAll in interface java.util.List<ILazyDataset>public void sort(java.util.Comparator<? super ILazyDataset> c)
sort in interface java.util.List<ILazyDataset>public void clear()
clear in interface java.util.Collection<ILazyDataset>clear in interface java.util.List<ILazyDataset>public boolean removeIf(java.util.function.Predicate<? super ILazyDataset> filter)
removeIf in interface java.util.Collection<ILazyDataset>public ILazyDataset set(int index,
ILazyDataset element)
set in interface java.util.List<ILazyDataset>public ILazyDataset remove(int index)
remove in interface java.util.List<ILazyDataset>public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<ILazyDataset>public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<ILazyDataset>public java.util.ListIterator<ILazyDataset> listIterator()
listIterator in interface java.util.List<ILazyDataset>public java.util.ListIterator<ILazyDataset> listIterator(int index)
listIterator in interface java.util.List<ILazyDataset>public java.util.List<ILazyDataset> subList(int fromIndex,
int toIndex)
subList in interface java.util.List<ILazyDataset>public java.util.Spliterator<ILazyDataset> spliterator()
spliterator in interface java.lang.Iterable<ILazyDataset>spliterator in interface java.util.Collection<ILazyDataset>spliterator in interface java.util.List<ILazyDataset>public java.util.stream.Stream<ILazyDataset> stream()
stream in interface java.util.Collection<ILazyDataset>public java.util.stream.Stream<ILazyDataset> parallelStream()
parallelStream in interface java.util.Collection<ILazyDataset>public java.lang.String toString()
toString in class java.lang.Object