Search is not available for this dataset
repo_id stringlengths 12 110 | file_path stringlengths 24 164 | content stringlengths 3 89.3M | __index_level_0__ int64 0 0 |
|---|---|---|---|
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/stata/stata3.csv | "year","quarter","realgdp","realcons","realinv","realgovt","realdpi","cpi","m1","tbilrate","unemp","pop","infl","realint"
1959,1,2710.349,1707.4,286.898,470.045,1886.9,28.980,139.7,2.82,5.8,177.146,0,0
1959,2,2778.801,1733.7,310.859,481.301,1919.7,29.150,141.7,3.08,5.1,177.830,2.34,0.74
1959,3,2775.488,1751.8,289.226,4... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/stata/stata6.csv | byte_,int_,long_,float_,double_,date_td,string_,string_1
0,0,0,0,0,1960-01-01,"a","a"
1,1,1,1,1,3014-12-31,"ab","b"
-1,-1,-1,-1,-1,2014-12-31,"abc","c"
100,32740,-2147483647,-1.7010000002777e+38,-2.000000000000e+307,1970-01-01,"This string has 244 characters, so that ir is the maximum length permitted by Stata. This st... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/fixed_width/fixed_width_format.txt | A B C
1 2 3
4 5 6
| 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/xml/row_field_output.xsl | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" indent="yes" />
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template ma... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/xml/flatten_doc.xsl | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:k="http://www.opengis.net/kml/2.2">
<xsl:output method="xml" omit-xml-declaration="yes"
cdata-section-elements="k:description" indent="yes"/>
<xsl:strip-space elements="*"/>
<x... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/xml/books.xml | <?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book category="cooking">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/xml/cta_rail_lines.kml | <kml xmlns="http://www.opengis.net/kml/2.2"
xmlns:gx="http://www.google.com/kml/ext/2.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd http://www.google.com/kml/ext/2.2 http://code.google.com/apis... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/xml/doc_ch_utf.xml | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fragmentdoc [
<!ELEMENT qafragment (qa+)>
<!ELEMENT qa ( q, a )>
<!ELEMENT q ( #PCDATA | title | name)*>
<!ATTLIST q speaker CDATA #REQUIRED>
<!ELEMENT a ( #PCDATA | title | name)*>
<!ATTLIST a speaker CDATA #REQUIRED>
<!ELEMENT name (#PCDATA)>
<!ELEMENT ... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/csv/tips.csv | total_bill,tip,sex,smoker,day,time,size
16.99,1.01,Female,No,Sun,Dinner,2
10.34,1.66,Male,No,Sun,Dinner,3
21.01,3.5,Male,No,Sun,Dinner,3
23.68,3.31,Male,No,Sun,Dinner,2
24.59,3.61,Female,No,Sun,Dinner,4
25.29,4.71,Male,No,Sun,Dinner,4
8.77,2.0,Male,No,Sun,Dinner,2
26.88,3.12,Male,No,Sun,Dinner,4
15.04,1.96,Male,No,Sun,... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/csv/test1.csv | index,A,B,C,D
2000-01-03 00:00:00,0.980268513777,3.68573087906,-0.364216805298,-1.15973806169
2000-01-04 00:00:00,1.04791624281,-0.0412318367011,-0.16181208307,0.212549316967
2000-01-05 00:00:00,0.498580885705,0.731167677815,-0.537677223318,1.34627041952
2000-01-06 00:00:00,1.12020151869,1.56762092543,0.00364077397681,... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/csv/iris.csv | SepalLength,SepalWidth,PetalLength,PetalWidth,Name
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
4.6,3.1,1.5,0.2,Iris-setosa
5.0,3.6,1.4,0.2,Iris-setosa
5.4,3.9,1.7,0.4,Iris-setosa
4.6,3.4,1.4,0.3,Iris-setosa
5.0,3.4,1.5,0.2,Iris-setosa
4.4,2.9,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,I... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/csv/banklist.csv | Bank Name,City,ST,CERT,Acquiring Institution,Closing Date,Updated Date
Banks of Wisconsin d/b/a Bank of Kenosha,Kenosha,WI,35386,"North Shore Bank, FSB",31-May-13,31-May-13
Central Arizona Bank,Scottsdale,AZ,34527,Western State Bank,14-May-13,20-May-13
Sunrise Bank,Valdosta,GA,58185,Synovus Bank,10-May-13,21-May-13
Pis... | 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/csv/test_mmap.csv | a,b,c
1,one,I
2,two,II
3,three,III
| 0 |
public_repos/pandas/pandas/tests/io/data | public_repos/pandas/pandas/tests/io/data/html_encoding/chinese_utf-8.html | <table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>0</th>
<th>1</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td> 漊煻獌</td>
<td> 漊煻獌</td>
</tr>
<tr>
<th>1</th>
<td> 袟袘觕</td>
<td> 袟袘觕</td>
</tr>
... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_time_series.py | import datetime
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
_testing as tm,
)
from pandas.tests.io.pytables.common import ensure_clean_store
pytestmark = pytest.mark.single_cpu
def test_store_datetime_fractional_secs(setup_path):
with ensure_clean_store(setup_path) as s... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_subclass.py | import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
from pandas.io.pytables import (
HDFStore,
read_hdf,
)
pytest.importorskip("tables")
class TestHDFStoreSubclass:
# GH 33748
def test_supported_for_subclass_dataframe(self, tmp_path):
... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_round_trip.py | import datetime
import re
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
from pandas.compat import is_platform_windows
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
_testing as tm,
bdate_range,
read_hdf,
)
from pandas.tests.io.pytables.common i... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_timezones.py | from datetime import (
date,
timedelta,
)
import numpy as np
import pytest
from pandas._libs.tslibs.timezones import maybe_get_tz
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Series,
Timestamp,
date_range,
)
import pandas._te... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/common.py | from collections.abc import Generator
from contextlib import contextmanager
import pathlib
import tempfile
import pytest
from pandas.io.pytables import HDFStore
tables = pytest.importorskip("tables")
# set these parameters so we don't have file sharing
tables.parameters.MAX_NUMEXPR_THREADS = 1
tables.parameters.MAX_... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_retain_attributes.py | import pytest
from pandas._libs.tslibs import Timestamp
from pandas import (
DataFrame,
Series,
_testing as tm,
date_range,
errors,
read_hdf,
)
from pandas.tests.io.pytables.common import (
_maybe_remove,
ensure_clean_store,
)
pytestmark = pytest.mark.single_cpu
def test_retain_inde... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/conftest.py | import uuid
import pytest
@pytest.fixture
def setup_path():
"""Fixture for setup path"""
return f"tmp.__{uuid.uuid4()}__.h5"
| 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_complex.py | import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
from pandas.tests.io.pytables.common import ensure_clean_store
from pandas.io.pytables import read_hdf
def test_complex_fixed(tmp_path, setup_path):
df = DataFrame(
np.rand... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_select.py | import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
import pandas as pd
from pandas import (
DataFrame,
HDFStore,
Index,
MultiIndex,
Series,
_testing as tm,
bdate_range,
concat,
date_range,
isna,
read_hdf,
)
from pandas.tests.io.pytables.common import... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_file_handling.py | import os
import numpy as np
import pytest
from pandas.compat import (
PY311,
is_ci_environment,
is_platform_linux,
is_platform_little_endian,
)
from pandas.errors import (
ClosedFileError,
PossibleDataLossError,
)
from pandas import (
DataFrame,
HDFStore,
Series,
_testing as ... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_read.py | from contextlib import closing
from pathlib import Path
import re
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
from pandas.compat import is_platform_windows
import pandas as pd
from pandas import (
DataFrame,
HDFStore,
Index,
Series,
_testing as tm,
read_hdf,
)
f... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_put.py | import datetime
import re
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
import pandas as pd
from pandas import (
DataFrame,
HDFStore,
Index,
MultiIndex,
Series,
_testing as tm,
concat,
)
from pandas.tests.io.pytables.common import (
_maybe_remove,
ensu... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_append.py | import datetime
from datetime import timedelta
import re
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
Series,
_testing as tm,
concat,
date_range,
read_hdf,
)
from pandas... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_keys.py | import pytest
from pandas import (
DataFrame,
HDFStore,
_testing as tm,
)
from pandas.tests.io.pytables.common import (
ensure_clean_store,
tables,
)
pytestmark = pytest.mark.single_cpu
def test_keys(setup_path):
with ensure_clean_store(setup_path) as store:
store["a"] = tm.makeTimeS... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_pytables_missing.py | import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
@td.skip_if_installed("tables")
def test_pytables_raises():
df = pd.DataFrame({"A": [1, 2]})
with pytest.raises(ImportError, match="tables"):
with tm.ensure_clean("foo.h5") as path:
d... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_errors.py | import datetime
from io import BytesIO
import re
import numpy as np
import pytest
from pandas import (
CategoricalIndex,
DataFrame,
HDFStore,
MultiIndex,
_testing as tm,
date_range,
read_hdf,
)
from pandas.tests.io.pytables.common import ensure_clean_store
from pandas.io.pytables import (... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_compat.py | import pytest
import pandas as pd
import pandas._testing as tm
tables = pytest.importorskip("tables")
@pytest.fixture
def pytables_hdf5_file(tmp_path):
"""
Use PyTables to create a simple HDF5 file.
"""
table_schema = {
"c0": tables.Time64Col(pos=0),
"c1": tables.StringCol(5, pos=1),... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_categorical.py | import numpy as np
import pytest
from pandas import (
Categorical,
DataFrame,
Series,
_testing as tm,
concat,
read_hdf,
)
from pandas.tests.io.pytables.common import (
_maybe_remove,
ensure_clean_store,
)
pytestmark = pytest.mark.single_cpu
def test_categorical(setup_path):
with ... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/pytables/test_store.py | import contextlib
import datetime as dt
import hashlib
import tempfile
import time
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Index,
MultiIndex,
Series,
Timestamp,
concat,
date_range,
timedelta_range,
)
import pandas._testing... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/xml/test_xml.py | from __future__ import annotations
from io import (
BytesIO,
StringIO,
)
from lzma import LZMAError
import os
from tarfile import ReadError
from urllib.error import HTTPError
from xml.etree.ElementTree import ParseError
from zipfile import BadZipFile
import numpy as np
import pytest
from pandas.compat._optio... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/xml/test_to_xml.py | from __future__ import annotations
from io import (
BytesIO,
StringIO,
)
import os
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
NA,
DataFrame,
Index,
)
import pandas._testing as tm
from pandas.io.common import get_handle
from pandas.io.xml impo... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/xml/conftest.py | import pytest
@pytest.fixture
def xml_data_path(tests_io_data_path, datapath):
return tests_io_data_path / "xml"
@pytest.fixture
def xml_books(xml_data_path, datapath):
return datapath(xml_data_path / "books.xml")
@pytest.fixture
def xml_doc_ch_utf(xml_data_path, datapath):
return datapath(xml_data_pa... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/xml/test_xml_dtypes.py | from __future__ import annotations
from io import StringIO
import pytest
from pandas.errors import ParserWarning
import pandas.util._test_decorators as td
from pandas import (
DataFrame,
Series,
to_datetime,
)
import pandas._testing as tm
from pandas.io.xml import read_xml
@pytest.fixture(params=[pyt... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_skiprows.py | """
Tests that skipped rows are properly handled during
parsing for all of the parsers defined in parsers.py
"""
from datetime import datetime
from io import StringIO
import numpy as np
import pytest
from pandas.errors import EmptyDataError
from pandas import (
DataFrame,
Index,
)
import pandas._testing as ... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_comment.py | """
Tests that comments are properly handled during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
import numpy as np
import pytest
from pandas import DataFrame
import pandas._testing as tm
@pytest.mark.parametrize("na_values", [None, ["NaN"]])
def test_comment(all_parsers, na_valu... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_upcast.py | import numpy as np
import pytest
from pandas._libs.parsers import (
_maybe_upcast,
na_values,
)
import pandas as pd
from pandas import NA
import pandas._testing as tm
from pandas.core.arrays import (
ArrowStringArray,
BooleanArray,
FloatingArray,
IntegerArray,
StringArray,
)
def test_may... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_dialect.py | """
Tests that dialects are properly handled during parsing
for all of the parsers defined in parsers.py
"""
import csv
from io import StringIO
import pytest
from pandas.errors import ParserWarning
from pandas import DataFrame
import pandas._testing as tm
pytestmark = pytest.mark.filterwarnings(
"ignore:Passin... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_encoding.py | """
Tests encoding functionality during parsing
for all of the parsers defined in parsers.py
"""
from io import (
BytesIO,
TextIOWrapper,
)
import os
import tempfile
import uuid
import numpy as np
import pytest
from pandas import (
DataFrame,
read_csv,
)
import pandas._testing as tm
pytestmark = pyte... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_quoting.py | """
Tests that quoting specifications are properly handled
during parsing for all of the parsers defined in parsers.py
"""
import csv
from io import StringIO
import pytest
from pandas.compat import PY311
from pandas.errors import ParserError
from pandas import DataFrame
import pandas._testing as tm
pytestmark = py... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_na_values.py | """
Tests that NA values are properly handled during
parsing for all of the parsers defined in parsers.py
"""
from io import StringIO
import numpy as np
import pytest
from pandas._libs.parsers import STR_NA_VALUES
from pandas import (
DataFrame,
Index,
MultiIndex,
)
import pandas._testing as tm
pytestma... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_unsupported.py | """
Tests that features that are currently unsupported in
either the Python or C parser are actually enforced
and are clearly communicated to the user.
Ultimately, the goal is to remove test cases from this
test suite as new feature support is added to the parsers.
"""
from io import StringIO
import os
from pathlib im... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_read_fwf.py | """
Tests the 'read_fwf' function in parsers.py. This
test suite is independent of the others because the
engine is set to 'python-fwf' internally.
"""
from datetime import datetime
from io import (
BytesIO,
StringIO,
)
from pathlib import Path
import numpy as np
import pytest
from pandas.errors import Empty... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_multi_thread.py | """
Tests multithreading behaviour for reading and
parsing files for each parser defined in parsers.py
"""
from contextlib import ExitStack
from io import BytesIO
from multiprocessing.pool import ThreadPool
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame
import pandas._testing as tm
... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/conftest.py | from __future__ import annotations
import os
import pytest
from pandas.compat._optional import VERSIONS
from pandas import (
read_csv,
read_table,
)
import pandas._testing as tm
class BaseParser:
engine: str | None = None
low_memory = True
float_precision_choices: list[str | None] = []
de... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_c_parser_only.py | """
Tests that apply specifically to the CParser. Unless specifically stated
as a CParser-specific issue, the goal is to eventually move as many of
these tests out of this module as soon as the Python parser can accept
further arguments when parsing.
"""
from decimal import Decimal
from io import (
BytesIO,
Str... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_python_parser_only.py | """
Tests that apply specifically to the Python parser. Unless specifically
stated as a Python-specific issue, the goal is to eventually move as many of
these tests out of this module as soon as the C parser can accept further
arguments when parsing.
"""
from __future__ import annotations
import csv
from io import (
... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_converters.py | """
Tests column conversion functionality during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
from dateutil.parser import parse
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
)
import pandas._testing as tm
def test_converters_t... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_index_col.py | """
Tests that the specified index column (a.k.a "index_col")
is properly handled or inferred during parsing for all of
the parsers defined in parsers.py
"""
from io import StringIO
import numpy as np
import pytest
from pandas import (
DataFrame,
Index,
MultiIndex,
)
import pandas._testing as tm
pytestma... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_compression.py | """
Tests compressed data parsing functionality for all
of the parsers defined in parsers.py
"""
import os
from pathlib import Path
import tarfile
import zipfile
import pytest
from pandas import DataFrame
import pandas._testing as tm
pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to Dat... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_textreader.py | """
Tests the TextReader class in parsers.pyx, which
is integral to the C engine in parsers.py
"""
from io import (
BytesIO,
StringIO,
)
import numpy as np
import pytest
import pandas._libs.parsers as parser
from pandas._libs.parsers import TextReader
from pandas.errors import ParserWarning
from pandas impor... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_header.py | """
Tests that the file header is properly handled or inferred
during parsing for all of the parsers defined in parsers.py
"""
from collections import namedtuple
from io import StringIO
import numpy as np
import pytest
from pandas.errors import ParserError
from pandas import (
DataFrame,
Index,
MultiInd... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_concatenate_chunks.py | import numpy as np
import pytest
from pandas.errors import DtypeWarning
import pandas._testing as tm
from pandas.core.arrays import ArrowExtensionArray
from pandas.io.parsers.c_parser_wrapper import _concatenate_chunks
def test_concatenate_chunks_pyarrow():
# GH#51876
pa = pytest.importorskip("pyarrow")
... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_network.py | """
Tests parsers ability to read and parse non-local files
and hence require a network connection to be read.
"""
from io import (
BytesIO,
StringIO,
)
import logging
import numpy as np
import pytest
from pandas.compat import is_ci_environment
import pandas.util._test_decorators as td
from pandas import Dat... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_parse_dates.py | """
Tests date parsing functionality for all of the
parsers defined in parsers.py
"""
from datetime import (
date,
datetime,
timedelta,
timezone,
)
from io import StringIO
from dateutil.parser import parse as du_parse
from hypothesis import given
import numpy as np
import pytest
import pytz
from pand... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/parser/test_mangle_dupes.py | """
Tests that duplicate columns are handled appropriately when parsed by the
CSV engine. In general, the expected result is that they are either thoroughly
de-duplicated (if mangling requested) or ignored otherwise.
"""
from io import StringIO
import pytest
from pandas import DataFrame
import pandas._testing as tm
... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/data/tar_csv.tar | tar_data.csv 0000666 0000000 0000000 00000000006 13113102422 011465 0 ustar ... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/data/salaries.csv | S X E M
13876 1 1 1
11608 1 3 0
18701 1 3 1
11283 1 2 0
11767 1 3 0
20872 2 2 1
11772 2 2 0
10535 2 1 0
12195 2 3 0
12313 3 2 0
14975 3 1 1
21371 3 2 1
19800 3 3 1
11417 4 1 0
20263 4 3 1
13231 4 3 0
12884 4 2 0
13245 5 2 0
13677 5 3 0
15965 5 1 1
12336 6 1 ... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/data/test2.csv | A,B,C,D,E
2000-01-03 00:00:00,0.980268513777,3.68573087906,-0.364216805298,-1.15973806169,foo
2000-01-04 00:00:00,1.04791624281,-0.0412318367011,-0.16181208307,0.212549316967,bar
2000-01-05 00:00:00,0.498580885705,0.731167677815,-0.537677223318,1.34627041952,baz
2000-01-06 00:00:00,1.12020151869,1.56762092543,0.0036407... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/data/sub_char.csv | a,"b",c
1,2,3 | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/data/items.jsonl | {"a": 1, "b": 2}
{"b":2, "a" :1}
| 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/data/test_mmap.csv | a,b,c
1,one,I
2,two,II
3,three,III
| 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_file_buffer_url.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import (
BytesIO,
StringIO,
)
import os
import platform
from urllib.error import URLError
import uuid
import pytest
from pandas.errors import (
EmptyDataError,
Parser... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_verbose.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import StringIO
import pytest
def test_verbose_read(all_parsers, capsys):
parser = all_parsers
data = """a,b,c,d
one,1,2,3
one,1,2,3
,1,2,3
one,1,2,3
,1,2,3
,1,2,3
one,1,2,3... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_common_basic.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from datetime import datetime
from inspect import signature
from io import StringIO
import os
from pathlib import Path
import sys
import numpy as np
import pytest
from pandas.errors import (... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_read_errors.py | """
Tests that work on the Python, C and PyArrow engines but do not have a
specific classification into the other test modules.
"""
import codecs
import csv
from io import StringIO
import os
from pathlib import Path
import numpy as np
import pytest
from pandas.compat import PY311
from pandas.errors import (
Empty... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_ints.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import StringIO
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
pytestmark = pytest.mark.filterwarnings(
"ignore:... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_index.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from datetime import datetime
from io import StringIO
import os
import pytest
from pandas import (
DataFrame,
Index,
MultiIndex,
)
import pandas._testing as tm
pytestmark = pyte... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_decimal.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import StringIO
import pytest
from pandas import DataFrame
import pandas._testing as tm
pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:Depr... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_data_list.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
import csv
from io import StringIO
import pytest
from pandas import DataFrame
import pandas._testing as tm
from pandas.io.parsers import TextParser
pytestmark = pytest.mark.filterwarnings(... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_chunksize.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import StringIO
import numpy as np
import pytest
from pandas._libs import parsers as libparsers
from pandas.errors import DtypeWarning
from pandas import (
DataFrame,
concat... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_inf.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import StringIO
import numpy as np
import pytest
from pandas import (
DataFrame,
option_context,
)
import pandas._testing as tm
pytestmark = pytest.mark.filterwarnings(
... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_iterator.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import StringIO
import pytest
from pandas import (
DataFrame,
concat,
)
import pandas._testing as tm
pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockMana... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/common/test_float.py | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import StringIO
import numpy as np
import pytest
from pandas.compat import is_platform_linux
from pandas import DataFrame
import pandas._testing as tm
pytestmark = pytest.mark.filt... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/dtypes/test_empty.py | """
Tests dtype specification during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
import numpy as np
import pytest
from pandas import (
Categorical,
DataFrame,
Index,
MultiIndex,
Series,
concat,
)
import pandas._testing as tm
skip_pyarrow = pytest.mark.usef... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/dtypes/test_categorical.py | """
Tests dtype specification during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
import os
import numpy as np
import pytest
from pandas._libs import parsers as libparsers
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
from pandas import (
Categori... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/dtypes/test_dtypes_basic.py | """
Tests dtype specification during parsing
for all of the parsers defined in parsers.py
"""
from collections import defaultdict
from io import StringIO
import numpy as np
import pytest
from pandas.errors import ParserWarning
import pandas as pd
from pandas import (
DataFrame,
Timestamp,
)
import pandas._te... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/usecols/test_usecols_basic.py | """
Tests the usecols functionality during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
import numpy as np
import pytest
from pandas.errors import ParserError
from pandas import (
DataFrame,
Index,
array,
)
import pandas._testing as tm
pytestmark = pytest.mark.filterw... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/usecols/test_strings.py | """
Tests the usecols functionality during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
import pytest
from pandas import DataFrame
import pandas._testing as tm
pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
)
def test... | 0 |
public_repos/pandas/pandas/tests/io/parser | public_repos/pandas/pandas/tests/io/parser/usecols/test_parse_dates.py | """
Tests the usecols functionality during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
import pytest
from pandas import (
DataFrame,
Index,
Timestamp,
)
import pandas._testing as tm
pytestmark = pytest.mark.filterwarnings(
"ignore:Passing a BlockManager to DataFra... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/json/test_readlines.py | from collections.abc import Iterator
from io import StringIO
from pathlib import Path
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
read_json,
)
import pandas._testing as tm
from pandas.io.json._json import JsonReader
pytestmark = pytest.mark.filterwarnings(
"ignor... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/json/test_deprecated_kwargs.py | """
Tests for the deprecated keyword arguments for `read_json`.
"""
from io import StringIO
import pandas as pd
import pandas._testing as tm
from pandas.io.json import read_json
def test_good_kwargs():
df = pd.DataFrame({"A": [2, 4, 6], "B": [3, 6, 9]}, index=[0, 1, 2])
with tm.assert_produces_warning(None... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/json/test_pandas.py | import datetime
from datetime import timedelta
from decimal import Decimal
from io import (
BytesIO,
StringIO,
)
import json
import os
import sys
import time
import numpy as np
import pytest
from pandas.compat import IS64
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/json/test_ujson.py | import calendar
import datetime
import decimal
import json
import locale
import math
import re
import time
import dateutil
import numpy as np
import pytest
import pytz
import pandas._libs.json as ujson
from pandas.compat import IS64
from pandas import (
DataFrame,
DatetimeIndex,
Index,
NaT,
Perio... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/json/conftest.py | import pytest
@pytest.fixture(params=["split", "records", "index", "columns", "values"])
def orient(request):
"""
Fixture for orients excluding the table format.
"""
return request.param
@pytest.fixture(params=["ujson", "pyarrow"])
def engine(request):
if request.param == "pyarrow":
pyte... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/json/test_compression.py | from io import (
BytesIO,
StringIO,
)
import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
def test_compression_roundtrip(compression):
df = pd.DataFrame(
[[0.123456, 0.234567, 0.567567], [12.32112, 123123.2, 321321.2]],
index=["A", "B... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/json/test_json_table_schema_ext_dtype.py | """Tests for ExtensionDtype Table Schema integration."""
from collections import OrderedDict
import datetime as dt
import decimal
from io import StringIO
import json
import pytest
from pandas import (
NA,
DataFrame,
Index,
array,
read_json,
)
import pandas._testing as tm
from pandas.core.arrays.i... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/json/test_json_table_schema.py | """Tests for Table Schema integration."""
from collections import OrderedDict
from io import StringIO
import json
import numpy as np
import pytest
from pandas.core.dtypes.dtypes import (
CategoricalDtype,
DatetimeTZDtype,
PeriodDtype,
)
import pandas as pd
from pandas import DataFrame
import pandas._test... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/json/test_normalize.py | import json
import numpy as np
import pytest
from pandas import (
DataFrame,
Index,
Series,
json_normalize,
)
import pandas._testing as tm
from pandas.io.json._normalize import nested_to_record
@pytest.fixture
def deep_nested():
# deeply nested data
return [
{
"country":... | 0 |
public_repos/pandas/pandas/tests/io/json | public_repos/pandas/pandas/tests/io/json/data/line_delimited.json | {"a": 1, "b": 2}
{"a": 3, "b": 4}
{"a": 5, "b": 6}
| 0 |
public_repos/pandas/pandas/tests/io/json | public_repos/pandas/pandas/tests/io/json/data/teams.csv | yearID,lgID,teamID,franchID,divID,Rank,G,Ghome,W,L,DivWin,WCWin,LgWin,WSWin,R,AB,H,2B,3B,HR,BB,SO,SB,CS,HBP,SF,RA,ER,ERA,CG,SHO,SV,IPouts,HA,HRA,BBA,SOA,E,DP,FP,name,park,attendance,BPF,PPF,teamIDBR,teamIDlahman45,teamIDretro
1871,NA,BS1,BNA,,3,31,,20,10,,,N,,401,1372,426,70,37,3,60,19,73,,,,303,109,3.5500000000,22,1,3... | 0 |
public_repos/pandas/pandas/tests/io/json | public_repos/pandas/pandas/tests/io/json/data/tsframe_v012.json | {"A":{"946857600000000000":1.56808523,"946944000000000000":-0.2550111,"947030400000000000":1.51493992,"947116800000000000":-0.02765498,"947203200000000000":0.05951614},"B":{"946857600000000000":0.65727391,"946944000000000000":-0.08072427,"947030400000000000":0.11805825,"947116800000000000":0.44679743,"94720320000000000... | 0 |
public_repos/pandas/pandas/tests/io/json | public_repos/pandas/pandas/tests/io/json/data/tsframe_iso_v012.json | {"A":{"2000-01-03T00:00:00":1.56808523,"2000-01-04T00:00:00":-0.2550111,"2000-01-05T00:00:00":1.51493992,"2000-01-06T00:00:00":-0.02765498,"2000-01-07T00:00:00":0.05951614},"B":{"2000-01-03T00:00:00":0.65727391,"2000-01-04T00:00:00":-0.08072427,"2000-01-05T00:00:00":0.11805825,"2000-01-06T00:00:00":0.44679743,"2000-01-... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/formats/test_to_string.py | from datetime import (
datetime,
timedelta,
)
from io import StringIO
import re
import sys
from textwrap import dedent
import numpy as np
import pytest
from pandas import (
CategoricalIndex,
DataFrame,
Index,
NaT,
Series,
Timestamp,
concat,
date_range,
get_option,
optio... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/formats/test_to_excel.py | """Tests formatting as writer-agnostic ExcelCells
ExcelFormatter is tested implicitly in pandas/tests/io/excel
"""
import string
import pytest
from pandas.errors import CSSWarning
import pandas._testing as tm
from pandas.io.formats.excel import (
CssExcelCell,
CSSToExcelConverter,
)
@pytest.mark.parametr... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/formats/test_to_markdown.py | from io import (
BytesIO,
StringIO,
)
import pytest
import pandas as pd
import pandas._testing as tm
pytest.importorskip("tabulate")
def test_simple():
buf = StringIO()
df = pd.DataFrame([1, 2, 3])
df.to_markdown(buf=buf)
result = buf.getvalue()
assert (
result == "| | 0 |\... | 0 |
public_repos/pandas/pandas/tests/io | public_repos/pandas/pandas/tests/io/formats/test_format.py | """
Tests for the file pandas.io.formats.format, *not* tests for general formatting
of pandas objects.
"""
from datetime import datetime
from io import StringIO
from pathlib import Path
import re
from shutil import get_terminal_size
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFra... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.