gL igddlmZddlmZmZddlmZddlmZddlm Z ddl m Z m Z m Z mZmZmZmZmZddlZddlZddlmZdd lmZmZdd lmZdd lmZdd lm Z dd l!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(m)Z)ddl*m+Z+ddl,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9ddl:m;Z;mZ>m?Z?m@Z@mAZAmBZBmCZCddlDmEZEddlFmGZGmHZHddlImJZJe r.ddlKmLZLmMZMddlNmOZOddlPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[ddl\m]Z]eded Z^e dH dId$Z_e dH dJd%Z_ dK dLd)Z_Gd*d+eZ`Gd,d-e`ZaGd.d/e`ZbGd0d1ebZced!d!d!d!d!d!d!d!d!d!d!d!d!d!d!d!d2 dMd3Zded!d!d!d!d!d!d!d!d!d!d!d!d!d!d!d4 dNd5Zded!d!d!d!d!d!d!d!d!d!d!d!d!d!d!d!d6 dOd7Zded!d!d!d!d!d!d!d!d!d!d!d!d!d!d!d!d!d8 dPd9Zde"e7d#e7d:d"z;ddd8 dQd?ZdGd@dAejee^ZgGdBdCZhGdDdEehZiGdFdGehZjy)R) annotations)ABCabstractmethod)abc)StringIO)islice) TYPE_CHECKINGAnyCallableGenericLiteralTypeVarfinaloverloadN)lib) ujson_dumps ujson_loads)iNaT)import_optional_dependencyAbstractMethodError)doc)find_stack_level)check_dtype_backend) ensure_stris_string_dtype) PeriodDtype) DataFrameIndex MultiIndexSeriesisnanotna to_datetime)concat) _shared_docs)arrow_table_to_pandas) IOHandles dedup_namesextension_to_compression file_exists get_handle is_fsspec_urlis_potential_multi_indexis_urlstringify_path)convert_to_line_delimits)build_table_schemaparse_table_schema)validate_integer)HashableMapping) TracebackType) CompressionOptionsDtypeArg DtypeBackendFilePath IndexLabel JSONEngineJSONSerializable ReadBufferSelfStorageOptions WriteBuffer)NDFrameFrameSeriesStrT)frameseries)bound. path_or_bufstorage_optionscyNrHobjorient date_formatdouble_precision force_ascii date_unitdefault_handlerlines compressionindexindentrImodes Z/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pandas/io/json/_json.pyto_jsonr[d"cyrKrLrMs rZr[r[xr\r]TFinferc |dvr| dur td|dvr| dur td| d} |r|dk7r td| d vrd | d }t|| d k(r|r|dk7r d }t||dk(r0t|tr |j|jxsd}|dk(rt|t rt }n9t|trt}n"t|t rt}n td||||||||| |  j}|r t|}|4t|| | | 5}|jj|dddy|S#1swYyxYw)N)recordsvaluesTzT'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns'.rWcolumnsFzV'index=False' is only valid when 'orient' is 'split', 'table', 'records', or 'values'.raz3'lines' keyword only valid when 'orient' is records)awzmode=z@ is not a valid option.Only 'w' and 'a' are currently supported.rezNmode='a' (append) is only supported when lines is True and orient is 'records'tablerb)namez''obj' should be a Series or a DataFrame)rOrPrQ ensure_asciirSrTrWrX)rVrI) ValueError isinstancer!to_framerhrJSONTableWriter SeriesWriter FrameWriterNotImplementedErrorwriter1r,handle)rHrNrOrPrQrRrSrTrUrVrWrXrIrYmsgwritershandless rZr[r[s &&5D= %   ' 'EUN &    9$NOO :D68 8 o s{EVy%8 4 o ZV4ll 4Hl5ZY7  C  C #!"KLL ) '  eg $Q '  ;  $  NN  # $   $ s 2EE"cxeZdZUded< d d dZd dZd dZeed dZ y) Writerstr_default_orientNc ||_| |j}||_||_||_||_||_||_||_| |_ d|_ |jyrK) rNrzrOrPrQrirSrTrWrXis_copy _format_axes) selfrNrOrPrQrirSrWrTrXs rZ__init__zWriter.__init__sj >))F & 0(".    r]ct|rKrr~s rZr}zWriter._format_axes !$''r]c |jdk(}t|j|j|j|j |j ||j|jS)Niso)rOrQrirS iso_datesrTrX) rPr obj_to_writerOrQrirSrTrX)r~rs rZrqz Writer.writes[$$-    ;;!22**nn 00;;  r]cy)zObject to write in JSON format.NrLrs rZrzWriter.obj_to_writer]Nr)rNrCrO str | NonerPryrQintriboolrSryrWrrT(Callable[[Any], JSONSerializable] | NonerXrreturnNonerrrryrz"NDFrame | Mapping[IndexLabel, Any]) __name__ __module__ __qualname____annotations__rr}rqpropertyrrrLr]rZrxrxsEI      B :(  ..r]rxc*eZdZdZeddZddZy)rnrWc|js<|jdk(r-|jj|jjdS|jS)Nsplit)rhdata)rWrOrNrhrbrs rZrzSeriesWriter.obj_to_writes8zzdkkW4 HHMM488??C C88Or]c|jjjs)|jdk(rt d|jdyy)NrWz(Series index must be unique for orient='')rNrW is_uniquerOrjrs rZr}zSeriesWriter._format_axes"sAxx~~''DKK7,BG }TUVW W-C'r]Nrrrrrrzrrr}rLr]rZrnrnsO  Xr]rnc*eZdZdZeddZddZy)rordc|js0|jdk(r!|jjd}|d=|S|j}|S)Nr)rOrW)rWrOrNto_dict)r~rs rZrzFrameWriter.obj_to_write*sLzzdkkW488++7+;LW% 88Lr]c"|jjjs'|jdvrt d|jd|jj js(|jdvrt d|jdyy)z: Try to format axes if they are datelike. rcz+DataFrame index must be unique for orient='z'.)rWrdraz-DataFrame columns must be unique for orient='N)rNrWrrOrjrdrs rZr}zFrameWriter._format_axes3sxx~~''DKK;O,O=dkk]"M xx))dkk> / ? }BO  / )r]NrrrrLr]rZroro'sO r]roc^eZdZdZ d dfd ZeddZxZS)rmrac t ||||||||||  |dk7rd|d} t| t||j|_|j dk(r%t|jtr td|j dk(r+|jt|jjvs8t|jj|jjr d } t| |j!}|j#d g j} t| r|| j%d || <t|jj&t(r|jj+|_|js|j-d |_n|j-d|_d|_d|_||_y)z Adds a `schema` attribute with the Table Schema, resets the index (can't do in caller, because the schema inference needs to know what the index is, forces orient to records, and forces date_format to 'iso'. )rTrXrz8Trying to write with `orient='table'` and `date_format='zH'`. Table Schema requires dates to be formatted with `date_format='iso'`rWz6orient='table' is not supported for MultiIndex columnsz/Overlapping names between the index and columns timedelta)includec"|jSrK) isoformat)xs rZz*JSONTableWriter.__init__..s AKKMr]T)dropFraN)superrrjr2rWschemandimrkrdr rprhsetnameslen intersectioncopy select_dtypesmapdtyper to_timestamp reset_indexrNrPrO) r~rNrOrPrQrirSrWrTrXrs timedeltas __class__s rZrzJSONTableWriter.__init__Hs$        +   % !!, .;;  S/ !(DJJ?  88q=Z Z@%H  XX]S113;;++CIIOO<=CCS/ !hhj&& }&=EE z?!*o112IJC O ciioo{ 3 ..0CIzzD1DHE2DH   r]c4|j|jdS)N)rr)rrNrs rZrzJSONTableWriter.obj_to_writes++txx88r]r)rOrrPryrQrrirrSryrWrrTrrXrrrr)rrrrzrrr __classcell__)rs@rZrmrmEsOEIFF F  F  FFFBFF FP99r]rm)rOtypr convert_axes convert_dateskeep_default_dates precise_floatrSencodingencoding_errorsrUrVnrowsrI dtype_backendenginecyrKrLrHrOrrrrrrrSrrrU chunksizerVrrIrrs rZ read_jsonr,r])rOrrrrrrSrrrUrVrrIrrcyrKrLrs rZrrrr])rOrrrrrrSrrrUrrVrrIrrcyrKrLrs rZrrrr])rOrrrrrrrSrrrUrrVrrIrrcyrKrLrs rZrrrr]decompression_options)rIrrEstrictujsonc&|dk(r |r td|dk(r |r tdt|||dk7rd}||dk7rd}t|fid|d|d|d|d |d |d |d |d | d| d| d| d|d|d| d|d|}| r|S|jS)a|" Convert a JSON string to pandas object. Parameters ---------- path_or_buf : a valid JSON str, path object or file-like object Any valid string path is acceptable. The string could be a URL. Valid URL schemes include http, ftp, s3, and file. For file URLs, a host is expected. A local file could be: ``file://localhost/path/to/table.json``. If you want to pass in a path object, pandas accepts any ``os.PathLike``. By file-like object, we refer to objects with a ``read()`` method, such as a file handle (e.g. via builtin ``open`` function) or ``StringIO``. .. deprecated:: 2.1.0 Passing json literal strings is deprecated. orient : str, optional Indication of expected JSON string format. Compatible JSON strings can be produced by ``to_json()`` with a corresponding orient value. The set of possible orients is: - ``'split'`` : dict like ``{{index -> [index], columns -> [columns], data -> [values]}}`` - ``'records'`` : list like ``[{{column -> value}}, ... , {{column -> value}}]`` - ``'index'`` : dict like ``{{index -> {{column -> value}}}}`` - ``'columns'`` : dict like ``{{column -> {{index -> value}}}}`` - ``'values'`` : just the values array - ``'table'`` : dict like ``{{'schema': {{schema}}, 'data': {{data}}}}`` The allowed and default values depend on the value of the `typ` parameter. * when ``typ == 'series'``, - allowed orients are ``{{'split','records','index'}}`` - default is ``'index'`` - The Series index must be unique for orient ``'index'``. * when ``typ == 'frame'``, - allowed orients are ``{{'split','records','index', 'columns','values', 'table'}}`` - default is ``'columns'`` - The DataFrame index must be unique for orients ``'index'`` and ``'columns'``. - The DataFrame columns must be unique for orients ``'index'``, ``'columns'``, and ``'records'``. typ : {{'frame', 'series'}}, default 'frame' The type of object to recover. dtype : bool or dict, default None If True, infer dtypes; if a dict of column to dtype, then use those; if False, then don't infer dtypes at all, applies only to the data. For all ``orient`` values except ``'table'``, default is True. convert_axes : bool, default None Try to convert the axes to the proper dtypes. For all ``orient`` values except ``'table'``, default is True. convert_dates : bool or list of str, default True If True then default datelike columns may be converted (depending on keep_default_dates). If False, no dates will be converted. If a list of column names, then those columns will be converted and default datelike columns may also be converted (depending on keep_default_dates). keep_default_dates : bool, default True If parsing dates (convert_dates is not False), then try to parse the default datelike columns. A column label is datelike if * it ends with ``'_at'``, * it ends with ``'_time'``, * it begins with ``'timestamp'``, * it is ``'modified'``, or * it is ``'date'``. precise_float : bool, default False Set to enable usage of higher precision (strtod) function when decoding string to double values. Default (False) is to use fast but less precise builtin functionality. date_unit : str, default None The timestamp unit to detect if converting dates. The default behaviour is to try and detect the correct precision, but if this is not desired then pass one of 's', 'ms', 'us' or 'ns' to force parsing only seconds, milliseconds, microseconds or nanoseconds respectively. encoding : str, default is 'utf-8' The encoding to use to decode py3 bytes. encoding_errors : str, optional, default "strict" How encoding errors are treated. `List of possible values `_ . .. versionadded:: 1.3.0 lines : bool, default False Read the file as a json object per line. chunksize : int, optional Return JsonReader object for iteration. See the `line-delimited json docs `_ for more information on ``chunksize``. This can only be passed if `lines=True`. If this is None, the file will be read into memory all at once. {decompression_options} .. versionchanged:: 1.4.0 Zstandard support. nrows : int, optional The number of lines from the line-delimited jsonfile that has to be read. This can only be passed if `lines=True`. If this is None, all the rows will be returned. {storage_options} dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` (still experimental). Behaviour is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` (default). * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` DataFrame. .. versionadded:: 2.0 engine : {{"ujson", "pyarrow"}}, default "ujson" Parser engine to use. The ``"pyarrow"`` engine is only available when ``lines=True``. .. versionadded:: 2.0 Returns ------- Series, DataFrame, or pandas.api.typing.JsonReader A JsonReader is returned when ``chunksize`` is not ``0`` or ``None``. Otherwise, the type returned depends on the value of ``typ``. See Also -------- DataFrame.to_json : Convert a DataFrame to a JSON string. Series.to_json : Convert a Series to a JSON string. json_normalize : Normalize semi-structured JSON data into a flat table. Notes ----- Specific to ``orient='table'``, if a :class:`DataFrame` with a literal :class:`Index` name of `index` gets written with :func:`to_json`, the subsequent read operation will incorrectly set the :class:`Index` name to ``None``. This is because `index` is also used by :func:`DataFrame.to_json` to denote a missing :class:`Index` name, and the subsequent :func:`read_json` operation cannot distinguish between the two. The same limitation is encountered with a :class:`MultiIndex` and any names beginning with ``'level_'``. Examples -------- >>> from io import StringIO >>> df = pd.DataFrame([['a', 'b'], ['c', 'd']], ... index=['row 1', 'row 2'], ... columns=['col 1', 'col 2']) Encoding/decoding a Dataframe using ``'split'`` formatted JSON: >>> df.to_json(orient='split') '{{"columns":["col 1","col 2"],"index":["row 1","row 2"],"data":[["a","b"],["c","d"]]}}' >>> pd.read_json(StringIO(_), orient='split') col 1 col 2 row 1 a b row 2 c d Encoding/decoding a Dataframe using ``'index'`` formatted JSON: >>> df.to_json(orient='index') '{{"row 1":{{"col 1":"a","col 2":"b"}},"row 2":{{"col 1":"c","col 2":"d"}}}}' >>> pd.read_json(StringIO(_), orient='index') col 1 col 2 row 1 a b row 2 c d Encoding/decoding a Dataframe using ``'records'`` formatted JSON. Note that index labels are not preserved with this encoding. >>> df.to_json(orient='records') '[{{"col 1":"a","col 2":"b"}},{{"col 1":"c","col 2":"d"}}]' >>> pd.read_json(StringIO(_), orient='records') col 1 col 2 0 a b 1 c d Encoding with Table Schema >>> df.to_json(orient='table') '{{"schema":{{"fields":[{{"name":"index","type":"string"}},{{"name":"col 1","type":"string"}},{{"name":"col 2","type":"string"}}],"primaryKey":["index"],"pandas_version":"1.4.0"}},"data":[{{"index":"row 1","col 1":"a","col 2":"b"}},{{"index":"row 2","col 1":"c","col 2":"d"}}]}}' The following example uses ``dtype_backend="numpy_nullable"`` >>> data = '''{{"index": {{"0": 0, "1": 1}}, ... "a": {{"0": 1, "1": null}}, ... "b": {{"0": 2.5, "1": 4.5}}, ... "c": {{"0": true, "1": false}}, ... "d": {{"0": "a", "1": "b"}}, ... "e": {{"0": 1577.2, "1": 1577.1}}}}''' >>> pd.read_json(StringIO(data), dtype_backend="numpy_nullable") index a b c d e 0 0 1 2.5 True a 1577.2 1 1 4.5 False b 1577.1 rgz)cannot pass both dtype and orient='table'z0cannot pass both convert_axes and orient='table'TrOrrrrrrrSrrUrrVrrIrrr)rjr JsonReaderread)rHrOrrrrrrrSrrrUrrVrrIrr json_readers rZrrs-ZUDEE \KLL & }7* ' 1    "  $ .$ ( (!"$#$%K*!!r]c0eZdZdZddej df ddZdZdZddZ e dd Z e dd Z e dd Z dd Z dd Z ddZ ddZe ddZe ddZe ddZddZddZ ddZy)rz JsonReader provides an interface for reading in a JSON file. If initialized with ``lines=True`` and ``chunksize``, can be iterated over ``chunksize`` lines at a time. Otherwise, calling ``read`` reads in the whole document. Nrrc||_||_||_||_||_||_||_| |_| |_||_ | |_ ||_ | |_ | |_ d|_||_||_d|_||_|jdvrt'd|jd|jMt)d|jd|_ |js t'd|jdk(r t'd |j3t)d |jd|_|js t'd t+|t,r4|js(d |vr$t/j0d t2t5|jdk(r|js t'd||_y|jdk(r(|j9|}|j;||_yy)Nr>rpyarrowzThe engine type z is currently not supported.rrz*chunksize can only be passed if lines=Truerz> %-k4>>1MDN:: !MNN{{i' R :: !)'4::qADJ:: !IJJ )3 /JJ** MMB+-   ;;) #:: 5+DI [[G #//0BCD--d3DI$r]ct|dr3|js'|js|5|j}dddt|ds#|js |jr t |}|S#1swY:xYw)a& At this point, the data either has a `read` attribute (e.g. a file object or a StringIO) or is a string that is a JSON document. If self.chunksize, we prepare the data for the `__next__` method. Otherwise, we read it into memory for the `read` method. rN)hasattrrrrr)r~rs rZrzJsonReader._preprocess_datasa 4 $..DJJ #yy{ #tV$$..DJJD>D  # #s A11A:c2t|}t|tr!t|st |s t |rVt |d|j|j|j|j|_ |jj}|St|trP|jjdtdt Dzrt |st#d|dt%j&dt(t+|S) a The function read_json accepts three input types: 1. filepath (string-like) 2. file-like object (e.g. open file object, StringIO) 3. JSON string This method turns (1) into (2) to simplify the rest of the processing. It returns input types (2) and (3) unchanged. It raises FileNotFoundError if the input is a string ending in one of .json, .json.gz, .json.bz2, etc. but no such file exists. r)rrVrIerrors).jsonc3&K|] }d| yw)rNrL).0cs rZ z5JsonReader._get_data_from_filepath..s"Q1U1#;"QszFile z does not existrr)r0rkryr/r-r+r,rrVrIrrvrrlowerendswithtupler*FileNotFoundErrorrrrr)r~rs rZrz"JsonReader._get_data_from_filepaths,,>?-s3()/0-.%" ,, $ 4 4++ DL"&!4!4 ""! )3 /"((*33U"Q8P"QQQ 23#e,>+?$OP P MMB+-  "!r]cfddjd|DDcgc]}|s| c}dScc}w)zG Combines a list of JSON objects into one JSON object. [,c3<K|]}|jywrK)strip)rlines rZrz,JsonReader._combine_lines..s+KTDJJL+Ks])join)r~rUrs rZ_combine_lineszJsonReader._combine_liness6 +KU+KT4t$TUVVW X Ts. . cyrKrLrs rZrzJsonReader.read r]cyrKrLrs rZrzJsonReader.readrr]cyrKrLrs rZrzJsonReader.readrr]cT|5|jdk(rFtd}|j|j}t ||j cdddS|jdk(r+|j r|jr t|}n|jrLtt|j|j}|j|}|j|}nbt|j}|jd}|j|j|}n|j|j}|j t j"ur&|j%d|j cdddS|cdddS dddy#1swYyxYw) zA Read the whole JSON input into a pandas object. rz pyarrow.json)rNrrF infer_objectsr)rrrrr'rrUrr%rlistrr_get_object_parserrrr no_defaultconvert_dtypes)r~ pyarrow_jsonpa_tablerNrU lines_jsonr data_liness rZrzJsonReader.reads^  {{i'9.I '11$))<,XTEWEWX    '::~~$Tl $VDIItzz%B C%)%8%8%? "55jA)$))4%)ZZ%5 "55d6I6I*6UV11$)) Parses a json document into a pandas object. )rOrrrrrrSrNrErFr)rrrOrrrrrSr FrameParserparserkr SeriesParser)r~jsonrrkwargsrNs rZrzJsonReader._get_object_parsershh kkZZ --!//"&"9"9!//!//   '>d-f-335C (?ckeT*"'wt.v.446C r]cR|j|jjyy)z If we opened a stream earlier, in _get_data_from_filepath, we should close it. If an open stream or file was passed, we leave it open. N)rvclosers rZrzJsonReader.closes# << # LL    $r]c|SrKrLrs rZ__iter__zJsonReader.__iter__# r]cyrKrLrs rZ__next__zJsonReader.__next__&rr]cyrKrLrs rZrzJsonReader.__next__*rr]cyrKrLrs rZrzJsonReader.__next__.rr]c|jr/|j|jk\r|jtt t |j |j}|s|jt |j|}|j|}t|j|jt|z|_ |xjt|z c_|jtj ur|j#d|jS|S#t$r}|j|d}~wwxYw)NFr)rrr StopIterationrrrrrrrangerrW Exceptionrrrr )r~rUr rNexs rZrzJsonReader.__next__2s ::$//TZZ7 JJL VDIIt~~67 JJL  ,,U3J))*5CdootS/IJCI OOs3x 'O   S^^ 3%%#43E3E& J  JJLH s>A1D** E 3EE c|SrKrLrs rZ __enter__zJsonReader.__enter__Nrr]c$|jyrK)r)r~exc_type exc_value tracebacks rZ__exit__zJsonReader.__exit__Qs r])rrDr bool | NonerrrrrUrr int | NonerVr8rr*rIStorageOptions | NonerrrDtypeBackend | lib.NoDefaultrr=rrr)r~JsonReader[Literal['frame']]rr)r~JsonReader[Literal['series']]rr!)r~z&JsonReader[Literal['frame', 'series']]rDataFrame | Series)rr/r)rr@)r%ztype[BaseException] | Noner&zBaseException | Noner'zTracebackType | Nonerr)rrr__doc__rrrrrrrrrrrrr#r(rLr]rZrr2s026&.69nn$'N4 N4 " N4!N4N4N4N4(N4N4 /!N4"$#N4$4%N4&'N4( )N4` ."`       >6!      8,((   r]rceZdZUded<ded<dZdddd dZded <d d d d d d ejf ddZe ddZ e dZ ddZ e ddZ ddZe d ddZe ddZy )Parserztuple[str, ...] _split_keysryrz)rumsusnsi3l,b/l`'rlF[L'rNTFc n||_| |j}||_||_|K|j }||j vrt d|j |j||_n|jd|_||_ ||_ ||_ ||_ ||_ d|_| |_y)Nzdate_unit must be one of ru)rrzrOrr _STAMP_UNITSrj _MIN_STAMPS min_stamprrrrSrrNr) r~rrOrrrrrrSrs rZrzParser.__init__gs >))F   !)I 1 11 # Hf~%   S^^ 3G:  TZZ ( {{9-  ::??c !djjI&= {{9- t9':: ;;w/$))+#D $I :: 4::#8 {{7+ 7?s4y{{g%U{"YQ1t|#&z2+#U{*+"z*  z*  z=9  z*  se>X %v.H >>X % ;;w/ hnn))299 5X%%&dnn,.##t+-  <<>U{"*...dnn&d>O>O # "I ,,.U++ 4!.  +8G)THUT> ! "U{;! #U{"z*   UU y9  sBE=E?+E3<E? E0E0/E03E< 8E??FF)rryrDtypeArg | Nonerrrbool | list[str]rrrrrr,rr)r>rdrrr)TTF) rhr5rr!rHrrryrIrrtuple[Series, bool])rr!rrz)rrrrr8r9rrrrrArrCrDrErLrhrLr]rZr2r2ZsZ  *L  K I "&!*.#(#69nn#+#+ #+  #+ ( #+!#+#+4#+ #+J T T  ( 7 7((  *. YYY Y ( Y  Y Y Yv 0 0r]r2c0eZdZUdZdZded<ddZddZy) rrW)rhrWrz Series | NonerNc,t|j|j}|jdk(rN|j Dcic]\}}t ||}}}|j |tdi||_yt||_ycc}}w)NrrrL) rrrrOitemsryrAr!rN)r~rkvr>s rZrCzSeriesParser._parseQsv499D4F4FG ;;' !-1ZZ\:TQs1vqy:G:  ! !' *((DHd|DH ;sBc|jy|jd|j|j\}}|r||_yy)Nrr)rNrLr)r~rNrRs rZrEzSeriesParser._try_convert_types[sJ 88  ,, DHHD,>,>- V DH r]Nr)rrrrzr3rrCrErLr]rZrrLsO+K $r]rcNeZdZUdZdZded<d dZ d d dZd dZd d Z y) rrd)rdrWrzDataFrame | NonerNc|j}|j}|dk(r(tt||jd|_y|dk(rt||jj Dcic]\}}t||}}}|j||dDcgc]}t|tr t|n|!}}t|t|d|d<td ddi||_y|dk(r3tjt||jdd|_y|dk(rt||j|_ytt||jd|_ycc}}wcc}w) Nrdr})rrrrW)rrOrgrL)rrOrrrrNr~ryrArkrrr)r. from_dictr3)r~rrOrrr>col orig_namess rZrCzFrameParser._parsejsuyy Y  D0B0BC4DHw (DP>PQDH D0B0BC4DH/ s 3E8$$E>Nc |d}|j}|Jd}i}t|jD]'\}\}}||r|||\} } | r| }d}|||<)|r0t||j} |j | _| |_yy)zM Take a conversion function and possibly recreate the frame. Ncy)NTrL)rs rZrz0FrameParser._process_converter..rr]FTr)rN enumerater~rrWrd) r~rZfiltrN needs_new_objnew_objirrrlrR new_frames rZ_process_converterzFrameParser._process_converters <#Dhh $SYY[1 KAxQCy#$S!9 & A$(MGAJ   !';I # I  DH r]cjyjrjjfdy)Nc,j||dS)NFr)rLrrr~s rZrz0FrameParser._try_convert_types..s411#q1Nr])rNr_try_convert_datesrrs`rZrEzFrameParser._try_convert_typess6 88       # # %  N r]cjyj}t|trg}t |dfd }j fd|y)Nc|vryjsyt|tsy|j}|j ds |dk(s|dk(s|dk(s|j dryy)zK Return if this col is ok to try for a date parse. TF)_at_timemodifieddatedatetime timestamp)rrkryrr startswith)r col_lowerrr~s rZis_okz-FrameParser._try_convert_dates..is_oksom#**c3' I""#34 *& *'' 4r]c&j|SrK)rhrs rZrz0FrameParser._try_convert_dates..st/H/H/Kr])r)rr)rNrrkrrr)r~convert_dates_list_boolrrs` @rZrzFrameParser._try_convert_datessV 88  #'"4"4 -t 4&( #34  ,  KRWXr]rrK)rZz1Callable[[Hashable, Series], tuple[Series, bool]]rz!Callable[[Hashable], bool] | Nonerr) rrrrzr3rrCrrErrLr]rZrresIO.K "N37! <!0!  !<  Yr]r) ............)rHz0FilePath | WriteBuffer[str] | WriteBuffer[bytes]rNrCrOrrPryrQrrRrrSryrTrrUrrVr8rWr)rXrrIrArYLiteral['a', 'w']rr)rHrrNrCrOrrPryrQrrRrrSryrTrrUrrVr8rWr)rXrrIrArYrrry) Nepoch Tr4NFr_NrNrf)rHz7FilePath | WriteBuffer[str] | WriteBuffer[bytes] | NonerNrCrOrrPryrQrrRrrSryrTrrUrrVr8rWr)rXrrIr+rYrrr)&rH.FilePath | ReadBuffer[str] | ReadBuffer[bytes]rOrrLiteral['frame']rrxrr)rryrrrrrSrrrrrrUrrrrVr8rr*rIrArr,rr=rr-)&rHrrOrrLiteral['series']rrxrr)rryrrrrrSrrrrrrUrrrrVr8rr*rIrArr,rr=rr.)&rHrrOrrrrrxrr)rryrrrrrSrrrrrrUrrrrVr8rr*rIrArr,rr=rr!)&rHrrOrrrrrxrr)rryrrrrrSrrrrrrUrrrrVr8rr*rIrArr,rr=rr)&rHrrOrrzLiteral['frame', 'series']rrxrr)rryrrrrrSrrrrrrUrrr*rVr8rr*rIr+rr,rr=rzDataFrame | Series | JsonReader)k __future__rrrr collectionsior itertoolsrtypingr r r r r rrrrnumpyrb pandas._libsrpandas._libs.jsonrrpandas._libs.tslibsrpandas.compat._optionalr pandas.errorsrpandas.util._decoratorsrpandas.util._exceptionsrpandas.util._validatorsrpandas.core.dtypes.commonrrpandas.core.dtypes.dtypesrpandasrrr r!r"r#r$pandas.core.reshape.concatr%pandas.core.shared_docsr&pandas.io._utilr'pandas.io.commonr(r)r*r+r,r-r.r/r0pandas.io.json._normalizer1pandas.io.json._table_schemar2r3pandas.io.parsers.readersr4collections.abcr5r6typesr7pandas._typingr8r9r:r;r<r=r>r?r@rArBpandas.core.genericrCrDr[rxrnrormrrIteratorrr2rrrLr]rZrs"   %>-'472.01   ?7$    ,+7;L3MN @C&)&)!A       > $  $   & @C&)&)!       > $  $   ,@D&--1!SHS S S S  S  SS>S S$S S S+S SSl3.S3.l X6 X&?-O&-! $&*# "* &--125.. 'r"?r" r" $ r"  r"  r"$r"r"r"r"r" r" r"r"$r" !r""+#r"$0%r"& 'r"(%)r" r"j ew7eP ood62qY&qYr]