Skip to main content

Read multiple csvs as a single pandas DataFrame.

Project description

pandas_multi
============

Simple loop for reading multiple csv files (matching a certain pattern) as a
``pandas.DataFrame``.

I'm aware this need can be solved in even one line of Python, but loading
multiple similar csv's is just something that should be as easy as loading
one csv. If you don't want to add a new dependency to your project, google
what ``os.listdir`` and ``glob`` can do for you.

Installation can be done by typing::

pip install pandas_multi
Usage of ``pandas_multi.read_csvs`` has been kept as similar as possible to
``pandas.read_csv``::

import pandas_multi

# <sarcasm>
# Note that dataframes only work if you give them the non-descriptive name df
# </sarcasm>
df = pandas_multi.readcsvs('./20180728*.csv')
# if you provide it with a path to a folder and nothing else, it will assume
# everything in the folder is a comma-separated file
df = pandas_multi.readcsvs('./data/')
# if this is not the case, do this:
df = pandas_multi.readcsvs('./data/*.csv')
All options that are available to ``pandas.read_csv`` or ``pandas.concat``
can be passed into ``pandas_multi.readcsvs`` and will be redirected to the
appropriate underlying functions.

If you wish to maintain a trace back to the original data, you can run the
function with the keyword argument ``filenames_as_keys=True``. Note that you
should no longer use the keyword argument ``keys``. This will be ignored.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandas_multi-2018.11.15.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandas_multi-2018.11.15-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file pandas_multi-2018.11.15.tar.gz.

File metadata

  • Download URL: pandas_multi-2018.11.15.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pandas_multi-2018.11.15.tar.gz
Algorithm Hash digest
SHA256 9b944a8c5e010c0db4ce3cd2fc5c20f1e6604077032c3036996bdea65656f0c9
MD5 695c78c05858b4663a64836207bb1813
BLAKE2b-256 e17714e126d488fd1d52c013bf70c58b4a4d4bcdc915085281ccc17f1cc07fc4

See more details on using hashes here.

File details

Details for the file pandas_multi-2018.11.15-py3-none-any.whl.

File metadata

  • Download URL: pandas_multi-2018.11.15-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pandas_multi-2018.11.15-py3-none-any.whl
Algorithm Hash digest
SHA256 88935a19b67337064e3975f3fdfada882ee368849aaed417d69d708169af0533
MD5 ecfdb8cdb9d4a630f212698338c9b0b1
BLAKE2b-256 d93bd0f4e25193ecb0f3b0fd756b7091a618627b3c5b20dc50c89a868f191cec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page