Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Pool to parallelize directory reading #30

Open
alexlib opened this issue Jun 14, 2021 · 1 comment
Open

use Pool to parallelize directory reading #30

alexlib opened this issue Jun 14, 2021 · 1 comment

Comments

@alexlib
Copy link
Owner

alexlib commented Jun 14, 2021

  1. read carefully and optimize genfromtxt https://numpy.org/doc/stable/user/basics.io.genfromtxt.html
  2. read how to read ascii files in parallel from the disk using Pool https://waterprogramming.wordpress.com/2015/08/26/basic-parallelization-in-python/
@alexlib
Copy link
Owner Author

alexlib commented Jun 14, 2021

also try astropy reader

https://docs.astropy.org/en/stable/io/ascii/index.html

or pandas read_csv

import glob
import pandas as pd

# glob.glob('data*.csv') - returns List[str]
# pd.read_csv(f) - returns pd.DataFrame()
# for f in glob.glob() - returns a List[DataFrames]
# pd.concat() - returns one pd.DataFrame()
df = pd.concat([pd.read_csv(f) for f in glob.glob('data*.csv')], ignore_index = True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant