Release 0.1.1 Andrew Straw, Florian Finkernagel
pydataframe Documentation
Release 0.1.1 Andrew Straw, Florian Finkernagel
February 21, 2014
1 Core classes 2 Functions 3 Reading and writing 4 Dialects 5 Indices and tables Python Module Index
Contents
1 5 7 9 11 13
i
ii
CHAPTER 1
Core classes
class DataFrame(value_dict=None, columns_ordered=None, row_names_ordered=None) An implemention of an almost R like DataFrame object. Usage: u = DataFrame( { "Field1": [1, 2, 3], "Field2": ['abc', 'def', 'hgi']}, optional: ['Field1', 'Field2'] ["rowOne", "rowTwo", "thirdRow"])
A DataFrame is basically a table with rows and columns. Columns are named, rows are numbered (but can be named) and can be easily selected and calculated upon. Internally, columns are stored as 1d numpy arrays. If you set row names, they're converted into a dictionary for fast access. There is a rich subselection/slicing API, see help(DataFrame.__get_item) (it also works for setting values). Please note that any slice get's you another DataFrame, to access individual entries use get_row(), get_column(), get_value(). DataFrames also understand basic arithmetic and you can either add (multiply,...) a constant value, or another DataFrame of the same size / with the same column names. aggregate(key_vars, aggregation_function)
Iterate for every value combination of the key vars, call the aggregation_function with the sub-df. Take the returned dicts, turn them into a new df as2DMatrix(dtype=None) Return all columns as 2d(nRows, nCols)-numpy matrix. Please use pep 8 conform as_2d_matrix() Default dtype is float64 Raises a ValueError if not all columns could be converted. as_2d_matrix(dtype=None) Return all columns as 2d(nRows, nCols)-numpy matrix. Default dtype is float64 Raises a ValueError if not all columns could be converted. cbind_view(*others) Stack frames next to each other ( column wise ). Take frames with distinct fields, but identical row lengths, and stack them next to each other in order. The new DataFrame shares the values with its parents. convert_type(column_name, value_casting_func) Cast a column into another type copy() Return a deep copy of the DataFrame.
1
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- the hacker s guide to python
- release 0 1 1 andrew straw florian finkernagel
- python s guide to the galaxy
- itertools for circuitpython adafruit industries
- python language projects programmer books
- using python for analytics
- chapter 1 working with python modules
- release 0 1 0 rob galanakis
- faculty of science department of computer
Related searches
- 192 1 or 2 33 33 1 0 0 0 1 1 1 default username and password
- 192 1 or 3 33 33 1 0 0 0 1 1 1 default username and password
- 192 1 or 2 735 735 1 0 0 0 1 1 1 default username and password
- 192 1 or 3 735 735 1 0 0 0 1 1 1 default username and password
- 192 1 or 2 372 372 1 0 0 0 1 1 1 default username and password
- 192 1 or 3 372 372 1 0 0 0 1 1 1 default username and password
- 192 1 or 2 64 64 1 0 0 0 1 1 1 default username and password
- 192 1 or 3 64 64 1 0 0 0 1 1 1 default username and password
- 192 1 or 2 142 142 1 0 0 0 1 1 1 admin username and password
- 192 1 or 3 142 142 1 0 0 0 1 1 1 admin username and password
- 192 1 or 2 291 291 1 0 0 0 1 1 1 admin username and password
- 192 1 or 2 221 221 1 0 0 0 1 1 1 username and password verizon