All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generated.docs.javadoc.io.github.h5jan.core.DataFrame.html Maven / Gradle / Ivy






DataFrame (h5jan-core)












io.github.h5jan.core

Class DataFrame

  • java.lang.Object
    • io.github.h5jan.core.DataFrame


  • public class DataFrame
    extends java.lang.Object
    A data frame of January datasets which can be written and read from HDF5. The data is lazy, you may write slices of the data table. The Table is nD, each written "column" does not have to be 1D. The data is written in HDF in an easy way to call the DataFrame constructor from python. It is not written in the DataFrame format for HDF5 because that is not very nice for further analysis. Instead the data is stored in hdf5-NeXus format which is a block of contiguous data that may be sliced.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected java.util.List<java.lang.String> columnNames 
      protected ILazyDataset data 
      protected int dtype 
      protected int index 
      protected java.lang.String name 
    • Constructor Summary

      Constructors 
      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) 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static void addDimension(IDataset slice) 
      DataFrame clone() 
      static ILazyWriteableDataset create(java.lang.String name, int dtype)
      Creates a tabular writeable dataset using the shape of one column.
      static ILazyWriteableDataset create(java.lang.String name, int dtype, int[] columnShape)
      Creates a writeable dataset using the shape of one column.
      static ILazyWriteableDataset create(java.lang.String name, int dtype, int[] columnShape, int sizeSlices)
      Creates a writeable dataset using the shape of one column.
      boolean equals(java.lang.Object obj) 
      java.util.List<java.lang.String> getColumnNames() 
      ILazyDataset getData() 
      int getDtype() 
      int getIndex() 
      NxsMetadata getMetadata() 
      java.lang.String getName() 
      int hashCode() 
      Appender open_hdf(java.lang.String filePath, java.lang.String h5Path)
      Open the file for appending data yourself.
      static SliceND orient(ILazyDataset data, int i, int[] shape) 
      DataFrame read_hdf(java.lang.String filePath)
      Read a dataframe as LazyDatasets from the file.
      void setColumnNames(java.util.List<java.lang.String> names) 
      void setData(ILazyDataset data) 
      void setDtype(int dtype) 
      void setIndex(int index) 
      void setMetadata(NxsMetadata metadata) 
      void setName(java.lang.String name) 
      DataFrame to_hdf(java.lang.String filePath, java.lang.String h5Path)
      This method imports all the data frame into memory then writes it to HDF.
      DataFrame to_lazy_hdf(java.lang.String filePath, java.lang.String h5Path)
      This method writes the data in slices down the column axis.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        protected java.lang.String name
      • dtype

        protected int dtype
      • data

        protected ILazyDataset data
      • index

        protected int index
      • columnNames

        protected java.util.List<java.lang.String> columnNames
    • Constructor Detail

      • DataFrame

        public DataFrame()
      • DataFrame

        public DataFrame(java.lang.String name)
      • DataFrame

        public DataFrame(java.lang.String name,
                         int dtype,
                         Dataset... columns)
                  throws DatasetException
        Throws:
        DatasetException
      • DataFrame

        public DataFrame(ILazyDataset data,
                         int dtype)
      • DataFrame

        public DataFrame(ILazyDataset data,
                         int index,
                         java.util.List<java.lang.String> names,
                         int dtype)
    • Method Detail

      • to_hdf

        public DataFrame to_hdf(java.lang.String filePath,
                                java.lang.String h5Path)
                         throws NexusException,
                                java.io.IOException,
                                DatasetException
        This method imports all the data frame into memory then writes it to HDF.
        Parameters:
        filePath -
        Throws:
        NexusException
        java.io.IOException
        DatasetException
      • to_lazy_hdf

        public DataFrame to_lazy_hdf(java.lang.String filePath,
                                     java.lang.String h5Path)
                              throws java.lang.Exception
        This method writes the data in slices down the column axis. If your data is already in a true LazyDataset it will be sliced in the column axis and each slice written to HDF. This might be more memory efficient depending on what you are writing.
        Parameters:
        filePath -
        Throws:
        java.lang.Exception
      • open_hdf

        public Appender open_hdf(java.lang.String filePath,
                                 java.lang.String h5Path)
                          throws NexusException,
                                 java.io.IOException
        Open the file for appending data yourself.
        Parameters:
        filePath -
        h5Path -
        Returns:
        Throws:
        java.io.IOException
        NexusException
      • read_hdf

        public DataFrame read_hdf(java.lang.String filePath)
                           throws NexusException,
                                  java.io.IOException,
                                  DatasetException
        Read a dataframe as LazyDatasets from the file.
        Parameters:
        filePath -
        Throws:
        NexusException
        java.io.IOException
        DatasetException
      • getName

        public java.lang.String getName()
      • setName

        public void setName(java.lang.String name)
      • create

        public static ILazyWriteableDataset create(java.lang.String name,
                                                   int dtype)
        Creates a tabular writeable dataset using the shape of one column.
        Parameters:
        name -
        dtype -
        Returns:
        writeable dataset
      • create

        public static ILazyWriteableDataset create(java.lang.String name,
                                                   int dtype,
                                                   int[] columnShape)
        Creates a writeable dataset using the shape of one column.
        Parameters:
        name -
        dtype -
        columnShape -
        Returns:
        writeable dataset
      • create

        public static ILazyWriteableDataset create(java.lang.String name,
                                                   int dtype,
                                                   int[] columnShape,
                                                   int sizeSlices)
        Creates a writeable dataset using the shape of one column.
        Parameters:
        name -
        dtype -
        columnShape -
        Returns:
        writeable dataset
      • setMetadata

        public void setMetadata(NxsMetadata metadata)
      • hashCode

        public int hashCode()
      • equals

        public boolean equals(java.lang.Object obj)
      • getDtype

        public int getDtype()
      • setDtype

        public void setDtype(int dtype)
      • getData

        public ILazyDataset getData()
      • setData

        public void setData(ILazyDataset data)
      • getIndex

        public int getIndex()
      • setIndex

        public void setIndex(int index)
      • getColumnNames

        public java.util.List<java.lang.String> getColumnNames()
      • setColumnNames

        public void setColumnNames(java.util.List<java.lang.String> names)
      • orient

        public static SliceND orient(ILazyDataset data,
                                     int i,
                                     int[] shape)
      • addDimension

        public static void addDimension(IDataset slice)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy