Python - Pandas

 
Vista:
Imágen de perfil de Gustavo
Val: 64
Ha disminuido su posición en 2 puestos en Python (en relación al último mes)
Gráfica de Python

Pandas

Publicado por Gustavo (24 intervenciones) el 26/07/2021 23:31:35
Hola:

Estoy trabajando con archivos .csv que no entran en una planilla de cálculo.
Empecé a trabajarlos con Python y luego recurrí a la librería Pandas de Python.
Se trata de un archivo con actualización diaria, empezó siendo pequeño y rápidamente tomó gran tamaño. Tiene 25 columnas fijas y millones de filas, que son las que aumentan día a día.
Pude depurar el programa para que funcionara con el archivo cuando pesaba 1.7 GB y lo hice funcionar en ambas modalidades (con y sin Pandas).
Ahora, el archivo ya pesa 3.7 GB (y seguirá creciendo). Cuando corro el programa con la última versión del archivo (3.7 GB) desde la consola de Linux me dice:

1
Terminado (Killed)

Cuando lo corro con Python con Pandas, después de un tiempo me aparece un cartel que dice:

Error-Python


Subprocess Connection Error
IDLE's subprocess didn't make connection. See the 'Startup failure' section of the IDLE do, online at
https://docs.python.org/3/library/idle.html#startup-faIlure


(Error de conexión de subproceso
El subproceso de IDLE no hizo conexión. Consulte la sección 'Fallo de inicio' de IDLE
hacer, en línea en)

Cuando lo corro con Python sin Pandas, se me cuelga el SO (Ubuntu Focal Fossa))
Ya visité el enlace https://docs.python.org/3/library/idle.html#startup-faIlure, pero me dice poco y no me resultó de ayuda.
Es evidente que el conflicto está determinado por el tamaño, pero no se como superarlo.

Desde ya, muchas gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Gustavo
Val: 64
Ha disminuido su posición en 2 puestos en Python (en relación al último mes)
Gráfica de Python

Pandas

Publicado por Gustavo (24 intervenciones) el 27/07/2021 21:46:13
Gracias.
Instalé Dask, y luego lo testé:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
py.test dask/tests dask/array/tests
================================================================ test session starts =================================================================
platform linux -- Python 3.8.8, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /home/gustavo/anaconda3/bin/python
cachedir: .pytest_cache
rootdir: /home/gustavo/dask, configfile: setup.cfg
plugins: anyio-2.2.0
collected 3991 items / 4 errors / 5 skipped / 3982 selected
 
======================================================================= ERRORS =======================================================================
______________________________________________________ ERROR collecting dask/tests/test_base.py ______________________________________________________
dask/tests/test_base.py:1366: in <module>
    ???
../anaconda3/lib/python3.8/site-packages/_pytest/mark/structures.py:510: in __getattr__
    warnings.warn(
E   pytest.PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
__________________________________________________ ERROR collecting dask/tests/test_distributed.py ___________________________________________________
dask/tests/test_distributed.py:534: in <module>
    ???
../anaconda3/lib/python3.8/site-packages/_pytest/mark/structures.py:510: in __getattr__
    warnings.warn(
E   pytest.PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
_______________________________________________ ERROR collecting dask/tests/test_graph_manipulation.py _______________________________________________
dask/tests/test_graph_manipulation.py:14: in <module>
    from dask.tests.test_base import Tuple
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
../anaconda3/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
dask/tests/test_base.py:1366: in <module>
    ???
../anaconda3/lib/python3.8/site-packages/_pytest/mark/structures.py:510: in __getattr__
    warnings.warn(
E   pytest.PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
____________________________________________________ ERROR collecting dask/tests/test_threaded.py ____________________________________________________
dask/tests/test_threaded.py:152: in <module>
    ???
../anaconda3/lib/python3.8/site-packages/_pytest/mark/structures.py:510: in __getattr__
    warnings.warn(
E   pytest.PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
============================================================== short test summary info ===============================================================
SKIPPED [1] dask/tests/test_cache.py:11: could not import 'cachey': No module named 'cachey'
SKIPPED [1] dask/tests/test_dot.py:11: could not import 'graphviz': No module named 'graphviz'
SKIPPED [1] dask/array/tests/test_cupy.py:14: could not import 'cupy': No module named 'cupy'
SKIPPED [1] dask/array/tests/test_sparse.py:12: could not import 'sparse': No module named 'sparse'
SKIPPED [1] dask/array/tests/test_xarray.py:7: could not import 'xarray': No module named 'xarray'
ERROR dask/tests/test_base.py - pytest.PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo?  You can register custom marks to avoi...
ERROR dask/tests/test_distributed.py - pytest.PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo?  You can register custom marks ...
ERROR dask/tests/test_graph_manipulation.py - pytest.PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo?  You can register custom...
ERROR dastestiék/tests/test_threaded.py - pytest.PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo?  You can register custom marks to ...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================ 5 skipped, 4 errors in 1.87s ============================================================

Ups.
Estoy en el horno.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de Gustavo
Val: 64
Ha disminuido su posición en 2 puestos en Python (en relación al último mes)
Gráfica de Python

Pandas

Publicado por Gustavo (24 intervenciones) el 28/07/2021 05:05:57
Estoy usando chunksize para abrir el archivo con Pandas (se me había pasado) y está funcionando y prescindo de Dask.

Gracias por tu ayuda Costero.

.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar