├── doc ├── source │ ├── _static │ │ ├── stub │ │ ├── ci.png │ │ ├── eval-perf.png │ │ ├── favicon.ico │ │ ├── legacy_0.10.h5 │ │ ├── query-perf.png │ │ ├── style-excel.png │ │ ├── trunc_after.png │ │ ├── print_df_new.png │ │ ├── print_df_old.png │ │ ├── reshaping_melt.png │ │ ├── trunc_before.png │ │ ├── eval-perf-small.png │ │ ├── new-excel-index.png │ │ ├── old-excel-index.png │ │ ├── option_unicode01.png │ │ ├── option_unicode02.png │ │ ├── option_unicode03.png │ │ ├── option_unicode04.png │ │ ├── query-perf-small.png │ │ ├── reshaping_pivot.png │ │ ├── reshaping_stack.png │ │ ├── whatsnew_assign.png │ │ ├── df_repr_truncated.png │ │ ├── reshaping_unstack.png │ │ ├── reshaping_unstack_0.png │ │ ├── reshaping_unstack_1.png │ │ └── whatsnew_plot_submethods.png │ ├── styled.xlsx │ ├── themes │ │ └── nature_with_gtoc │ │ │ └── theme.conf │ ├── user_guide │ │ └── templates │ │ │ └── myhtml.tpl │ ├── reference │ │ ├── panel.rst │ │ └── plotting.rst │ ├── getting_started │ │ ├── comparison │ │ │ └── index.rst │ │ └── index.rst │ ├── development │ │ └── index.rst │ └── whatsnew │ │ └── v0.23.3.rst ├── data │ ├── test.xls │ ├── fx_prices │ └── mindex_ex.csv ├── .gitignore ├── logo │ └── pandas_logo.png ├── README.rst ├── cheatsheet │ ├── Pandas_Cheat_Sheet.pdf │ ├── Pandas_Cheat_Sheet.pptx │ ├── Pandas_Cheat_Sheet_JA.pdf │ ├── Pandas_Cheat_Sheet_JA.pptx │ └── README.txt ├── _templates │ ├── autosummary │ │ ├── class_without_autosummary.rst │ │ ├── accessor.rst │ │ ├── accessor_method.rst │ │ ├── accessor_attribute.rst │ │ └── accessor_callable.rst │ └── api_redirect.html └── sphinxext │ └── README.rst ├── pandas ├── core │ ├── __init__.py │ ├── util │ │ └── __init__.py │ ├── dtypes │ │ └── __init__.py │ ├── indexes │ │ └── __init__.py │ ├── reshape │ │ ├── __init__.py │ │ └── api.py │ ├── sparse │ │ ├── __init__.py │ │ └── api.py │ ├── tools │ │ └── __init__.py │ ├── computation │ │ ├── __init__.py │ │ ├── api.py │ │ └── check.py │ ├── arrays │ │ ├── sparse │ │ │ └── __init__.py │ │ └── __init__.py │ ├── window │ │ └── __init__.py │ ├── groupby │ │ └── __init__.py │ ├── index.py │ └── internals │ │ └── __init__.py ├── io │ ├── __init__.py │ ├── formats │ │ └── __init__.py │ ├── msgpack │ │ ├── _version.py │ │ ├── exceptions.py │ │ └── _packer.pyi │ ├── sas │ │ └── __init__.py │ ├── clipboard │ │ └── exceptions.py │ ├── json │ │ └── __init__.py │ ├── excel │ │ └── __init__.py │ ├── gcs.py │ └── api.py ├── tests │ ├── __init__.py │ ├── api │ │ └── __init__.py │ ├── io │ │ ├── __init__.py │ │ ├── json │ │ │ ├── __init__.py │ │ │ ├── data │ │ │ │ ├── tsframe_v012.json.zip │ │ │ │ └── tsframe_iso_v012.json │ │ │ └── conftest.py │ │ ├── sas │ │ │ ├── __init__.py │ │ │ ├── data │ │ │ │ ├── DEMO_G.xpt │ │ │ │ ├── DRXFCD_G.xpt │ │ │ │ ├── SSHSV1_A.xpt │ │ │ │ ├── cars.sas7bdat │ │ │ │ ├── test1.sas7bdat │ │ │ │ ├── test2.sas7bdat │ │ │ │ ├── test3.sas7bdat │ │ │ │ ├── test4.sas7bdat │ │ │ │ ├── test5.sas7bdat │ │ │ │ ├── test6.sas7bdat │ │ │ │ ├── test7.sas7bdat │ │ │ │ ├── test8.sas7bdat │ │ │ │ ├── test9.sas7bdat │ │ │ │ ├── airline.sas7bdat │ │ │ │ ├── datetime.sas7bdat │ │ │ │ ├── load_log.sas7bdat │ │ │ │ ├── test10.sas7bdat │ │ │ │ ├── test11.sas7bdat │ │ │ │ ├── test12.sas7bdat │ │ │ │ ├── test13.sas7bdat │ │ │ │ ├── test14.sas7bdat │ │ │ │ ├── test15.sas7bdat │ │ │ │ ├── test16.sas7bdat │ │ │ │ ├── paxraw_d_short.xpt │ │ │ │ ├── test_12659.sas7bdat │ │ │ │ ├── many_columns.sas7bdat │ │ │ │ ├── productsales.sas7bdat │ │ │ │ ├── zero_variables.sas7bdat │ │ │ │ └── datetime.csv │ │ │ └── test_sas.py │ │ ├── formats │ │ │ ├── __init__.py │ │ │ └── data │ │ │ │ └── html │ │ │ │ ├── with_classes.html │ │ │ │ ├── index_none_columns_none.html │ │ │ │ ├── gh14998_expected_output.html │ │ │ │ ├── unicode_2.html │ │ │ │ ├── gh21625_expected_output.html │ │ │ │ ├── gh22270_expected_output.html │ │ │ │ ├── index_unnamed_standard_columns_none.html │ │ │ │ ├── index_unnamed_multi_columns_none.html │ │ │ │ ├── datetime64_hourformatter.html │ │ │ │ ├── index_none_columns_unnamed_standard.html │ │ │ │ ├── datetime64_monthformatter.html │ │ │ │ ├── index_named_standard_columns_none.html │ │ │ │ ├── index_none_columns_unnamed_multi.html │ │ │ │ ├── gh12031_expected_output.html │ │ │ │ ├── index_none_columns_named_standard.html │ │ │ │ ├── index_unnamed_standard_columns_unnamed_standard.html │ │ │ │ ├── index_unnamed_standard_columns_named_standard.html │ │ │ │ ├── escape_disabled.html │ │ │ │ ├── index_named_multi_columns_none.html │ │ │ │ ├── index_unnamed_multi_columns_unnamed_standard.html │ │ │ │ ├── index_2.html │ │ │ │ ├── index_unnamed_standard_columns_unnamed_multi.html │ │ │ │ ├── index_unnamed_multi_columns_named_standard.html │ │ │ │ ├── escaped.html │ │ │ │ ├── index_none_columns_named_multi.html │ │ │ │ ├── index_unnamed_standard_columns_named_multi.html │ │ │ │ ├── index_named_standard_columns_unnamed_standard.html │ │ │ │ ├── index_named_standard_columns_named_standard.html │ │ │ │ ├── render_links_false.html │ │ │ │ ├── gh8452_expected_output.html │ │ │ │ ├── index_unnamed_multi_columns_unnamed_multi.html │ │ │ │ ├── index_1.html │ │ │ │ ├── justify.html │ │ │ │ ├── index_formatter.html │ │ │ │ ├── index_named_standard_columns_unnamed_multi.html │ │ │ │ ├── gh22783_expected_output.html │ │ │ │ ├── index_unnamed_multi_columns_named_multi.html │ │ │ │ ├── render_links_true.html │ │ │ │ ├── gh15019_expected_output.html │ │ │ │ ├── index_named_standard_columns_named_multi.html │ │ │ │ ├── index_named_multi_columns_unnamed_standard.html │ │ │ │ ├── index_named_multi_columns_named_standard.html │ │ │ │ ├── multiindex_2.html │ │ │ │ ├── multiindex_1.html │ │ │ │ ├── gh22783_named_columns_index.html │ │ │ │ ├── index_4.html │ │ │ │ ├── index_3.html │ │ │ │ ├── index_named_multi_columns_unnamed_multi.html │ │ │ │ ├── truncate_formatter.html │ │ │ │ ├── index_named_multi_columns_named_multi.html │ │ │ │ ├── trunc_df_index_none_columns_none.html │ │ │ │ ├── multiindex_sparsify_1.html │ │ │ │ ├── index_5.html │ │ │ │ ├── multiindex_sparsify_false_multi_sparse_1.html │ │ │ │ ├── multiindex_sparsify_2.html │ │ │ │ └── trunc_df_index_unnamed_standard_columns_none.html │ │ ├── msgpack │ │ │ ├── __init__.py │ │ │ ├── common.py │ │ │ ├── data │ │ │ │ └── frame.mp │ │ │ ├── test_subtype.py │ │ │ ├── test_buffer.py │ │ │ └── test_unpack_raw.py │ │ ├── parser │ │ │ ├── __init__.py │ │ │ └── data │ │ │ │ ├── sub_char.csv │ │ │ │ ├── items.jsonl │ │ │ │ ├── test_mmap.csv │ │ │ │ ├── tips.csv.gz │ │ │ │ ├── tar_csv.tar.gz │ │ │ │ ├── test1.csv.bz2 │ │ │ │ ├── test1.csv.gz │ │ │ │ ├── tips.csv.bz2 │ │ │ │ ├── utf16_ex.txt │ │ │ │ ├── salaries.csv.bz2 │ │ │ │ ├── salaries.csv.gz │ │ │ │ ├── salaries.csv.xz │ │ │ │ ├── salaries.csv.zip │ │ │ │ ├── unicode_series.csv │ │ │ │ ├── utf16_ex_small.zip │ │ │ │ ├── sauron.SHIFT_JIS.csv │ │ │ │ ├── test2.csv │ │ │ │ ├── test1.csv │ │ │ │ └── salaries.csv │ │ ├── pytables │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── test_pytables_missing.py │ │ ├── data │ │ │ ├── fixed_width_format.txt │ │ │ ├── test_mmap.csv │ │ │ ├── blank.ods │ │ │ ├── blank.xls │ │ │ ├── blank.xlsm │ │ │ ├── blank.xlsx │ │ │ ├── stata15.dta │ │ │ ├── test1.ods │ │ │ ├── test1.xls │ │ │ ├── test1.xlsm │ │ │ ├── test1.xlsx │ │ │ ├── test2.ods │ │ │ ├── test2.xls │ │ │ ├── test2.xlsm │ │ │ ├── test2.xlsx │ │ │ ├── test3.ods │ │ │ ├── test3.xls │ │ │ ├── test3.xlsm │ │ │ ├── test3.xlsx │ │ │ ├── test4.ods │ │ │ ├── test4.xls │ │ │ ├── test4.xlsm │ │ │ ├── test4.xlsx │ │ │ ├── test5.ods │ │ │ ├── test5.xls │ │ │ ├── test5.xlsm │ │ │ ├── test5.xlsx │ │ │ ├── umlauts.sav │ │ │ ├── S4_EDUC1.dta │ │ │ ├── testdtype.ods │ │ │ ├── testdtype.xls │ │ │ ├── labelled-num.sav │ │ │ ├── labelled-str.sav │ │ │ ├── stata10_115.dta │ │ │ ├── stata10_117.dta │ │ │ ├── stata11_115.dta │ │ │ ├── stata11_117.dta │ │ │ ├── stata12_117.dta │ │ │ ├── stata14_118.dta │ │ │ ├── stata16_118.dta │ │ │ ├── stata1_114.dta │ │ │ ├── stata1_117.dta │ │ │ ├── stata2_113.dta │ │ │ ├── stata2_114.dta │ │ │ ├── stata2_115.dta │ │ │ ├── stata2_117.dta │ │ │ ├── stata3_113.dta │ │ │ ├── stata3_114.dta │ │ │ ├── stata3_115.dta │ │ │ ├── stata3_117.dta │ │ │ ├── stata4_113.dta │ │ │ ├── stata4_114.dta │ │ │ ├── stata4_115.dta │ │ │ ├── stata4_117.dta │ │ │ ├── stata5_113.dta │ │ │ ├── stata5_114.dta │ │ │ ├── stata5_115.dta │ │ │ ├── stata5_117.dta │ │ │ ├── stata6_113.dta │ │ │ ├── stata6_114.dta │ │ │ ├── stata6_115.dta │ │ │ ├── stata6_117.dta │ │ │ ├── stata7_111.dta │ │ │ ├── stata7_115.dta │ │ │ ├── stata7_117.dta │ │ │ ├── stata8_113.dta │ │ │ ├── stata8_115.dta │ │ │ ├── stata8_117.dta │ │ │ ├── stata9_115.dta │ │ │ ├── stata9_117.dta │ │ │ ├── test_squeeze.ods │ │ │ ├── test_squeeze.xls │ │ │ ├── test_types.ods │ │ │ ├── test_types.xls │ │ │ ├── test_types.xlsm │ │ │ ├── test_types.xlsx │ │ │ ├── testdtype.xlsm │ │ │ ├── testdtype.xlsx │ │ │ ├── testskiprows.ods │ │ │ ├── testskiprows.xls │ │ │ ├── times_1900.ods │ │ │ ├── times_1900.xls │ │ │ ├── times_1900.xlsm │ │ │ ├── times_1900.xlsx │ │ │ ├── times_1904.ods │ │ │ ├── times_1904.xls │ │ │ ├── times_1904.xlsm │ │ │ ├── times_1904.xlsx │ │ │ ├── writertable.odt │ │ │ ├── stata13_dates.dta │ │ │ ├── stata1_119.dta.gz │ │ │ ├── test_squeeze.xlsm │ │ │ ├── test_squeeze.xlsx │ │ │ ├── testmultiindex.ods │ │ │ ├── testmultiindex.xls │ │ │ ├── testskiprows.xlsm │ │ │ ├── testskiprows.xlsx │ │ │ ├── blank_with_header.ods │ │ │ ├── blank_with_header.xls │ │ │ ├── feather-0_3_1.feather │ │ │ ├── labelled-num-na.sav │ │ │ ├── legacy_hdf │ │ │ │ ├── gh26443.h5 │ │ │ │ ├── datetimetz_object.h5 │ │ │ │ ├── legacy_table_py2.h5 │ │ │ │ ├── pytables_native.h5 │ │ │ │ ├── pytables_native2.h5 │ │ │ │ ├── legacy_table_fixed_py2.h5 │ │ │ │ └── periodindex_0.20.1_x86_64_darwin_2.7.13.h5 │ │ │ ├── stata1_encoding.dta │ │ │ ├── test_converters.ods │ │ │ ├── test_converters.xls │ │ │ ├── test_converters.xlsm │ │ │ ├── test_converters.xlsx │ │ │ ├── test_multisheet.ods │ │ │ ├── test_multisheet.xls │ │ │ ├── test_multisheet.xlsm │ │ │ ├── test_multisheet.xlsx │ │ │ ├── testdateoverflow.ods │ │ │ ├── testdateoverflow.xls │ │ │ ├── testdateoverflow.xlsm │ │ │ ├── testdateoverflow.xlsx │ │ │ ├── testmultiindex.xlsm │ │ │ ├── testmultiindex.xlsx │ │ │ ├── blank_with_header.xlsm │ │ │ ├── blank_with_header.xlsx │ │ │ ├── invalid_value_type.ods │ │ │ ├── stata1_encoding_118.dta │ │ │ ├── categorical.0.25.0.pickle │ │ │ ├── test_index_name_pre17.ods │ │ │ ├── test_index_name_pre17.xls │ │ │ ├── test_index_name_pre17.xlsm │ │ │ ├── test_index_name_pre17.xlsx │ │ │ ├── sparseframe-0.20.3.pickle.gz │ │ │ ├── html_encoding │ │ │ │ ├── letz_latin1.html │ │ │ │ ├── chinese_utf-16.html │ │ │ │ ├── chinese_utf-32.html │ │ │ │ └── chinese_utf-8.html │ │ │ ├── sparseseries-0.20.3.pickle.gz │ │ │ ├── legacy_msgpack │ │ │ │ └── 0.20.3 │ │ │ │ │ └── 0.20.3_x86_64_darwin_3.5.2.msgpack │ │ │ ├── legacy_pickle │ │ │ │ └── 0.20.3 │ │ │ │ │ ├── 0.20.3_x86_64_darwin_3.5.2.pickle │ │ │ │ │ └── 0.20.3_x86_64_darwin_3.5.6.pickle │ │ │ ├── test1.csv │ │ │ ├── stata6.csv │ │ │ └── gbq_fake_job.txt │ │ ├── excel │ │ │ └── __init__.py │ │ └── test_s3.py │ ├── arrays │ │ ├── __init__.py │ │ ├── sparse │ │ │ └── __init__.py │ │ ├── categorical │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── common.py │ │ ├── interval │ │ │ └── __init__.py │ │ └── string_ │ │ │ └── __init__.py │ ├── config │ │ └── __init__.py │ ├── dtypes │ │ ├── __init__.py │ │ └── cast │ │ │ ├── __init__.py │ │ │ ├── test_convert_objects.py │ │ │ ├── test_infer_datetimelike.py │ │ │ ├── test_construct_from_scalar.py │ │ │ ├── test_construct_ndarray.py │ │ │ └── test_construct_object_arr.py │ ├── frame │ │ └── __init__.py │ ├── generic │ │ └── __init__.py │ ├── groupby │ │ ├── __init__.py │ │ └── aggregate │ │ │ └── __init__.py │ ├── indexes │ │ ├── __init__.py │ │ ├── multi │ │ │ └── __init__.py │ │ ├── datetimes │ │ │ ├── __init__.py │ │ │ └── test_datetimelike.py │ │ ├── interval │ │ │ └── __init__.py │ │ ├── period │ │ │ ├── __init__.py │ │ │ └── test_scalar_compat.py │ │ └── timedeltas │ │ │ └── __init__.py │ ├── indexing │ │ ├── __init__.py │ │ ├── interval │ │ │ └── __init__.py │ │ ├── multiindex │ │ │ ├── __init__.py │ │ │ └── test_datetime.py │ │ ├── test_indexing_slow.py │ │ └── conftest.py │ ├── plotting │ │ └── __init__.py │ ├── resample │ │ └── __init__.py │ ├── reshape │ │ ├── __init__.py │ │ └── merge │ │ │ ├── __init__.py │ │ │ └── data │ │ │ └── quotes.csv │ ├── scalar │ │ ├── __init__.py │ │ ├── period │ │ │ └── __init__.py │ │ ├── interval │ │ │ └── __init__.py │ │ ├── timedelta │ │ │ └── __init__.py │ │ └── timestamp │ │ │ └── __init__.py │ ├── series │ │ ├── __init__.py │ │ ├── indexing │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── test_iloc.py │ │ ├── conftest.py │ │ ├── common.py │ │ └── test_validate.py │ ├── tools │ │ └── __init__.py │ ├── tseries │ │ ├── __init__.py │ │ ├── holiday │ │ │ └── __init__.py │ │ ├── offsets │ │ │ ├── __init__.py │ │ │ ├── data │ │ │ │ └── cday-0.14.1.pickle │ │ │ └── conftest.py │ │ └── frequencies │ │ │ └── __init__.py │ ├── tslibs │ │ ├── __init__.py │ │ ├── test_ccalendar.py │ │ └── test_timedeltas.py │ ├── util │ │ ├── __init__.py │ │ ├── conftest.py │ │ └── test_assert_produces_warning.py │ ├── window │ │ ├── __init__.py │ │ └── common.py │ ├── arithmetic │ │ └── __init__.py │ ├── computation │ │ └── __init__.py │ ├── extension │ │ ├── __init__.py │ │ ├── arrow │ │ │ ├── __init__.py │ │ │ └── test_string.py │ │ ├── json │ │ │ └── __init__.py │ │ ├── decimal │ │ │ └── __init__.py │ │ └── base │ │ │ ├── base.py │ │ │ ├── io.py │ │ │ └── casting.py │ ├── internals │ │ └── __init__.py │ ├── test_compat.py │ └── reductions │ │ └── __init__.py ├── tseries │ ├── __init__.py │ ├── plotting.py │ └── api.py ├── _libs │ ├── lib.pxd │ ├── tslibs │ │ ├── offsets.pxd │ │ ├── timedeltas.pxd │ │ ├── tzconversion.pxd │ │ ├── frequencies.pxd │ │ ├── timestamps.pxd │ │ ├── ccalendar.pxd │ │ ├── nattype.pxd │ │ ├── timezones.pxd │ │ ├── __init__.py │ │ └── c_timestamp.pxd │ ├── groupby.pxd │ ├── __init__.py │ ├── src │ │ ├── headers │ │ │ ├── stdint.h │ │ │ └── portable.h │ │ └── inline_helper.h │ ├── skiplist.pyx │ ├── missing.pxd │ ├── algos.pxd │ ├── skiplist.pxd │ └── indexing.pyx ├── api │ ├── __init__.py │ ├── types │ │ └── __init__.py │ └── extensions │ │ └── __init__.py ├── util │ ├── __init__.py │ ├── _exceptions.py │ └── _tester.py ├── testing.py ├── compat │ └── chainmap.py ├── arrays │ └── __init__.py ├── plotting │ └── _matplotlib │ │ └── compat.py └── _config │ ├── dates.py │ └── __init__.py ├── scripts ├── tests │ ├── __init__.py │ └── conftest.py ├── build_dist_for_release.sh └── build_dist.sh ├── asv_bench └── benchmarks │ ├── io │ ├── __init__.py │ ├── sas.py │ └── pickle.py │ ├── __init__.py │ ├── attrs_caching.py │ └── package.py ├── conda.recipe ├── bld.bat └── build.sh ├── web ├── pandas │ ├── static │ │ └── img │ │ │ ├── pandas.svg │ │ │ ├── pydata_book.gif │ │ │ └── install │ │ │ ├── anaconda_prompt.png │ │ │ ├── jupyterlab_home.png │ │ │ └── pandas_import_and_version.png │ ├── community │ │ └── blog.html │ ├── try.md │ ├── donate.md │ └── contribute.md └── README.md ├── .github ├── FUNDING.yml ├── SECURITY.md └── PULL_REQUEST_TEMPLATE.md ├── ci ├── travis_gbq.json.enc ├── travis_gbq_config.txt ├── incremental │ └── build.cmd ├── deps │ ├── travis-37.yaml │ ├── azure-36-32bit.yaml │ ├── azure-windows-36.yaml │ ├── travis-36-slow.yaml │ ├── azure-37-numpydev.yaml │ ├── azure-37-locale.yaml │ ├── azure-36-locale.yaml │ ├── azure-windows-37.yaml │ ├── azure-36-locale_slow.yaml │ ├── azure-35-compat.yaml │ ├── azure-macos-35.yaml │ └── travis-36-locale.yaml ├── travis_process_gbq_encryption.sh ├── submit_cython_cache.sh ├── check_cache.sh └── check_git_tags.sh ├── LICENSES ├── HAVEN_LICENSE └── MSGPACK_LICENSE ├── test.bat ├── .pep8speaks.yml ├── test_rebuild.sh ├── test_fast.bat ├── test.sh ├── codecov.yml ├── RELEASE.md ├── .gitattributes ├── test_fast.sh ├── .binstar.yml ├── .pre-commit-config.yaml ├── Makefile └── pyproject.toml /doc/source/_static/stub: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/io/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/core/util/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/api/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/io/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tseries/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scripts/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/core/dtypes/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/core/indexes/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/core/reshape/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/core/sparse/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/core/tools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/io/formats/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/arrays/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/config/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/dtypes/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/frame/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/generic/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/groupby/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/indexes/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/indexing/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/io/json/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/io/sas/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/plotting/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/resample/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/reshape/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/scalar/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/series/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/tools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/tseries/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/tslibs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/util/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/window/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /asv_bench/benchmarks/io/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/core/computation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/arithmetic/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/arrays/sparse/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/computation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/dtypes/cast/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/extension/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/indexes/multi/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/internals/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/io/msgpack/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/io/parser/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/io/pytables/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/reshape/merge/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/scalar/period/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/arrays/categorical/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/arrays/interval/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/arrays/string_/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/extension/arrow/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/groupby/aggregate/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/indexes/datetimes/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/indexes/interval/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/indexes/period/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/indexes/timedeltas/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/indexing/interval/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/scalar/interval/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/scalar/timedelta/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/scalar/timestamp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/series/indexing/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/tseries/holiday/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/tseries/offsets/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/indexing/multiindex/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/tests/tseries/frequencies/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pandas/io/msgpack/_version.py: -------------------------------------------------------------------------------- 1 | version = (0, 4, 6) 2 | -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/sub_char.csv: -------------------------------------------------------------------------------- 1 | a,"b",c 2 | 1,2,3 -------------------------------------------------------------------------------- /asv_bench/benchmarks/__init__.py: -------------------------------------------------------------------------------- 1 | """Pandas benchmarks.""" 2 | -------------------------------------------------------------------------------- /pandas/_libs/lib.pxd: -------------------------------------------------------------------------------- 1 | cdef bint c_is_list_like(object, bint) 2 | -------------------------------------------------------------------------------- /conda.recipe/bld.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | %PYTHON% setup.py install 3 | -------------------------------------------------------------------------------- /conda.recipe/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | $PYTHON setup.py install 3 | -------------------------------------------------------------------------------- /web/pandas/static/img/pandas.svg: -------------------------------------------------------------------------------- 1 | ../../../../doc/logo/pandas_logo.svg -------------------------------------------------------------------------------- /pandas/io/sas/__init__.py: -------------------------------------------------------------------------------- 1 | from .sasreader import read_sas # noqa 2 | -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/items.jsonl: -------------------------------------------------------------------------------- 1 | {"a": 1, "b": 2} 2 | {"b":2, "a" :1} 3 | -------------------------------------------------------------------------------- /pandas/tests/io/data/fixed_width_format.txt: -------------------------------------------------------------------------------- 1 | A B C 2 | 1 2 3 3 | 4 5 6 4 | -------------------------------------------------------------------------------- /doc/data/test.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/data/test.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test_mmap.csv: -------------------------------------------------------------------------------- 1 | a,b,c 2 | 1,one,I 3 | 2,two,II 4 | 5 | 3,three,III 6 | -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/test_mmap.csv: -------------------------------------------------------------------------------- 1 | a,b,c 2 | 1,one,I 3 | 2,two,II 4 | 3,three,III 5 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://pandas.pydata.org/donate.html 2 | tidelift: pypi/pandas 3 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | data/ 2 | timeseries.csv 3 | timeseries.parquet 4 | timeseries_wide.parquet 5 | -------------------------------------------------------------------------------- /doc/data/fx_prices: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/data/fx_prices -------------------------------------------------------------------------------- /pandas/_libs/tslibs/offsets.pxd: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | cdef to_offset(object obj) 4 | -------------------------------------------------------------------------------- /pandas/api/__init__.py: -------------------------------------------------------------------------------- 1 | """ public toolkit API """ 2 | from . import extensions, types # noqa 3 | -------------------------------------------------------------------------------- /ci/travis_gbq.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/ci/travis_gbq.json.enc -------------------------------------------------------------------------------- /doc/source/styled.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/styled.xlsx -------------------------------------------------------------------------------- /pandas/tests/test_compat.py: -------------------------------------------------------------------------------- 1 | """ 2 | Testing that functions from compat work as expected 3 | """ 4 | -------------------------------------------------------------------------------- /LICENSES/HAVEN_LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2013-2016 2 | COPYRIGHT HOLDER: Hadley Wickham; RStudio; and Evan Miller 3 | -------------------------------------------------------------------------------- /doc/logo/pandas_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/logo/pandas_logo.png -------------------------------------------------------------------------------- /pandas/core/computation/api.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | from pandas.core.computation.eval import eval 4 | -------------------------------------------------------------------------------- /test.bat: -------------------------------------------------------------------------------- 1 | :: test on windows 2 | 3 | pytest --skip-slow --skip-network pandas -n 2 -r sxX --strict %* 4 | -------------------------------------------------------------------------------- /doc/source/_static/ci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/ci.png -------------------------------------------------------------------------------- /pandas/tseries/plotting.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | from pandas.plotting._matplotlib.timeseries import tsplot 4 | -------------------------------------------------------------------------------- /ci/travis_gbq_config.txt: -------------------------------------------------------------------------------- 1 | TRAVIS_IV_ENV=encrypted_1d9d7b1f171b_iv 2 | TRAVIS_KEY_ENV=encrypted_1d9d7b1f171b_key 3 | -------------------------------------------------------------------------------- /doc/source/_static/eval-perf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/eval-perf.png -------------------------------------------------------------------------------- /doc/source/_static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/favicon.ico -------------------------------------------------------------------------------- /pandas/tests/io/data/blank.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/blank.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/blank.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/blank.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/blank.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/blank.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/blank.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/blank.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/stata15.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata15.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/test1.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test1.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/test1.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test1.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test1.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test1.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/test1.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test1.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/test2.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test2.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/test2.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test2.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test2.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test2.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/test2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test2.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/test3.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test3.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/test3.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test3.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test3.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test3.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/test3.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test3.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/test4.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test4.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/test4.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test4.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test4.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test4.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/test4.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test4.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/test5.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test5.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/test5.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test5.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test5.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test5.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/test5.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test5.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/umlauts.sav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/umlauts.sav -------------------------------------------------------------------------------- /doc/README.rst: -------------------------------------------------------------------------------- 1 | See `contributing.rst `_ in this repo. 2 | -------------------------------------------------------------------------------- /doc/source/_static/legacy_0.10.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/legacy_0.10.h5 -------------------------------------------------------------------------------- /doc/source/_static/query-perf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/query-perf.png -------------------------------------------------------------------------------- /doc/source/_static/style-excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/style-excel.png -------------------------------------------------------------------------------- /doc/source/_static/trunc_after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/trunc_after.png -------------------------------------------------------------------------------- /pandas/tests/io/data/S4_EDUC1.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/S4_EDUC1.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/testdtype.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testdtype.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/testdtype.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testdtype.xls -------------------------------------------------------------------------------- /pandas/tests/io/msgpack/common.py: -------------------------------------------------------------------------------- 1 | frombytes = lambda obj, data: obj.frombytes(data) 2 | tobytes = lambda obj: obj.tobytes() 3 | -------------------------------------------------------------------------------- /doc/cheatsheet/Pandas_Cheat_Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/cheatsheet/Pandas_Cheat_Sheet.pdf -------------------------------------------------------------------------------- /doc/source/_static/print_df_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/print_df_new.png -------------------------------------------------------------------------------- /doc/source/_static/print_df_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/print_df_old.png -------------------------------------------------------------------------------- /doc/source/_static/reshaping_melt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/reshaping_melt.png -------------------------------------------------------------------------------- /doc/source/_static/trunc_before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/trunc_before.png -------------------------------------------------------------------------------- /pandas/tests/io/data/labelled-num.sav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/labelled-num.sav -------------------------------------------------------------------------------- /pandas/tests/io/data/labelled-str.sav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/labelled-str.sav -------------------------------------------------------------------------------- /pandas/tests/io/data/stata10_115.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata10_115.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata10_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata10_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata11_115.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata11_115.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata11_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata11_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata12_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata12_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata14_118.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata14_118.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata16_118.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata16_118.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata1_114.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata1_114.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata1_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata1_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata2_113.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata2_113.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata2_114.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata2_114.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata2_115.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata2_115.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata2_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata2_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata3_113.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata3_113.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata3_114.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata3_114.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata3_115.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata3_115.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata3_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata3_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata4_113.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata4_113.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata4_114.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata4_114.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata4_115.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata4_115.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata4_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata4_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata5_113.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata5_113.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata5_114.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata5_114.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata5_115.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata5_115.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata5_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata5_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata6_113.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata6_113.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata6_114.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata6_114.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata6_115.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata6_115.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata6_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata6_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata7_111.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata7_111.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata7_115.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata7_115.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata7_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata7_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata8_113.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata8_113.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata8_115.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata8_115.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata8_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata8_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata9_115.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata9_115.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata9_117.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata9_117.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/test_squeeze.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_squeeze.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/test_squeeze.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_squeeze.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test_types.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_types.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/test_types.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_types.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test_types.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_types.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/test_types.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_types.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/testdtype.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testdtype.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/testdtype.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testdtype.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/testskiprows.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testskiprows.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/testskiprows.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testskiprows.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/times_1900.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/times_1900.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/times_1900.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/times_1900.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/times_1900.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/times_1900.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/times_1900.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/times_1900.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/times_1904.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/times_1904.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/times_1904.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/times_1904.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/times_1904.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/times_1904.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/times_1904.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/times_1904.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/writertable.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/writertable.odt -------------------------------------------------------------------------------- /pandas/tests/io/msgpack/data/frame.mp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/msgpack/data/frame.mp -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/DEMO_G.xpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/DEMO_G.xpt -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/DRXFCD_G.xpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/DRXFCD_G.xpt -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/SSHSV1_A.xpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/SSHSV1_A.xpt -------------------------------------------------------------------------------- /web/pandas/static/img/pydata_book.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/web/pandas/static/img/pydata_book.gif -------------------------------------------------------------------------------- /doc/cheatsheet/Pandas_Cheat_Sheet.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/cheatsheet/Pandas_Cheat_Sheet.pptx -------------------------------------------------------------------------------- /doc/source/_static/eval-perf-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/eval-perf-small.png -------------------------------------------------------------------------------- /doc/source/_static/new-excel-index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/new-excel-index.png -------------------------------------------------------------------------------- /doc/source/_static/old-excel-index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/old-excel-index.png -------------------------------------------------------------------------------- /doc/source/_static/option_unicode01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/option_unicode01.png -------------------------------------------------------------------------------- /doc/source/_static/option_unicode02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/option_unicode02.png -------------------------------------------------------------------------------- /doc/source/_static/option_unicode03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/option_unicode03.png -------------------------------------------------------------------------------- /doc/source/_static/option_unicode04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/option_unicode04.png -------------------------------------------------------------------------------- /doc/source/_static/query-perf-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/query-perf-small.png -------------------------------------------------------------------------------- /doc/source/_static/reshaping_pivot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/reshaping_pivot.png -------------------------------------------------------------------------------- /doc/source/_static/reshaping_stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/reshaping_stack.png -------------------------------------------------------------------------------- /doc/source/_static/whatsnew_assign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/whatsnew_assign.png -------------------------------------------------------------------------------- /pandas/tests/io/data/stata13_dates.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata13_dates.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/stata1_119.dta.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata1_119.dta.gz -------------------------------------------------------------------------------- /pandas/tests/io/data/test_squeeze.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_squeeze.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/test_squeeze.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_squeeze.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/testmultiindex.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testmultiindex.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/testmultiindex.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testmultiindex.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/testskiprows.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testskiprows.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/testskiprows.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testskiprows.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/tips.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/tips.csv.gz -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/cars.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/cars.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test1.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test1.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test2.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test2.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test3.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test3.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test4.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test4.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test5.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test5.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test6.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test6.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test7.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test7.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test8.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test8.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test9.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test9.sas7bdat -------------------------------------------------------------------------------- /.pep8speaks.yml: -------------------------------------------------------------------------------- 1 | # File : .pep8speaks.yml 2 | 3 | scanner: 4 | diff_only: True # If True, errors caused by only the patch are shown 5 | -------------------------------------------------------------------------------- /doc/cheatsheet/Pandas_Cheat_Sheet_JA.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/cheatsheet/Pandas_Cheat_Sheet_JA.pdf -------------------------------------------------------------------------------- /doc/cheatsheet/Pandas_Cheat_Sheet_JA.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/cheatsheet/Pandas_Cheat_Sheet_JA.pptx -------------------------------------------------------------------------------- /doc/source/_static/df_repr_truncated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/df_repr_truncated.png -------------------------------------------------------------------------------- /doc/source/_static/reshaping_unstack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/reshaping_unstack.png -------------------------------------------------------------------------------- /doc/source/_static/reshaping_unstack_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/reshaping_unstack_0.png -------------------------------------------------------------------------------- /doc/source/_static/reshaping_unstack_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/reshaping_unstack_1.png -------------------------------------------------------------------------------- /pandas/core/sparse/api.py: -------------------------------------------------------------------------------- 1 | from pandas.core.arrays.sparse import SparseArray, SparseDtype 2 | 3 | __all__ = ["SparseArray", "SparseDtype"] 4 | -------------------------------------------------------------------------------- /pandas/tests/io/data/blank_with_header.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/blank_with_header.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/blank_with_header.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/blank_with_header.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/feather-0_3_1.feather: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/feather-0_3_1.feather -------------------------------------------------------------------------------- /pandas/tests/io/data/labelled-num-na.sav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/labelled-num-na.sav -------------------------------------------------------------------------------- /pandas/tests/io/data/legacy_hdf/gh26443.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/legacy_hdf/gh26443.h5 -------------------------------------------------------------------------------- /pandas/tests/io/data/stata1_encoding.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata1_encoding.dta -------------------------------------------------------------------------------- /pandas/tests/io/data/test_converters.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_converters.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/test_converters.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_converters.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test_converters.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_converters.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/test_converters.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_converters.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/test_multisheet.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_multisheet.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/test_multisheet.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_multisheet.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test_multisheet.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_multisheet.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/test_multisheet.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_multisheet.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/testdateoverflow.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testdateoverflow.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/testdateoverflow.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testdateoverflow.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/testdateoverflow.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testdateoverflow.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/testdateoverflow.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testdateoverflow.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/testmultiindex.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testmultiindex.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/testmultiindex.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/testmultiindex.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/tar_csv.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/tar_csv.tar.gz -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/test1.csv.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/test1.csv.bz2 -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/test1.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/test1.csv.gz -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/tips.csv.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/tips.csv.bz2 -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/utf16_ex.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/utf16_ex.txt -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/airline.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/airline.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/datetime.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/datetime.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/load_log.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/load_log.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test10.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test10.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test11.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test11.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test12.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test12.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test13.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test13.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test14.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test14.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test15.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test15.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test16.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test16.sas7bdat -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | To report a security vulnerability to pandas, please go to https://tidelift.com/security and see the instructions there. 2 | -------------------------------------------------------------------------------- /pandas/tests/io/data/blank_with_header.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/blank_with_header.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/blank_with_header.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/blank_with_header.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/data/invalid_value_type.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/invalid_value_type.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/stata1_encoding_118.dta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/stata1_encoding_118.dta -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/salaries.csv.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/salaries.csv.bz2 -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/salaries.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/salaries.csv.gz -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/salaries.csv.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/salaries.csv.xz -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/salaries.csv.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/salaries.csv.zip -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/paxraw_d_short.xpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/paxraw_d_short.xpt -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/test_12659.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/test_12659.sas7bdat -------------------------------------------------------------------------------- /doc/source/_static/whatsnew_plot_submethods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/doc/source/_static/whatsnew_plot_submethods.png -------------------------------------------------------------------------------- /pandas/tests/extension/json/__init__.py: -------------------------------------------------------------------------------- 1 | from .array import JSONArray, JSONDtype, make_data 2 | 3 | __all__ = ["JSONArray", "JSONDtype", "make_data"] 4 | -------------------------------------------------------------------------------- /pandas/tests/io/data/categorical.0.25.0.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/categorical.0.25.0.pickle -------------------------------------------------------------------------------- /pandas/tests/io/data/test_index_name_pre17.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_index_name_pre17.ods -------------------------------------------------------------------------------- /pandas/tests/io/data/test_index_name_pre17.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_index_name_pre17.xls -------------------------------------------------------------------------------- /pandas/tests/io/data/test_index_name_pre17.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_index_name_pre17.xlsm -------------------------------------------------------------------------------- /pandas/tests/io/data/test_index_name_pre17.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/test_index_name_pre17.xlsx -------------------------------------------------------------------------------- /pandas/tests/io/json/data/tsframe_v012.json.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/json/data/tsframe_v012.json.zip -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/unicode_series.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/unicode_series.csv -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/utf16_ex_small.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/utf16_ex_small.zip -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/many_columns.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/many_columns.sas7bdat -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/productsales.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/productsales.sas7bdat -------------------------------------------------------------------------------- /test_rebuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | python setup.py clean 4 | python setup.py build_ext --inplace 5 | coverage erase 6 | pytest pandas --cov=pandas 7 | -------------------------------------------------------------------------------- /pandas/tests/io/data/sparseframe-0.20.3.pickle.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/sparseframe-0.20.3.pickle.gz -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/sauron.SHIFT_JIS.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/parser/data/sauron.SHIFT_JIS.csv -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/zero_variables.sas7bdat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/sas/data/zero_variables.sas7bdat -------------------------------------------------------------------------------- /web/pandas/static/img/install/anaconda_prompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/web/pandas/static/img/install/anaconda_prompt.png -------------------------------------------------------------------------------- /web/pandas/static/img/install/jupyterlab_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/web/pandas/static/img/install/jupyterlab_home.png -------------------------------------------------------------------------------- /pandas/tests/io/data/html_encoding/letz_latin1.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/html_encoding/letz_latin1.html -------------------------------------------------------------------------------- /pandas/tests/io/data/legacy_hdf/datetimetz_object.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/legacy_hdf/datetimetz_object.h5 -------------------------------------------------------------------------------- /pandas/tests/io/data/legacy_hdf/legacy_table_py2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/legacy_hdf/legacy_table_py2.h5 -------------------------------------------------------------------------------- /pandas/tests/io/data/legacy_hdf/pytables_native.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/legacy_hdf/pytables_native.h5 -------------------------------------------------------------------------------- /pandas/tests/io/data/legacy_hdf/pytables_native2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/legacy_hdf/pytables_native2.h5 -------------------------------------------------------------------------------- /pandas/tests/io/data/sparseseries-0.20.3.pickle.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/sparseseries-0.20.3.pickle.gz -------------------------------------------------------------------------------- /pandas/tests/tseries/offsets/data/cday-0.14.1.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/tseries/offsets/data/cday-0.14.1.pickle -------------------------------------------------------------------------------- /test_fast.bat: -------------------------------------------------------------------------------- 1 | :: test on windows 2 | set PYTHONHASHSEED=314159265 3 | pytest --skip-slow --skip-network --skip-db -m "not single" -n 4 -r sXX --strict pandas 4 | -------------------------------------------------------------------------------- /pandas/tests/io/data/html_encoding/chinese_utf-16.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/html_encoding/chinese_utf-16.html -------------------------------------------------------------------------------- /pandas/tests/io/data/html_encoding/chinese_utf-32.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/html_encoding/chinese_utf-32.html -------------------------------------------------------------------------------- /pandas/tests/io/data/legacy_hdf/legacy_table_fixed_py2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/legacy_hdf/legacy_table_fixed_py2.h5 -------------------------------------------------------------------------------- /doc/_templates/autosummary/class_without_autosummary.rst: -------------------------------------------------------------------------------- 1 | {{ fullname }} 2 | {{ underline }} 3 | 4 | .. currentmodule:: {{ module }} 5 | 6 | .. autoclass:: {{ objname }} 7 | -------------------------------------------------------------------------------- /doc/source/themes/nature_with_gtoc/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = nature.css 4 | pygments_style = tango 5 | 6 | [options] 7 | sidebarwidth = 270 8 | -------------------------------------------------------------------------------- /pandas/tests/reductions/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Tests for reductions where we want to test for matching behavior across 3 | Array, Index, Series, and DataFrame methods. 4 | """ 5 | -------------------------------------------------------------------------------- /web/pandas/static/img/install/pandas_import_and_version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/web/pandas/static/img/install/pandas_import_and_version.png -------------------------------------------------------------------------------- /doc/source/user_guide/templates/myhtml.tpl: -------------------------------------------------------------------------------- 1 | {% extends "html.tpl" %} 2 | {% block table %} 3 |

{{ table_title|default("My Table") }}

4 | {{ super() }} 5 | {% endblock table %} 6 | -------------------------------------------------------------------------------- /pandas/tseries/api.py: -------------------------------------------------------------------------------- 1 | """ 2 | Timeseries API 3 | """ 4 | 5 | # flake8: noqa 6 | 7 | from pandas.tseries.frequencies import infer_freq 8 | import pandas.tseries.offsets as offsets 9 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | command -v coverage >/dev/null && coverage erase 3 | command -v python-coverage >/dev/null && python-coverage erase 4 | pytest pandas --cov=pandas -r sxX --strict 5 | -------------------------------------------------------------------------------- /pandas/tests/extension/decimal/__init__.py: -------------------------------------------------------------------------------- 1 | from .array import DecimalArray, DecimalDtype, make_data, to_decimal 2 | 3 | __all__ = ["DecimalArray", "DecimalDtype", "to_decimal", "make_data"] 4 | -------------------------------------------------------------------------------- /pandas/util/__init__.py: -------------------------------------------------------------------------------- 1 | from pandas.util._decorators import Appender, Substitution, cache_readonly # noqa 2 | 3 | from pandas.core.util.hashing import hash_array, hash_pandas_object # noqa 4 | -------------------------------------------------------------------------------- /pandas/tests/io/data/legacy_hdf/periodindex_0.20.1_x86_64_darwin_2.7.13.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/legacy_hdf/periodindex_0.20.1_x86_64_darwin_2.7.13.h5 -------------------------------------------------------------------------------- /pandas/tests/series/indexing/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from pandas.tests.series.common import TestData 4 | 5 | 6 | @pytest.fixture(scope="module") 7 | def test_data(): 8 | return TestData() 9 | -------------------------------------------------------------------------------- /pandas/_libs/groupby.pxd: -------------------------------------------------------------------------------- 1 | cdef enum InterpolationEnumType: 2 | INTERPOLATION_LINEAR, 3 | INTERPOLATION_LOWER, 4 | INTERPOLATION_HIGHER, 5 | INTERPOLATION_NEAREST, 6 | INTERPOLATION_MIDPOINT 7 | -------------------------------------------------------------------------------- /pandas/tests/io/data/legacy_msgpack/0.20.3/0.20.3_x86_64_darwin_3.5.2.msgpack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/legacy_msgpack/0.20.3/0.20.3_x86_64_darwin_3.5.2.msgpack -------------------------------------------------------------------------------- /pandas/tests/io/data/legacy_pickle/0.20.3/0.20.3_x86_64_darwin_3.5.2.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/legacy_pickle/0.20.3/0.20.3_x86_64_darwin_3.5.2.pickle -------------------------------------------------------------------------------- /pandas/tests/io/data/legacy_pickle/0.20.3/0.20.3_x86_64_darwin_3.5.6.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/batterseapower/pandas/master/pandas/tests/io/data/legacy_pickle/0.20.3/0.20.3_x86_64_darwin_3.5.6.pickle -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | - [ ] closes #xxxx 2 | - [ ] tests added / passed 3 | - [ ] passes `black pandas` 4 | - [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` 5 | - [ ] whatsnew entry 6 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/accessor.rst: -------------------------------------------------------------------------------- 1 | {{ fullname }} 2 | {{ underline }} 3 | 4 | .. currentmodule:: {{ module.split('.')[0] }} 5 | 6 | .. autoaccessor:: {{ (module.split('.')[1:] + [objname]) | join('.') }} 7 | -------------------------------------------------------------------------------- /scripts/tests/conftest.py: -------------------------------------------------------------------------------- 1 | def pytest_addoption(parser): 2 | parser.addoption( 3 | "--strict-data-files", 4 | action="store_true", 5 | help="Unused. For compat with setup.cfg.", 6 | ) 7 | -------------------------------------------------------------------------------- /pandas/_libs/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | from .tslibs import ( 4 | NaT, 5 | NaTType, 6 | OutOfBoundsDatetime, 7 | Period, 8 | Timedelta, 9 | Timestamp, 10 | iNaT, 11 | ) 12 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/accessor_method.rst: -------------------------------------------------------------------------------- 1 | {{ fullname }} 2 | {{ underline }} 3 | 4 | .. currentmodule:: {{ module.split('.')[0] }} 5 | 6 | .. autoaccessormethod:: {{ (module.split('.')[1:] + [objname]) | join('.') }} 7 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/accessor_attribute.rst: -------------------------------------------------------------------------------- 1 | {{ fullname }} 2 | {{ underline }} 3 | 4 | .. currentmodule:: {{ module.split('.')[0] }} 5 | 6 | .. autoaccessorattribute:: {{ (module.split('.')[1:] + [objname]) | join('.') }} 7 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | branch: master 3 | 4 | comment: off 5 | 6 | coverage: 7 | status: 8 | project: 9 | default: 10 | target: '82' 11 | patch: 12 | default: 13 | target: '50' 14 | -------------------------------------------------------------------------------- /pandas/core/arrays/sparse/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa: F401 2 | 3 | from .accessor import SparseAccessor, SparseFrameAccessor 4 | from .array import BlockIndex, IntIndex, SparseArray, _make_index 5 | from .dtype import SparseDtype 6 | -------------------------------------------------------------------------------- /pandas/tests/arrays/categorical/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.fixture(params=[True, False]) 5 | def allow_fill(request): 6 | """Boolean 'allow_fill' parameter for Categorical.take""" 7 | return request.param 8 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/accessor_callable.rst: -------------------------------------------------------------------------------- 1 | {{ fullname }} 2 | {{ underline }} 3 | 4 | .. currentmodule:: {{ module.split('.')[0] }} 5 | 6 | .. autoaccessorcallable:: {{ (module.split('.')[1:] + [objname]) | join('.') }}.__call__ 7 | -------------------------------------------------------------------------------- /pandas/testing.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | """ 4 | Public testing utility functions. 5 | """ 6 | 7 | from pandas.util.testing import ( 8 | assert_frame_equal, 9 | assert_index_equal, 10 | assert_series_equal, 11 | ) 12 | -------------------------------------------------------------------------------- /pandas/_libs/src/headers/stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _PANDAS_STDINT_H_ 2 | #define _PANDAS_STDINT_H_ 3 | 4 | #if defined(_MSC_VER) && (_MSC_VER < 1900) 5 | #include "ms_stdint.h" 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /pandas/core/window/__init__.py: -------------------------------------------------------------------------------- 1 | from pandas.core.window.ewm import EWM # noqa:F401 2 | from pandas.core.window.expanding import Expanding, ExpandingGroupby # noqa:F401 3 | from pandas.core.window.rolling import Rolling, RollingGroupby, Window # noqa:F401 4 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/with_classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | Release Notes 2 | ============= 3 | 4 | The list of changes to Pandas between each release can be found 5 | [here](http://pandas.pydata.org/pandas-docs/stable/whatsnew.html). For full 6 | details, see the commit logs at http://github.com/pandas-dev/pandas. 7 | -------------------------------------------------------------------------------- /pandas/tests/io/excel/__init__.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | pytestmark = pytest.mark.filterwarnings( 4 | # Looks like tree.getiterator is deprecated in favor of tree.iter 5 | "ignore:This method will be removed in future versions:PendingDeprecationWarning" 6 | ) 7 | -------------------------------------------------------------------------------- /pandas/tests/arrays/categorical/common.py: -------------------------------------------------------------------------------- 1 | from pandas import Categorical 2 | 3 | 4 | class TestCategorical: 5 | def setup_method(self, method): 6 | self.factor = Categorical( 7 | ["a", "b", "b", "a", "a", "c", "c", "c"], ordered=True 8 | ) 9 | -------------------------------------------------------------------------------- /pandas/tests/io/json/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.fixture(params=["split", "records", "index", "columns", "values"]) 5 | def orient(request): 6 | """ 7 | Fixture for orients excluding the table format. 8 | """ 9 | return request.param 10 | -------------------------------------------------------------------------------- /pandas/_libs/skiplist.pyx: -------------------------------------------------------------------------------- 1 | # Cython version of IndexableSkiplist, for implementing moving median 2 | # with O(log n) updates 3 | # Original author: Raymond Hettinger 4 | # Original license: MIT 5 | # Link: http://code.activestate.com/recipes/576930/ 6 | 7 | # Cython version: Wes McKinney 8 | -------------------------------------------------------------------------------- /pandas/core/groupby/__init__.py: -------------------------------------------------------------------------------- 1 | from pandas.core.groupby.generic import ( # noqa: F401 2 | DataFrameGroupBy, 3 | NamedAgg, 4 | SeriesGroupBy, 5 | ) 6 | from pandas.core.groupby.groupby import GroupBy # noqa: F401 7 | from pandas.core.groupby.grouper import Grouper # noqa: F401 8 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_none_columns_none.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
00
00
13 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/gh14998_expected_output.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
A
1
13 | -------------------------------------------------------------------------------- /doc/source/reference/panel.rst: -------------------------------------------------------------------------------- 1 | {{ header }} 2 | 3 | .. _api.panel: 4 | 5 | ===== 6 | Panel 7 | ===== 8 | .. currentmodule:: pandas 9 | 10 | `Panel` was removed in 0.25.0. For prior documentation, see the `0.24 documentation `_ 11 | -------------------------------------------------------------------------------- /ci/incremental/build.cmd: -------------------------------------------------------------------------------- 1 | @rem https://github.com/numba/numba/blob/master/buildscripts/incremental/build.cmd 2 | 3 | @rem Build extensions 4 | python setup.py build_ext -q -i 5 | 6 | @rem Install pandas 7 | python -m pip install --no-build-isolation -e . 8 | 9 | if %errorlevel% neq 0 exit /b %errorlevel% 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | # enforce text on certain files 3 | *.py text 4 | *.pyx text 5 | *.pyd text 6 | *.c text 7 | *.h text 8 | *.html text 9 | *.csv text 10 | *.json text 11 | *.pickle binary 12 | *.h5 binary 13 | *.dta binary 14 | *.xls binary 15 | *.xlsx binary 16 | pandas/_version.py export-subst 17 | -------------------------------------------------------------------------------- /pandas/_libs/tslibs/timedeltas.pxd: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from numpy cimport int64_t 4 | 5 | # Exposed for tslib, not intended for outside use. 6 | cdef int64_t cast_from_unit(object ts, object unit) except? -1 7 | cpdef int64_t delta_to_nanoseconds(delta) except? -1 8 | cdef convert_to_timedelta64(object ts, object unit) 9 | -------------------------------------------------------------------------------- /pandas/io/clipboard/exceptions.py: -------------------------------------------------------------------------------- 1 | import ctypes 2 | 3 | 4 | class PyperclipException(RuntimeError): 5 | pass 6 | 7 | 8 | class PyperclipWindowsException(PyperclipException): 9 | def __init__(self, message): 10 | message += " ({err})".format(err=ctypes.WinError()) 11 | super().__init__(message) 12 | -------------------------------------------------------------------------------- /pandas/_libs/tslibs/tzconversion.pxd: -------------------------------------------------------------------------------- 1 | from cpython.datetime cimport tzinfo 2 | from numpy cimport int64_t 3 | 4 | 5 | cdef int64_t tz_convert_utc_to_tzlocal(int64_t utc_val, tzinfo tz) 6 | cdef int64_t _tz_convert_tzlocal_utc(int64_t val, tzinfo tz, bint to_utc=*) 7 | cpdef int64_t tz_convert_single(int64_t val, object tz1, object tz2) 8 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/unicode_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
A
0σ
15 | -------------------------------------------------------------------------------- /scripts/build_dist_for_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # this requires cython to be installed 4 | 5 | # this builds the release cleanly & is building on the current checkout 6 | rm -rf dist 7 | git clean -xfd 8 | python setup.py clean --quiet 9 | python setup.py cython --quiet 10 | python setup.py sdist --formats=gztar --quiet 11 | -------------------------------------------------------------------------------- /pandas/_libs/tslibs/frequencies.pxd: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | cpdef object get_rule_month(object source, object default=*) 4 | 5 | cpdef get_freq_code(freqstr) 6 | cpdef object get_freq(object freq) 7 | cpdef str get_base_alias(freqstr) 8 | cpdef int get_to_timestamp_base(int base) 9 | cpdef str get_freq_str(base, mult=*) 10 | -------------------------------------------------------------------------------- /pandas/_libs/missing.pxd: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from numpy cimport ndarray, uint8_t 4 | 5 | cpdef bint checknull(object val) 6 | cpdef bint checknull_old(object val) 7 | cpdef ndarray[uint8_t] isnaobj(ndarray arr) 8 | 9 | cdef bint is_null_datetime64(v) 10 | cdef bint is_null_timedelta64(v) 11 | cdef bint is_null_period(v) 12 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/gh21625_expected_output.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
x
00.200
-------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/gh22270_expected_output.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
x
0100
-------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_unnamed_standard_columns_none.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
000
100
15 | -------------------------------------------------------------------------------- /pandas/_libs/tslibs/timestamps.pxd: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from numpy cimport int64_t 4 | from pandas._libs.tslibs.np_datetime cimport npy_datetimestruct 5 | 6 | cdef object create_timestamp_from_ts(int64_t value, 7 | npy_datetimestruct dts, 8 | object tz, object freq) 9 | -------------------------------------------------------------------------------- /doc/data/mindex_ex.csv: -------------------------------------------------------------------------------- 1 | year,indiv,zit,xit 2 | 1977,"A",1.2,.6 3 | 1977,"B",1.5,.5 4 | 1977,"C",1.7,.8 5 | 1978,"A",.2,.06 6 | 1978,"B",.7,.2 7 | 1978,"C",.8,.3 8 | 1978,"D",.9,.5 9 | 1978,"E",1.4,.9 10 | 1979,"C",.2,.15 11 | 1979,"D",.14,.05 12 | 1979,"E",.5,.15 13 | 1979,"F",1.2,.5 14 | 1979,"G",3.4,1.9 15 | 1979,"H",5.4,2.7 16 | 1979,"I",6.4,1.2 17 | -------------------------------------------------------------------------------- /doc/source/getting_started/comparison/index.rst: -------------------------------------------------------------------------------- 1 | {{ header }} 2 | 3 | .. _comparison: 4 | 5 | =========================== 6 | Comparison with other tools 7 | =========================== 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | 12 | comparison_with_r 13 | comparison_with_sql 14 | comparison_with_sas 15 | comparison_with_stata 16 | -------------------------------------------------------------------------------- /pandas/io/json/__init__.py: -------------------------------------------------------------------------------- 1 | from pandas.io.json._json import dumps, loads, read_json, to_json 2 | from pandas.io.json._normalize import json_normalize 3 | from pandas.io.json._table_schema import build_table_schema 4 | 5 | __all__ = [ 6 | "dumps", 7 | "loads", 8 | "read_json", 9 | "to_json", 10 | "json_normalize", 11 | "build_table_schema", 12 | ] 13 | -------------------------------------------------------------------------------- /pandas/tests/extension/base/base.py: -------------------------------------------------------------------------------- 1 | import pandas.util.testing as tm 2 | 3 | 4 | class BaseExtensionTests: 5 | 6 | assert_equal = staticmethod(tm.assert_equal) 7 | assert_series_equal = staticmethod(tm.assert_series_equal) 8 | assert_frame_equal = staticmethod(tm.assert_frame_equal) 9 | assert_extension_array_equal = staticmethod(tm.assert_extension_array_equal) 10 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_unnamed_multi_columns_none.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
ab00
c00
16 | -------------------------------------------------------------------------------- /test_fast.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Workaround for pytest-xdist flaky collection order 4 | # https://github.com/pytest-dev/pytest/issues/920 5 | # https://github.com/pytest-dev/pytest/issues/1075 6 | export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))') 7 | 8 | pytest pandas --skip-slow --skip-network --skip-db -m "not single" -n 4 -r sxX --strict "$@" 9 | -------------------------------------------------------------------------------- /doc/_templates/api_redirect.html: -------------------------------------------------------------------------------- 1 | {% set redirect = redirects[pagename.split("/")[-1]] %} 2 | 3 | 4 | 5 | This API page has moved 6 | 7 | 8 |

This API page has moved here.

9 | 10 | 11 | -------------------------------------------------------------------------------- /pandas/tests/dtypes/cast/test_convert_objects.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | from pandas.core.dtypes.cast import maybe_convert_objects 5 | 6 | 7 | @pytest.mark.parametrize("data", [[1, 2], ["apply", "banana"]]) 8 | def test_maybe_convert_objects_copy(data): 9 | arr = np.array(data) 10 | out = maybe_convert_objects(arr) 11 | 12 | assert arr is not out 13 | -------------------------------------------------------------------------------- /pandas/tests/extension/arrow/test_string.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import pandas as pd 4 | 5 | pytest.importorskip("pyarrow", minversion="0.10.0") 6 | 7 | from .arrays import ArrowStringDtype # isort:skip 8 | 9 | 10 | def test_constructor_from_list(): 11 | # GH 27673 12 | result = pd.Series(["E"], dtype=ArrowStringDtype()) 13 | assert isinstance(result.dtype, ArrowStringDtype) 14 | -------------------------------------------------------------------------------- /doc/source/development/index.rst: -------------------------------------------------------------------------------- 1 | {{ header }} 2 | 3 | .. _development: 4 | 5 | =========== 6 | Development 7 | =========== 8 | 9 | .. If you update this toctree, also update the manual toctree in the 10 | main index.rst.template 11 | 12 | .. toctree:: 13 | :maxdepth: 2 14 | 15 | contributing 16 | internals 17 | extending 18 | developer 19 | policies 20 | roadmap 21 | -------------------------------------------------------------------------------- /pandas/core/computation/check.py: -------------------------------------------------------------------------------- 1 | from pandas.compat._optional import import_optional_dependency 2 | 3 | ne = import_optional_dependency("numexpr", raise_on_missing=False, on_version="warn") 4 | _NUMEXPR_INSTALLED = ne is not None 5 | if _NUMEXPR_INSTALLED: 6 | _NUMEXPR_VERSION = ne.__version__ 7 | else: 8 | _NUMEXPR_VERSION = None 9 | 10 | __all__ = ["_NUMEXPR_INSTALLED", "_NUMEXPR_VERSION"] 11 | -------------------------------------------------------------------------------- /pandas/tests/io/sas/data/datetime.csv: -------------------------------------------------------------------------------- 1 | Date1,Date2,DateTime,DateTimeHi,Taiw 2 | 1677-09-22,1677-09-22,1677-09-21 00:12:44,1677-09-21 00:12:43.145226,1912-01-01 3 | 1960-01-01,1960-01-01,1960-01-01 00:00:00,1960-01-01 00:00:00.000000,1960-01-01 4 | 2016-02-29,2016-02-29,2016-02-29 23:59:59,2016-02-29 23:59:59.123456,2016-02-29 5 | 2262-04-11,2262-04-11,2262-04-11 23:47:16,2262-04-11 23:47:16.854774,2262-04-11 6 | -------------------------------------------------------------------------------- /pandas/core/reshape/api.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | from pandas.core.reshape.concat import concat 4 | from pandas.core.reshape.melt import lreshape, melt, wide_to_long 5 | from pandas.core.reshape.merge import merge, merge_asof, merge_ordered 6 | from pandas.core.reshape.pivot import crosstab, pivot, pivot_table 7 | from pandas.core.reshape.reshape import get_dummies 8 | from pandas.core.reshape.tile import cut, qcut 9 | -------------------------------------------------------------------------------- /doc/source/whatsnew/v0.23.3.rst: -------------------------------------------------------------------------------- 1 | .. _whatsnew_0233: 2 | 3 | What's new in 0.23.3 (July 7, 2018) 4 | ----------------------------------- 5 | 6 | {{ header }} 7 | 8 | This release fixes a build issue with the sdist for Python 3.7 (:issue:`21785`) 9 | There are no other changes. 10 | 11 | .. _whatsnew_0.23.3.contributors: 12 | 13 | Contributors 14 | ~~~~~~~~~~~~ 15 | 16 | .. contributors:: v0.23.2..v0.23.3 17 | -------------------------------------------------------------------------------- /pandas/api/types/__init__.py: -------------------------------------------------------------------------------- 1 | """ public toolkit API """ 2 | 3 | from pandas._libs.lib import infer_dtype # noqa: F401 4 | 5 | from pandas.core.dtypes.api import * # noqa: F403, F401 6 | from pandas.core.dtypes.concat import union_categoricals # noqa: F401 7 | from pandas.core.dtypes.dtypes import ( # noqa: F401 8 | CategoricalDtype, 9 | DatetimeTZDtype, 10 | IntervalDtype, 11 | PeriodDtype, 12 | ) 13 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/datetime64_hourformatter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
hod
010:10
112:12
19 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_none_columns_unnamed_standard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
01
00
00
19 | -------------------------------------------------------------------------------- /doc/source/getting_started/index.rst: -------------------------------------------------------------------------------- 1 | {{ header }} 2 | 3 | .. _getting_started: 4 | 5 | =============== 6 | Getting started 7 | =============== 8 | 9 | .. If you update this toctree, also update the manual toctree in the 10 | main index.rst.template 11 | 12 | .. toctree:: 13 | :maxdepth: 2 14 | 15 | install 16 | overview 17 | 10min 18 | basics 19 | dsintro 20 | comparison/index 21 | tutorials 22 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/datetime64_monthformatter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
months
02016-01
12016-02
19 | -------------------------------------------------------------------------------- /pandas/tests/io/pytables/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import pandas.util.testing as tm 4 | 5 | 6 | @pytest.fixture 7 | def setup_path(): 8 | """Fixture for setup path""" 9 | return "tmp.__{}__.h5".format(tm.rands(10)) 10 | 11 | 12 | @pytest.fixture(scope="module", autouse=True) 13 | def setup_mode(): 14 | """ Reset testing mode fixture""" 15 | tm.reset_testing_mode() 16 | yield 17 | tm.set_testing_mode() 18 | -------------------------------------------------------------------------------- /pandas/tests/io/pytables/test_pytables_missing.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import pandas.util._test_decorators as td 4 | 5 | import pandas as pd 6 | import pandas.util.testing as tm 7 | 8 | 9 | @td.skip_if_installed("tables") 10 | def test_pytables_raises(): 11 | df = pd.DataFrame({"A": [1, 2]}) 12 | with pytest.raises(ImportError, match="tables"): 13 | with tm.ensure_clean("foo.h5") as path: 14 | df.to_hdf(path, "df") 15 | -------------------------------------------------------------------------------- /doc/cheatsheet/README.txt: -------------------------------------------------------------------------------- 1 | The Pandas Cheat Sheet was created using Microsoft Powerpoint 2013. 2 | To create the PDF version, within Powerpoint, simply do a "Save As" 3 | and pick "PDF" as the format. 4 | 5 | This cheat sheet was inspired by the RStudio Data Wrangling Cheatsheet[1], written by Irv Lustig, Princeton Consultants[2]. 6 | 7 | [1]: https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-cheatsheet.pdf 8 | [2]: http://www.princetonoptimization.com/ 9 | -------------------------------------------------------------------------------- /pandas/_libs/tslibs/ccalendar.pxd: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from cython cimport Py_ssize_t 4 | 5 | from numpy cimport int64_t, int32_t 6 | 7 | 8 | cdef int dayofweek(int y, int m, int d) nogil 9 | cdef bint is_leapyear(int64_t year) nogil 10 | cpdef int32_t get_days_in_month(int year, Py_ssize_t month) nogil 11 | cpdef int32_t get_week_of_year(int year, int month, int day) nogil 12 | cpdef int32_t get_day_of_year(int year, int month, int day) nogil 13 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_named_standard_columns_none.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
index.name
000
100
22 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_none_columns_unnamed_multi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
a
bc
00
00
22 | -------------------------------------------------------------------------------- /pandas/util/_exceptions.py: -------------------------------------------------------------------------------- 1 | import contextlib 2 | 3 | 4 | @contextlib.contextmanager 5 | def rewrite_exception(old_name, new_name): 6 | """Rewrite the message of an exception.""" 7 | try: 8 | yield 9 | except Exception as e: 10 | msg = e.args[0] 11 | msg = msg.replace(old_name, new_name) 12 | args = (msg,) 13 | if len(e.args) > 1: 14 | args = args + e.args[1:] 15 | e.args = args 16 | raise 17 | -------------------------------------------------------------------------------- /scripts/build_dist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # build the distribution 4 | LAST=`git tag --sort version:refname | grep -v rc | tail -1` 5 | 6 | echo "Building distribution for: $LAST" 7 | git checkout $LAST 8 | 9 | read -p "Ok to continue (y/n)? " answer 10 | case ${answer:0:1} in 11 | y|Y ) 12 | echo "Building distribution" 13 | ./build_dist_for_release.sh 14 | ;; 15 | * ) 16 | echo "Not building distribution" 17 | ;; 18 | esac 19 | -------------------------------------------------------------------------------- /pandas/_libs/tslibs/nattype.pxd: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from cpython.datetime cimport datetime 4 | 5 | from numpy cimport int64_t 6 | cdef int64_t NPY_NAT 7 | 8 | cdef bint _nat_scalar_rules[6] 9 | 10 | 11 | cdef class _NaT(datetime): 12 | cdef readonly: 13 | int64_t value 14 | object freq 15 | 16 | cdef _NaT c_NaT 17 | 18 | 19 | cdef bint checknull_with_nat(object val) 20 | cpdef bint is_null_datetimelike(object val, bint inat_is_null=*) 21 | -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/test2.csv: -------------------------------------------------------------------------------- 1 | A,B,C,D,E 2 | 2000-01-03 00:00:00,0.980268513777,3.68573087906,-0.364216805298,-1.15973806169,foo 3 | 2000-01-04 00:00:00,1.04791624281,-0.0412318367011,-0.16181208307,0.212549316967,bar 4 | 2000-01-05 00:00:00,0.498580885705,0.731167677815,-0.537677223318,1.34627041952,baz 5 | 2000-01-06 00:00:00,1.12020151869,1.56762092543,0.00364077397681,0.67525259227,qux 6 | 2000-01-07 00:00:00,-0.487094399463,0.571454623474,-1.6116394093,0.103468562917,foo2 7 | -------------------------------------------------------------------------------- /ci/deps/travis-37.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | - conda-forge 5 | - c3i_test 6 | dependencies: 7 | - python=3.7.* 8 | - botocore>=1.11 9 | - cython>=0.29.13 10 | - numpy 11 | - python-dateutil 12 | - nomkl 13 | - pyarrow 14 | - pytz 15 | # universal 16 | - pytest>=5.0.0 17 | - pytest-xdist>=1.29.0 18 | - pytest-mock 19 | - hypothesis>=3.58.0 20 | - s3fs<0.3 21 | - pip 22 | - pyreadstat 23 | - pip: 24 | - moto 25 | -------------------------------------------------------------------------------- /ci/travis_process_gbq_encryption.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ci/travis_gbq_config.txt 4 | 5 | if [[ -n ${SERVICE_ACCOUNT_KEY} ]]; then 6 | echo "${SERVICE_ACCOUNT_KEY}" > ci/travis_gbq.json; 7 | elif [[ -n ${!TRAVIS_IV_ENV} ]]; then 8 | openssl aes-256-cbc -K ${!TRAVIS_KEY_ENV} -iv ${!TRAVIS_IV_ENV} \ 9 | -in ci/travis_gbq.json.enc -out ci/travis_gbq.json -d; 10 | export GBQ_PROJECT_ID='pandas-travis'; 11 | echo 'Successfully decrypted gbq credentials' 12 | fi 13 | 14 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/gh12031_expected_output.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
A
06,0
13,1
22,2
23 | -------------------------------------------------------------------------------- /pandas/_libs/tslibs/timezones.pxd: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | cpdef bint is_utc(object tz) 4 | cdef bint is_tzlocal(object tz) 5 | 6 | cdef bint treat_tz_as_pytz(object tz) 7 | cdef bint treat_tz_as_dateutil(object tz) 8 | 9 | cpdef bint tz_compare(object start, object end) 10 | cpdef object get_timezone(object tz) 11 | cpdef object maybe_get_tz(object tz) 12 | 13 | cdef get_utcoffset(tzinfo, obj) 14 | cdef bint is_fixed_offset(object tz) 15 | 16 | cdef object get_dst_info(object tz) 17 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_none_columns_named_standard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
columns.name01
00
00
22 | -------------------------------------------------------------------------------- /.binstar.yml: -------------------------------------------------------------------------------- 1 | package: pandas 2 | user: jreback 3 | 4 | install: 5 | - conda config --add channels pandas 6 | 7 | before_script: 8 | - python -V 9 | 10 | platform: 11 | - linux-64 12 | #- linux-32 13 | - osx-64 14 | #- win-32 15 | - win-64 16 | engine: 17 | - python=2.7 18 | - python=3.4 19 | script: 20 | - conda build conda.recipe --quiet 21 | 22 | iotimeout: 600 23 | 24 | build_targets: conda 25 | 26 | notifications: 27 | email: 28 | recipients: ['jeff@reback.net'] 29 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_unnamed_standard_columns_unnamed_standard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
01
000
100
22 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_unnamed_standard_columns_named_standard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
columns.name01
000
100
22 | -------------------------------------------------------------------------------- /pandas/_libs/algos.pxd: -------------------------------------------------------------------------------- 1 | from pandas._libs.util cimport numeric 2 | 3 | 4 | cdef inline Py_ssize_t swap(numeric *a, numeric *b) nogil: 5 | cdef: 6 | numeric t 7 | 8 | # cython doesn't allow pointer dereference so use array syntax 9 | t = a[0] 10 | a[0] = b[0] 11 | b[0] = t 12 | return 0 13 | 14 | 15 | cdef enum TiebreakEnumType: 16 | TIEBREAK_AVERAGE 17 | TIEBREAK_MIN, 18 | TIEBREAK_MAX 19 | TIEBREAK_FIRST 20 | TIEBREAK_FIRST_DESCENDING 21 | TIEBREAK_DENSE 22 | -------------------------------------------------------------------------------- /pandas/io/excel/__init__.py: -------------------------------------------------------------------------------- 1 | from pandas.io.excel._base import ExcelFile, ExcelWriter, read_excel 2 | from pandas.io.excel._openpyxl import _OpenpyxlWriter 3 | from pandas.io.excel._util import register_writer 4 | from pandas.io.excel._xlsxwriter import _XlsxWriter 5 | from pandas.io.excel._xlwt import _XlwtWriter 6 | 7 | __all__ = ["read_excel", "ExcelWriter", "ExcelFile"] 8 | 9 | 10 | register_writer(_OpenpyxlWriter) 11 | 12 | 13 | register_writer(_XlwtWriter) 14 | 15 | 16 | register_writer(_XlsxWriter) 17 | -------------------------------------------------------------------------------- /pandas/api/extensions/__init__.py: -------------------------------------------------------------------------------- 1 | """Public API for extending pandas objects.""" 2 | from pandas.core.dtypes.dtypes import ( # noqa: F401 3 | ExtensionDtype, 4 | register_extension_dtype, 5 | ) 6 | 7 | from pandas.core.accessor import ( # noqa: F401 8 | register_dataframe_accessor, 9 | register_index_accessor, 10 | register_series_accessor, 11 | ) 12 | from pandas.core.algorithms import take # noqa: F401 13 | from pandas.core.arrays import ExtensionArray, ExtensionScalarOpsMixin # noqa: F401 14 | -------------------------------------------------------------------------------- /pandas/tests/indexing/test_indexing_slow.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from pandas import DataFrame 4 | import pandas.util.testing as tm 5 | 6 | 7 | class TestIndexingSlow: 8 | @pytest.mark.slow 9 | def test_large_dataframe_indexing(self): 10 | # GH10692 11 | result = DataFrame({"x": range(10 ** 6)}, dtype="int64") 12 | result.loc[len(result)] = len(result) + 1 13 | expected = DataFrame({"x": range(10 ** 6 + 1)}, dtype="int64") 14 | tm.assert_frame_equal(result, expected) 15 | -------------------------------------------------------------------------------- /ci/deps/azure-36-32bit.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - attrs=19.1.0 7 | - gcc_linux-32 8 | - gcc_linux-32 9 | - gxx_linux-32 10 | - numpy=1.14.* 11 | - python-dateutil 12 | - python=3.6.* 13 | - pytz=2017.2 14 | # universal 15 | - pytest 16 | - pytest-xdist 17 | - pytest-mock 18 | - pytest-azurepipelines 19 | - hypothesis>=3.58.0 20 | - pip 21 | - pip: 22 | # Anaconda doesn't build a new enough Cython 23 | - cython>=0.29.13 24 | -------------------------------------------------------------------------------- /pandas/compat/chainmap.py: -------------------------------------------------------------------------------- 1 | from collections import ChainMap 2 | 3 | 4 | class DeepChainMap(ChainMap): 5 | def __setitem__(self, key, value): 6 | for mapping in self.maps: 7 | if key in mapping: 8 | mapping[key] = value 9 | return 10 | self.maps[0][key] = value 11 | 12 | def __delitem__(self, key): 13 | for mapping in self.maps: 14 | if key in mapping: 15 | del mapping[key] 16 | return 17 | raise KeyError(key) 18 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/escape_disabled.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
co 6 | co>l2
str 12 | boldbold
stri>ng2 &boldbold
22 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_named_multi_columns_none.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
index.name.0index.name.1
ab00
c00
24 | -------------------------------------------------------------------------------- /pandas/tests/io/msgpack/test_subtype.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | from collections import namedtuple 4 | 5 | from pandas.io.msgpack import packb 6 | 7 | 8 | class MyList(list): 9 | pass 10 | 11 | 12 | class MyDict(dict): 13 | pass 14 | 15 | 16 | class MyTuple(tuple): 17 | pass 18 | 19 | 20 | MyNamedTuple = namedtuple("MyNamedTuple", "x y") 21 | 22 | 23 | def test_types(): 24 | assert packb(MyDict()) == packb(dict()) 25 | assert packb(MyList()) == packb(list()) 26 | assert packb(MyNamedTuple(1, 2)) == packb((1, 2)) 27 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_unnamed_multi_columns_unnamed_standard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
01
ab00
c00
24 | -------------------------------------------------------------------------------- /pandas/_libs/tslibs/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | from .conversion import localize_pydatetime, normalize_date 4 | from .nattype import NaT, NaTType, iNaT, is_null_datetimelike 5 | from .np_datetime import OutOfBoundsDatetime 6 | from .period import IncompatibleFrequency, Period 7 | from .timedeltas import Timedelta, delta_to_nanoseconds, ints_to_pytimedelta 8 | from .timestamps import Timestamp 9 | from .tzconversion import tz_convert_single 10 | 11 | # import fails if we do this before np_datetime 12 | from .c_timestamp import NullFrequencyError # isort:skip 13 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_2.html: -------------------------------------------------------------------------------- 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 |
ABC
11.2one
23.4two
35.6NaN
27 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_unnamed_standard_columns_unnamed_multi.html: -------------------------------------------------------------------------------- 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 |
a
bc
000
100
26 | -------------------------------------------------------------------------------- /pandas/tests/io/data/html_encoding/chinese_utf-8.html: -------------------------------------------------------------------------------- 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 |
01
0 漊煻獌 漊煻獌
1 袟袘觕 袟袘觕
2 埱娵徖 埱娵徖
-------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_unnamed_multi_columns_named_standard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
columns.name01
ab00
c00
24 | -------------------------------------------------------------------------------- /doc/source/reference/plotting.rst: -------------------------------------------------------------------------------- 1 | {{ header }} 2 | 3 | .. _api.plotting: 4 | 5 | ======== 6 | Plotting 7 | ======== 8 | .. currentmodule:: pandas.plotting 9 | 10 | The following functions are contained in the `pandas.plotting` module. 11 | 12 | .. autosummary:: 13 | :toctree: api/ 14 | 15 | andrews_curves 16 | autocorrelation_plot 17 | bootstrap_plot 18 | boxplot 19 | deregister_matplotlib_converters 20 | lag_plot 21 | parallel_coordinates 22 | plot_params 23 | radviz 24 | register_matplotlib_converters 25 | scatter_matrix 26 | table 27 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/escaped.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
co<l1co>l2
str<ing1 &amp;<type 'str'><type 'str'>
stri>ng2 &amp;<type 'str'><type 'str'>
22 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_none_columns_named_multi.html: -------------------------------------------------------------------------------- 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 |
columns.name.0a
columns.name.1bc
00
00
26 | -------------------------------------------------------------------------------- /ci/deps/azure-windows-36.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - blosc 7 | - bottleneck 8 | - fastparquet>=0.2.1 9 | - matplotlib=3.0.2 10 | - numexpr 11 | - numpy=1.15.* 12 | - openpyxl 13 | - pyarrow 14 | - pytables 15 | - python-dateutil 16 | - python=3.6.* 17 | - pytz 18 | - scipy 19 | - xlrd 20 | - xlsxwriter 21 | - xlwt 22 | # universal 23 | - cython>=0.29.13 24 | - pytest>=5.0.1 25 | - pytest-xdist>=1.29.0 26 | - pytest-mock 27 | - pytest-azurepipelines 28 | - hypothesis>=3.58.0 29 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/python/black 3 | rev: stable 4 | hooks: 5 | - id: black 6 | language_version: python3.7 7 | - repo: https://gitlab.com/pycqa/flake8 8 | rev: 3.7.7 9 | hooks: 10 | - id: flake8 11 | language: python_venv 12 | additional_dependencies: [flake8-comprehensions] 13 | - repo: https://github.com/pre-commit/mirrors-isort 14 | rev: v4.3.20 15 | hooks: 16 | - id: isort 17 | language: python_venv 18 | exclude: ^pandas/__init__\.py$|^pandas/core/api\.py$ 19 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_unnamed_standard_columns_named_multi.html: -------------------------------------------------------------------------------- 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 |
columns.name.0a
columns.name.1bc
000
100
26 | -------------------------------------------------------------------------------- /pandas/io/gcs.py: -------------------------------------------------------------------------------- 1 | """ GCS support for remote file interactivity """ 2 | from pandas.compat._optional import import_optional_dependency 3 | 4 | gcsfs = import_optional_dependency( 5 | "gcsfs", extra="The gcsfs library is required to handle GCS files" 6 | ) 7 | 8 | 9 | def get_filepath_or_buffer( 10 | filepath_or_buffer, encoding=None, compression=None, mode=None 11 | ): 12 | 13 | if mode is None: 14 | mode = "rb" 15 | 16 | fs = gcsfs.GCSFileSystem() 17 | filepath_or_buffer = fs.open(filepath_or_buffer, mode) 18 | return filepath_or_buffer, None, compression, True 19 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_named_standard_columns_unnamed_standard.html: -------------------------------------------------------------------------------- 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 |
01
index.name
000
100
27 | -------------------------------------------------------------------------------- /pandas/tests/io/data/test1.csv: -------------------------------------------------------------------------------- 1 | index,A,B,C,D 2 | 2000-01-03 00:00:00,0.980268513777,3.68573087906,-0.364216805298,-1.15973806169 3 | 2000-01-04 00:00:00,1.04791624281,-0.0412318367011,-0.16181208307,0.212549316967 4 | 2000-01-05 00:00:00,0.498580885705,0.731167677815,-0.537677223318,1.34627041952 5 | 2000-01-06 00:00:00,1.12020151869,1.56762092543,0.00364077397681,0.67525259227 6 | 2000-01-07 00:00:00,-0.487094399463,0.571454623474,-1.6116394093,0.103468562917 7 | 2000-01-10 00:00:00,0.836648671666,0.246461918642,0.588542635376,1.0627820613 8 | 2000-01-11 00:00:00,-0.157160753327,1.34030689438,1.19577795622,-1.09700699751 -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_named_standard_columns_named_standard.html: -------------------------------------------------------------------------------- 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 |
columns.name01
index.name
000
100
27 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/render_links_false.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
foobarNone
00http://pandas.pydata.org/?q1=a&q2=bpydata.org
10www.pydata.orgpydata.org
25 | -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/test1.csv: -------------------------------------------------------------------------------- 1 | index,A,B,C,D 2 | 2000-01-03 00:00:00,0.980268513777,3.68573087906,-0.364216805298,-1.15973806169 3 | 2000-01-04 00:00:00,1.04791624281,-0.0412318367011,-0.16181208307,0.212549316967 4 | 2000-01-05 00:00:00,0.498580885705,0.731167677815,-0.537677223318,1.34627041952 5 | 2000-01-06 00:00:00,1.12020151869,1.56762092543,0.00364077397681,0.67525259227 6 | 2000-01-07 00:00:00,-0.487094399463,0.571454623474,-1.6116394093,0.103468562917 7 | 2000-01-10 00:00:00,0.836648671666,0.246461918642,0.588542635376,1.0627820613 8 | 2000-01-11 00:00:00,-0.157160753327,1.34030689438,1.19577795622,-1.09700699751 -------------------------------------------------------------------------------- /ci/deps/travis-36-slow.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - beautifulsoup4 7 | - cython>=0.29.13 8 | - html5lib 9 | - lxml 10 | - matplotlib 11 | - numexpr 12 | - numpy 13 | - openpyxl 14 | - patsy 15 | - psycopg2 16 | - pymysql 17 | - pytables 18 | - python-dateutil 19 | - python=3.6.* 20 | - pytz 21 | - s3fs<0.3 22 | - scipy 23 | - sqlalchemy 24 | - xlrd 25 | - xlsxwriter 26 | - xlwt 27 | # universal 28 | - pytest>=5.0.0 29 | - pytest-xdist>=1.29.0 30 | - pytest-mock 31 | - moto 32 | - hypothesis>=3.58.0 33 | -------------------------------------------------------------------------------- /pandas/tests/io/data/stata6.csv: -------------------------------------------------------------------------------- 1 | byte_,int_,long_,float_,double_,date_td,string_,string_1 2 | 0,0,0,0,0,1960-01-01,"a","a" 3 | 1,1,1,1,1,3014-12-31,"ab","b" 4 | -1,-1,-1,-1,-1,2014-12-31,"abc","c" 5 | 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 string has 244 characters, so that ir is the maximum length permitted by Stata. This string has 244 characters, so that ir is the maximum length permitted","d" 6 | -127,-32767,2147483620,1.7010000002777e+38,8.000000000000e+307,1970-01-02,"abcdefghijklmnopqrstuvwxyz","e" 7 | -------------------------------------------------------------------------------- /pandas/arrays/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | All of pandas' ExtensionArrays. 3 | 4 | See :ref:`extending.extension-types` for more. 5 | """ 6 | from pandas.core.arrays import ( 7 | Categorical, 8 | DatetimeArray, 9 | IntegerArray, 10 | IntervalArray, 11 | PandasArray, 12 | PeriodArray, 13 | SparseArray, 14 | StringArray, 15 | TimedeltaArray, 16 | ) 17 | 18 | __all__ = [ 19 | "Categorical", 20 | "DatetimeArray", 21 | "IntegerArray", 22 | "IntervalArray", 23 | "PandasArray", 24 | "PeriodArray", 25 | "SparseArray", 26 | "StringArray", 27 | "TimedeltaArray", 28 | ] 29 | -------------------------------------------------------------------------------- /pandas/tests/util/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.fixture(params=[True, False]) 5 | def check_dtype(request): 6 | return request.param 7 | 8 | 9 | @pytest.fixture(params=[True, False]) 10 | def check_exact(request): 11 | return request.param 12 | 13 | 14 | @pytest.fixture(params=[True, False]) 15 | def check_index_type(request): 16 | return request.param 17 | 18 | 19 | @pytest.fixture(params=[True, False]) 20 | def check_less_precise(request): 21 | return request.param 22 | 23 | 24 | @pytest.fixture(params=[True, False]) 25 | def check_categorical(request): 26 | return request.param 27 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/gh8452_expected_output.html: -------------------------------------------------------------------------------- 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 |
ab
cdcd
0353
1464
29 | -------------------------------------------------------------------------------- /pandas/tests/io/msgpack/test_buffer.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | from pandas.io.msgpack import packb, unpackb 4 | 5 | from .common import frombytes 6 | 7 | 8 | def test_unpack_buffer(): 9 | from array import array 10 | 11 | buf = array("b") 12 | frombytes(buf, packb((b"foo", b"bar"))) 13 | obj = unpackb(buf, use_list=1) 14 | assert [b"foo", b"bar"] == obj 15 | 16 | 17 | def test_unpack_bytearray(): 18 | buf = bytearray(packb(("foo", "bar"))) 19 | obj = unpackb(buf, use_list=1) 20 | assert [b"foo", b"bar"] == obj 21 | expected_type = bytes 22 | assert all(type(s) == expected_type for s in obj) 23 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_unnamed_multi_columns_unnamed_multi.html: -------------------------------------------------------------------------------- 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 |
a
bc
ab00
c00
29 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_1.html: -------------------------------------------------------------------------------- 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 |
ABC
foo11.2one
bar23.4two
baz35.6NaN
31 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/justify.html: -------------------------------------------------------------------------------- 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 |
ABC
061223442
13000020
22700001
31 | -------------------------------------------------------------------------------- /ci/deps/azure-37-numpydev.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | dependencies: 5 | - python=3.7.* 6 | - pytz 7 | - Cython>=0.29.13 8 | # universal 9 | # pytest < 5 until defaults has pytest-xdist>=1.29.0 10 | - pytest>=4.0.2,<5.0 11 | - pytest-xdist 12 | - pytest-mock 13 | - hypothesis>=3.58.0 14 | - pip 15 | - pip: 16 | - "git+git://github.com/dateutil/dateutil.git" 17 | - "-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" 18 | - "--pre" 19 | - "numpy" 20 | - "scipy" 21 | # https://github.com/pandas-dev/pandas/issues/27421 22 | - pytest-azurepipelines<1.0.0 23 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_formatter.html: -------------------------------------------------------------------------------- 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 |
fooNone
a01
b23
c45
d67
32 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_named_standard_columns_unnamed_multi.html: -------------------------------------------------------------------------------- 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 |
a
bc
index.name
000
100
31 | -------------------------------------------------------------------------------- /pandas/tests/window/common.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | 3 | import numpy as np 4 | from numpy.random import randn 5 | 6 | from pandas import DataFrame, Series, bdate_range 7 | 8 | N, K = 100, 10 9 | 10 | 11 | class Base: 12 | 13 | _nan_locs = np.arange(20, 40) 14 | _inf_locs = np.array([]) 15 | 16 | def _create_data(self): 17 | arr = randn(N) 18 | arr[self._nan_locs] = np.NaN 19 | 20 | self.arr = arr 21 | self.rng = bdate_range(datetime(2009, 1, 1), periods=N) 22 | self.series = Series(arr.copy(), index=self.rng) 23 | self.frame = DataFrame(randn(N, K), index=self.rng, columns=np.arange(K)) 24 | -------------------------------------------------------------------------------- /ci/deps/azure-37-locale.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - beautifulsoup4 7 | - cython>=0.29.13 8 | - html5lib 9 | - ipython 10 | - jinja2 11 | - lxml 12 | - matplotlib 13 | - moto 14 | - nomkl 15 | - numexpr 16 | - numpy 17 | - openpyxl 18 | - pytables 19 | - python-dateutil 20 | - python=3.7.* 21 | - pytz 22 | - s3fs 23 | - scipy 24 | - xarray 25 | - xlrd 26 | - xlsxwriter 27 | - xlwt 28 | # universal 29 | - pytest>=5.0.1 30 | - pytest-xdist>=1.29.0 31 | - pytest-mock 32 | - pytest-azurepipelines 33 | - pip 34 | - pip: 35 | - hypothesis>=3.58.0 36 | -------------------------------------------------------------------------------- /pandas/core/arrays/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import ( # noqa: F401 2 | ExtensionArray, 3 | ExtensionOpsMixin, 4 | ExtensionScalarOpsMixin, 5 | ) 6 | from .categorical import Categorical # noqa: F401 7 | from .datetimes import DatetimeArray # noqa: F401 8 | from .integer import IntegerArray, integer_array # noqa: F401 9 | from .interval import IntervalArray # noqa: F401 10 | from .numpy_ import PandasArray, PandasDtype # noqa: F401 11 | from .period import PeriodArray, period_array # noqa: F401 12 | from .sparse import SparseArray # noqa: F401 13 | from .string_ import StringArray # noqa: F401 14 | from .timedeltas import TimedeltaArray # noqa: F401 15 | -------------------------------------------------------------------------------- /pandas/core/index.py: -------------------------------------------------------------------------------- 1 | from pandas.core.indexes.api import ( # noqa:F401 2 | CategoricalIndex, 3 | DatetimeIndex, 4 | Float64Index, 5 | Index, 6 | Int64Index, 7 | IntervalIndex, 8 | InvalidIndexError, 9 | MultiIndex, 10 | NaT, 11 | NumericIndex, 12 | PeriodIndex, 13 | RangeIndex, 14 | TimedeltaIndex, 15 | UInt64Index, 16 | _all_indexes_same, 17 | _get_combined_index, 18 | _get_consensus_names, 19 | _get_objs_combined_axis, 20 | _new_Index, 21 | _union_indexes, 22 | ensure_index, 23 | ensure_index_from_sequences, 24 | ) 25 | from pandas.core.indexes.multi import _sparsify # noqa:F401 26 | -------------------------------------------------------------------------------- /pandas/io/msgpack/exceptions.py: -------------------------------------------------------------------------------- 1 | class UnpackException(Exception): 2 | pass 3 | 4 | 5 | class BufferFull(UnpackException): 6 | pass 7 | 8 | 9 | class OutOfData(UnpackException): 10 | pass 11 | 12 | 13 | class UnpackValueError(UnpackException, ValueError): 14 | pass 15 | 16 | 17 | class ExtraData(ValueError): 18 | def __init__(self, unpacked, extra): 19 | self.unpacked = unpacked 20 | self.extra = extra 21 | 22 | def __str__(self): 23 | return "unpack(b) received extra data." 24 | 25 | 26 | class PackException(Exception): 27 | pass 28 | 29 | 30 | class PackValueError(PackException, ValueError): 31 | pass 32 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/gh22783_expected_output.html: -------------------------------------------------------------------------------- 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 |
01...34
1.7640520.400157...2.2408931.867558
-0.9772780.950088...-0.1032190.410599
28 | -------------------------------------------------------------------------------- /LICENSES/MSGPACK_LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2008-2011 INADA Naoki 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /ci/deps/azure-36-locale.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - beautifulsoup4==4.6.0 7 | - bottleneck=1.2.* 8 | - cython=0.29.13 9 | - lxml 10 | - matplotlib=2.2.2 11 | - numpy=1.14.* 12 | - openpyxl=2.4.8 13 | - python-dateutil 14 | - python-blosc 15 | - python=3.6.* 16 | - pytz=2017.2 17 | - scipy 18 | - sqlalchemy=1.1.4 19 | - xlrd=1.1.0 20 | - xlsxwriter=0.9.8 21 | - xlwt=1.2.0 22 | # universal 23 | - pytest>=5.0.0 24 | - pytest-xdist>=1.29.0 25 | - pytest-mock 26 | - pytest-azurepipelines 27 | - hypothesis>=3.58.0 28 | - pip 29 | - pip: 30 | - html5lib==1.0b2 31 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_unnamed_multi_columns_named_multi.html: -------------------------------------------------------------------------------- 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 |
columns.name.0a
columns.name.1bc
ab00
c00
29 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/render_links_true.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
foobarNone
00http://pandas.pydata.org/?q1=a&q2=bpydata.org
10www.pydata.orgpydata.org
25 | -------------------------------------------------------------------------------- /ci/deps/azure-windows-37.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - beautifulsoup4 7 | - bottleneck 8 | - gcsfs 9 | - html5lib 10 | - jinja2 11 | - lxml 12 | - matplotlib=2.2.* 13 | - moto 14 | - numexpr 15 | - numpy=1.14.* 16 | - openpyxl 17 | - pytables 18 | - python=3.7.* 19 | - python-dateutil 20 | - pytz 21 | - s3fs 22 | - scipy 23 | - sqlalchemy 24 | - xlrd 25 | - xlsxwriter 26 | - xlwt 27 | # universal 28 | - cython>=0.29.13 29 | - pytest>=5.0.0 30 | - pytest-xdist>=1.29.0 31 | - pytest-mock 32 | - pytest-azurepipelines 33 | - hypothesis>=3.58.0 34 | - pyreadstat 35 | -------------------------------------------------------------------------------- /pandas/plotting/_matplotlib/compat.py: -------------------------------------------------------------------------------- 1 | # being a bit too dynamic 2 | from distutils.version import LooseVersion 3 | import operator 4 | 5 | 6 | def _mpl_version(version, op): 7 | def inner(): 8 | try: 9 | import matplotlib as mpl 10 | except ImportError: 11 | return False 12 | return ( 13 | op(LooseVersion(mpl.__version__), LooseVersion(version)) 14 | and str(mpl.__version__)[0] != "0" 15 | ) 16 | 17 | return inner 18 | 19 | 20 | _mpl_ge_2_2_3 = _mpl_version("2.2.3", operator.ge) 21 | _mpl_ge_3_0_0 = _mpl_version("3.0.0", operator.ge) 22 | _mpl_ge_3_1_0 = _mpl_version("3.1.0", operator.ge) 23 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/gh15019_expected_output.html: -------------------------------------------------------------------------------- 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 |
01
1.7640520.400157
0.9787382.240893
......
0.950088-0.151357
-0.1032190.410599
31 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_named_standard_columns_named_multi.html: -------------------------------------------------------------------------------- 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 |
columns.name.0a
columns.name.1bc
index.name
000
100
31 | -------------------------------------------------------------------------------- /pandas/tests/util/test_assert_produces_warning.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | import pytest 4 | 5 | import pandas.util.testing as tm 6 | 7 | 8 | def f(): 9 | warnings.warn("f1", FutureWarning) 10 | warnings.warn("f2", RuntimeWarning) 11 | 12 | 13 | @pytest.mark.filterwarnings("ignore:f1:FutureWarning") 14 | def test_assert_produces_warning_honors_filter(): 15 | # Raise by default. 16 | msg = r"Caused unexpected warning\(s\)" 17 | with pytest.raises(AssertionError, match=msg): 18 | with tm.assert_produces_warning(RuntimeWarning): 19 | f() 20 | 21 | with tm.assert_produces_warning(RuntimeWarning, raise_on_extra_warnings=False): 22 | f() 23 | -------------------------------------------------------------------------------- /ci/deps/azure-36-locale_slow.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - beautifulsoup4 7 | - cython>=0.29.13 8 | - gcsfs 9 | - html5lib 10 | - ipython 11 | - jinja2 12 | - lxml 13 | - matplotlib=3.0.* 14 | - nomkl 15 | - numexpr 16 | - numpy=1.15.* 17 | - openpyxl 18 | - pytables 19 | - python-dateutil 20 | - python=3.6.* 21 | - pytz 22 | - s3fs 23 | - scipy 24 | - xarray 25 | - xlrd 26 | - xlsxwriter 27 | - xlwt 28 | # universal 29 | - pytest>=4.0.2 30 | - pytest-xdist 31 | - pytest-mock 32 | - pytest-azurepipelines 33 | - moto 34 | - pip 35 | - pip: 36 | - hypothesis>=3.58.0 37 | -------------------------------------------------------------------------------- /pandas/_libs/src/headers/portable.h: -------------------------------------------------------------------------------- 1 | #ifndef _PANDAS_PORTABLE_H_ 2 | #define _PANDAS_PORTABLE_H_ 3 | 4 | #if defined(_MSC_VER) 5 | #define strcasecmp( s1, s2 ) _stricmp( s1, s2 ) 6 | #endif 7 | 8 | // GH-23516 - works around locale perf issues 9 | // from MUSL libc, MIT Licensed - see LICENSES 10 | #define isdigit_ascii(c) (((unsigned)(c) - '0') < 10u) 11 | #define getdigit_ascii(c, default) (isdigit_ascii(c) ? ((int)((c) - '0')) : default) 12 | #define isspace_ascii(c) (((c) == ' ') || (((unsigned)(c) - '\t') < 5)) 13 | #define toupper_ascii(c) ((((unsigned)(c) - 'a') < 26) ? ((c) & 0x5f) : (c)) 14 | #define tolower_ascii(c) ((((unsigned)(c) - 'A') < 26) ? ((c) | 0x20) : (c)) 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_named_multi_columns_unnamed_standard.html: -------------------------------------------------------------------------------- 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 |
01
index.name.0index.name.1
ab00
c00
30 | -------------------------------------------------------------------------------- /web/pandas/community/blog.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% block body %} 4 | {% for post in blog.posts %} 5 |
6 |
7 |

{{ post.title }}

8 |
Source: {{ post.feed }} | Author: {{ post.author }} | Published: {{ post.published.strftime("%b %d, %Y") }}
9 |
{{ post.summary }}
10 | Read 11 |
12 |
13 | {% endfor %} 14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_named_multi_columns_named_standard.html: -------------------------------------------------------------------------------- 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 |
columns.name01
index.name.0index.name.1
ab00
c00
30 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/multiindex_2.html: -------------------------------------------------------------------------------- 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 |
0123
0101
0abcd
1efgh
35 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY : develop build clean clean_pyc doc lint-diff black 2 | 3 | all: develop 4 | 5 | clean: 6 | -python setup.py clean 7 | 8 | clean_pyc: 9 | -find . -name '*.py[co]' -exec rm {} \; 10 | 11 | build: clean_pyc 12 | python setup.py build_ext --inplace 13 | 14 | lint-diff: 15 | git diff upstream/master --name-only -- "*.py" | xargs flake8 16 | 17 | black: 18 | black . --exclude '(asv_bench/env|\.egg|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist|setup.py)' 19 | 20 | develop: build 21 | python -m pip install --no-build-isolation -e . 22 | 23 | doc: 24 | -rm -rf doc/build doc/source/generated 25 | cd doc; \ 26 | python make.py clean; \ 27 | python make.py html 28 | -------------------------------------------------------------------------------- /ci/submit_cython_cache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CACHE_File="$HOME/.cache/cython_files.tar" 4 | PYX_CACHE_DIR="$HOME/.cache/pyxfiles" 5 | pyx_file_list=`find ${TRAVIS_BUILD_DIR} -name "*.pyx" -o -name "*.pxd" -o -name "*.pxi.in"` 6 | 7 | rm -rf $CACHE_File 8 | rm -rf $PYX_CACHE_DIR 9 | 10 | home_dir=$(pwd) 11 | 12 | mkdir -p $PYX_CACHE_DIR 13 | rsync -Rv $pyx_file_list $PYX_CACHE_DIR 14 | 15 | echo "pyx files:" 16 | echo $pyx_file_list 17 | 18 | tar cf ${CACHE_File} --files-from /dev/null 19 | 20 | for i in ${pyx_file_list} 21 | do 22 | f=${i%.pyx} 23 | ls $f.{c,cpp} | tar rf ${CACHE_File} -T - 24 | done 25 | 26 | echo "Cython files in cache tar:" 27 | tar tvf ${CACHE_File} 28 | 29 | exit 0 30 | -------------------------------------------------------------------------------- /pandas/tests/extension/base/io.py: -------------------------------------------------------------------------------- 1 | from io import StringIO 2 | 3 | import numpy as np 4 | import pytest 5 | 6 | import pandas as pd 7 | 8 | from .base import BaseExtensionTests 9 | 10 | 11 | class BaseParsingTests(BaseExtensionTests): 12 | @pytest.mark.parametrize("engine", ["c", "python"]) 13 | def test_EA_types(self, engine, data): 14 | df = pd.DataFrame({"with_dtype": pd.Series(data, dtype=str(data.dtype))}) 15 | csv_output = df.to_csv(index=False, na_rep=np.nan) 16 | result = pd.read_csv( 17 | StringIO(csv_output), dtype={"with_dtype": str(data.dtype)}, engine=engine 18 | ) 19 | expected = df 20 | self.assert_frame_equal(result, expected) 21 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/multiindex_1.html: -------------------------------------------------------------------------------- 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 |
CL001
CL10101
0abcd
1efgh
33 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | # Minimum requirements for the build system to execute. 3 | # See https://github.com/scipy/scipy/pull/10431 for the AIX issue. 4 | requires = [ 5 | "setuptools", 6 | "wheel", 7 | "Cython>=0.29.13", # Note: sync with setup.py 8 | "numpy==1.13.3; python_version=='3.5' and platform_system!='AIX'", 9 | "numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'", 10 | "numpy==1.14.5; python_version>='3.7' and platform_system!='AIX'", 11 | "numpy==1.16.0; python_version=='3.5' and platform_system=='AIX'", 12 | "numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'", 13 | "numpy==1.16.0; python_version>='3.7' and platform_system=='AIX'", 14 | ] 15 | -------------------------------------------------------------------------------- /pandas/tests/dtypes/cast/test_infer_datetimelike.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | from pandas import DataFrame, NaT, Series, Timestamp 5 | 6 | 7 | @pytest.mark.parametrize( 8 | "data,exp_size", 9 | [ 10 | # see gh-16362. 11 | ([[NaT, "a", "b", 0], [NaT, "b", "c", 1]], 8), 12 | ([[NaT, "a", 0], [NaT, "b", 1]], 6), 13 | ], 14 | ) 15 | def test_maybe_infer_to_datetimelike_df_construct(data, exp_size): 16 | result = DataFrame(np.array(data)) 17 | assert result.size == exp_size 18 | 19 | 20 | def test_maybe_infer_to_datetimelike_ser_construct(): 21 | # see gh-19671. 22 | result = Series(["M1701", Timestamp("20130101")]) 23 | assert result.dtype.kind == "O" 24 | -------------------------------------------------------------------------------- /pandas/io/msgpack/_packer.pyi: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | class Packer: 4 | def __cinit__(self): ... 5 | def __init__( 6 | self, 7 | default=..., 8 | encoding=..., 9 | unicode_errors=..., 10 | use_single_float=..., 11 | autoreset: int = ..., 12 | use_bin_type: int = ..., 13 | ): ... 14 | def __dealloc__(self): ... 15 | def _pack(self, o, nest_limit: int = ...) -> int: ... 16 | def pack(self, obj): ... 17 | def pack_ext_type(self, typecode, data): ... 18 | def pack_array_header(self, size): ... 19 | def pack_map_header(self, size): ... 20 | def pack_map_pairs(self, pairs): ... 21 | def reset(self) -> None: ... 22 | def bytes(self): ... 23 | -------------------------------------------------------------------------------- /web/pandas/try.md: -------------------------------------------------------------------------------- 1 | # Try pandas online 2 | 3 |
4 |
 5 | import pandas
 6 | fibonacci = pandas.Series([1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144])
 7 | fibonacci.sum()
 8 |     
9 | 10 | 11 |
12 | 13 | ## Interactive tutorials 14 | 15 | You can also try _pandas_ on [Binder](https://mybinder.org/) for one of the next topics: 16 | 17 | - Exploratory analysis of US presidents 18 | - Preprocessing the Titanic dataset to train a machine learning model 19 | - Forecasting the stock market 20 | 21 | _(links will be added soon)_ 22 | -------------------------------------------------------------------------------- /ci/deps/azure-35-compat.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - beautifulsoup4=4.6.0 7 | - bottleneck=1.2.1 8 | - jinja2=2.8 9 | - numexpr=2.6.2 10 | - numpy=1.13.3 11 | - openpyxl=2.4.8 12 | - pytables=3.4.2 13 | - python-dateutil=2.6.1 14 | - python=3.5.3 15 | - pytz=2017.2 16 | - scipy=0.19.0 17 | - xlrd=1.1.0 18 | - xlsxwriter=0.9.8 19 | - xlwt=1.2.0 20 | # universal 21 | - hypothesis>=3.58.0 22 | - pytest-xdist 23 | - pytest-mock 24 | - pytest-azurepipelines 25 | - pip 26 | - pip: 27 | # for python 3.5, pytest>=4.0.2, cython>=0.29.13 is not available in conda 28 | - cython>=0.29.13 29 | - pytest==4.5.0 30 | - html5lib==1.0b2 31 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/gh22783_named_columns_index.html: -------------------------------------------------------------------------------- 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 |
columns.name01...34
1.7640520.400157...2.2408931.867558
-0.9772780.950088...-0.1032190.410599
31 | -------------------------------------------------------------------------------- /pandas/tests/tseries/offsets/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import pandas.tseries.offsets as offsets 4 | 5 | 6 | @pytest.fixture(params=[getattr(offsets, o) for o in offsets.__all__]) 7 | def offset_types(request): 8 | """ 9 | Fixture for all the datetime offsets available for a time series. 10 | """ 11 | return request.param 12 | 13 | 14 | @pytest.fixture( 15 | params=[ 16 | getattr(offsets, o) 17 | for o in offsets.__all__ 18 | if issubclass(getattr(offsets, o), offsets.MonthOffset) and o != "MonthOffset" 19 | ] 20 | ) 21 | def month_classes(request): 22 | """ 23 | Fixture for month based datetime offsets available for a time series. 24 | """ 25 | return request.param 26 | -------------------------------------------------------------------------------- /pandas/_config/dates.py: -------------------------------------------------------------------------------- 1 | """ 2 | config for datetime formatting 3 | """ 4 | from pandas._config import config as cf 5 | 6 | pc_date_dayfirst_doc = """ 7 | : boolean 8 | When True, prints and parses dates with the day first, eg 20/01/2005 9 | """ 10 | 11 | pc_date_yearfirst_doc = """ 12 | : boolean 13 | When True, prints and parses dates with the year first, eg 2005/01/20 14 | """ 15 | 16 | with cf.config_prefix("display"): 17 | # Needed upstream of `_libs` because these are used in tslibs.parsing 18 | cf.register_option( 19 | "date_dayfirst", False, pc_date_dayfirst_doc, validator=cf.is_bool 20 | ) 21 | cf.register_option( 22 | "date_yearfirst", False, pc_date_yearfirst_doc, validator=cf.is_bool 23 | ) 24 | -------------------------------------------------------------------------------- /pandas/tests/indexing/multiindex/test_datetime.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | 3 | import numpy as np 4 | 5 | from pandas import Index, Period, Series, period_range 6 | 7 | 8 | def test_multiindex_period_datetime(): 9 | # GH4861, using datetime in period of multiindex raises exception 10 | 11 | idx1 = Index(["a", "a", "a", "b", "b"]) 12 | idx2 = period_range("2012-01", periods=len(idx1), freq="M") 13 | s = Series(np.random.randn(len(idx1)), [idx1, idx2]) 14 | 15 | # try Period as index 16 | expected = s.iloc[0] 17 | result = s.loc["a", Period("2012-01")] 18 | assert result == expected 19 | 20 | # try datetime as index 21 | result = s.loc["a", datetime(2012, 1, 1)] 22 | assert result == expected 23 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_4.html: -------------------------------------------------------------------------------- 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 |
ABC
foocar11.2one
bike23.4two
barcar35.6NaN
34 | -------------------------------------------------------------------------------- /web/README.md: -------------------------------------------------------------------------------- 1 | Directory containing the pandas website (hosted at https://pandas.io). 2 | 3 | The website sources are in `web/pandas/`, which also include a `config.yml` file 4 | containing the settings to build the website. The website is generated with the 5 | command `./pandas_web.py pandas`. See `./pandas_web.py --help` and the header of 6 | the script for more information and options. 7 | 8 | After building the website, to navigate it, it is needed to access the web using 9 | an http server (a not open the local files with the browser, since the links and 10 | the image sources are absolute to where they are served from). The easiest way 11 | to run an http server locally is to run `python -m http.server` from the 12 | `web/build/` directory. 13 | -------------------------------------------------------------------------------- /pandas/tests/reshape/merge/data/quotes.csv: -------------------------------------------------------------------------------- 1 | time,ticker,bid,ask 2 | 20160525 13:30:00.023,GOOG,720.50,720.93 3 | 20160525 13:30:00.023,MSFT,51.95,51.95 4 | 20160525 13:30:00.041,MSFT,51.95,51.95 5 | 20160525 13:30:00.048,GOOG,720.50,720.93 6 | 20160525 13:30:00.048,GOOG,720.50,720.93 7 | 20160525 13:30:00.048,GOOG,720.50,720.93 8 | 20160525 13:30:00.048,GOOG,720.50,720.93 9 | 20160525 13:30:00.072,GOOG,720.50,720.88 10 | 20160525 13:30:00.075,AAPL,98.55,98.56 11 | 20160525 13:30:00.076,AAPL,98.55,98.56 12 | 20160525 13:30:00.076,AAPL,98.55,98.56 13 | 20160525 13:30:00.076,AAPL,98.55,98.56 14 | 20160525 13:30:00.078,MSFT,51.95,51.95 15 | 20160525 13:30:00.078,MSFT,51.95,51.95 16 | 20160525 13:30:00.078,MSFT,51.95,51.95 17 | 20160525 13:30:00.078,MSFT,51.92,51.95 18 | -------------------------------------------------------------------------------- /pandas/tests/series/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import pandas.util.testing as tm 4 | 5 | 6 | @pytest.fixture 7 | def datetime_series(): 8 | """ 9 | Fixture for Series of floats with DatetimeIndex 10 | """ 11 | s = tm.makeTimeSeries() 12 | s.name = "ts" 13 | return s 14 | 15 | 16 | @pytest.fixture 17 | def string_series(): 18 | """ 19 | Fixture for Series of floats with Index of unique strings 20 | """ 21 | s = tm.makeStringSeries() 22 | s.name = "series" 23 | return s 24 | 25 | 26 | @pytest.fixture 27 | def object_series(): 28 | """ 29 | Fixture for Series of dtype object with Index of unique strings 30 | """ 31 | s = tm.makeObjectSeries() 32 | s.name = "objects" 33 | return s 34 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_3.html: -------------------------------------------------------------------------------- 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 |
ABC
idx
foo11.2one
bar23.4two
baz35.6NaN
37 | -------------------------------------------------------------------------------- /pandas/tests/series/common.py: -------------------------------------------------------------------------------- 1 | from pandas.util._decorators import cache_readonly 2 | 3 | import pandas as pd 4 | import pandas.util.testing as tm 5 | 6 | _ts = tm.makeTimeSeries() 7 | 8 | 9 | class TestData: 10 | @cache_readonly 11 | def ts(self): 12 | ts = _ts.copy() 13 | ts.name = "ts" 14 | return ts 15 | 16 | @cache_readonly 17 | def series(self): 18 | series = tm.makeStringSeries() 19 | series.name = "series" 20 | return series 21 | 22 | @cache_readonly 23 | def objSeries(self): 24 | objSeries = tm.makeObjectSeries() 25 | objSeries.name = "objects" 26 | return objSeries 27 | 28 | @cache_readonly 29 | def empty(self): 30 | return pd.Series([], index=[]) 31 | -------------------------------------------------------------------------------- /pandas/_libs/skiplist.pxd: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # See GH#27465 for reference on related-but-unused cython code 3 | 4 | cdef extern from "src/skiplist.h": 5 | ctypedef struct node_t: 6 | node_t **next 7 | int *width 8 | double value 9 | int is_nil 10 | int levels 11 | int ref_count 12 | 13 | ctypedef struct skiplist_t: 14 | node_t *head 15 | node_t **tmp_chain 16 | int *tmp_steps 17 | int size 18 | int maxlevels 19 | 20 | skiplist_t* skiplist_init(int) nogil 21 | void skiplist_destroy(skiplist_t*) nogil 22 | double skiplist_get(skiplist_t*, int, int*) nogil 23 | int skiplist_insert(skiplist_t*, double) nogil 24 | int skiplist_remove(skiplist_t*, double) nogil 25 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_named_multi_columns_unnamed_multi.html: -------------------------------------------------------------------------------- 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 |
a
bc
index.name.0index.name.1
ab00
c00
35 | -------------------------------------------------------------------------------- /pandas/tests/series/test_validate.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | class TestSeriesValidate: 5 | """Tests for error handling related to data types of method arguments.""" 6 | 7 | @pytest.mark.parametrize( 8 | "func", 9 | ["reset_index", "_set_name", "sort_values", "sort_index", "rename", "dropna"], 10 | ) 11 | @pytest.mark.parametrize("inplace", [1, "True", [1, 2, 3], 5.0]) 12 | def test_validate_bool_args(self, string_series, func, inplace): 13 | msg = 'For argument "inplace" expected type bool' 14 | kwargs = dict(inplace=inplace) 15 | 16 | if func == "_set_name": 17 | kwargs["name"] = "hello" 18 | 19 | with pytest.raises(ValueError, match=msg): 20 | getattr(string_series, func)(**kwargs) 21 | -------------------------------------------------------------------------------- /pandas/tests/indexing/conftest.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | from pandas._libs import index as libindex 5 | 6 | 7 | @pytest.fixture( 8 | params=[ 9 | (libindex.Int64Engine, np.int64), 10 | (libindex.Int32Engine, np.int32), 11 | (libindex.Int16Engine, np.int16), 12 | (libindex.Int8Engine, np.int8), 13 | (libindex.UInt64Engine, np.uint64), 14 | (libindex.UInt32Engine, np.uint32), 15 | (libindex.UInt16Engine, np.uint16), 16 | (libindex.UInt8Engine, np.uint8), 17 | (libindex.Float64Engine, np.float64), 18 | (libindex.Float32Engine, np.float32), 19 | ], 20 | ids=lambda x: x[0].__name__, 21 | ) 22 | def numeric_indexing_engine_type_and_dtype(request): 23 | return request.param 24 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/truncate_formatter.html: -------------------------------------------------------------------------------- 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 |
A...D
01_mod...4
15_mod...8
29_mod...12
313_mod...16
37 | -------------------------------------------------------------------------------- /ci/deps/azure-macos-35.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | dependencies: 5 | - beautifulsoup4 6 | - bottleneck 7 | - html5lib 8 | - jinja2 9 | - lxml 10 | - matplotlib=2.2.3 11 | - nomkl 12 | - numexpr 13 | - numpy=1.13.3 14 | - openpyxl 15 | - pyarrow 16 | - pytables 17 | - python=3.5.* 18 | - python-dateutil==2.6.1 19 | - pytz 20 | - xarray 21 | - xlrd 22 | - xlsxwriter 23 | - xlwt 24 | - pip 25 | - pip: 26 | # Anaconda / conda-forge don't build for 3.5 27 | - cython>=0.29.13 28 | - pyreadstat 29 | # universal 30 | - pytest>=5.0.1 31 | - pytest-xdist>=1.29.0 32 | - pytest-mock 33 | - hypothesis>=3.58.0 34 | # https://github.com/pandas-dev/pandas/issues/27421 35 | - pytest-azurepipelines<1.0.0 36 | -------------------------------------------------------------------------------- /pandas/_libs/tslibs/c_timestamp.pxd: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from cpython.datetime cimport datetime 4 | 5 | from numpy cimport int64_t 6 | 7 | cdef class _Timestamp(datetime): 8 | cdef readonly: 9 | int64_t value, nanosecond 10 | object freq 11 | list _date_attributes 12 | cpdef bint _get_start_end_field(self, str field) 13 | cpdef _get_date_name_field(self, object field, object locale) 14 | cdef int64_t _maybe_convert_value_to_local(self) 15 | cpdef to_datetime64(self) 16 | cdef _assert_tzawareness_compat(_Timestamp self, datetime other) 17 | cpdef datetime to_pydatetime(_Timestamp self, bint warn=*) 18 | cdef bint _compare_outside_nanorange(_Timestamp self, datetime other, 19 | int op) except -1 20 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_named_multi_columns_named_multi.html: -------------------------------------------------------------------------------- 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 |
columns.name.0a
columns.name.1bc
index.name.0index.name.1
ab00
c00
35 | -------------------------------------------------------------------------------- /pandas/_config/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | pandas._config is considered explicitly upstream of everything else in pandas, 3 | should have no intra-pandas dependencies. 4 | 5 | importing `dates` and `display` ensures that keys needed by _libs 6 | are initialized. 7 | """ 8 | __all__ = [ 9 | "config", 10 | "detect_console_encoding", 11 | "get_option", 12 | "set_option", 13 | "reset_option", 14 | "describe_option", 15 | "option_context", 16 | "options", 17 | ] 18 | from pandas._config import config 19 | from pandas._config import dates # noqa:F401 20 | from pandas._config.config import ( 21 | describe_option, 22 | get_option, 23 | option_context, 24 | options, 25 | reset_option, 26 | set_option, 27 | ) 28 | from pandas._config.display import detect_console_encoding 29 | -------------------------------------------------------------------------------- /pandas/tests/io/test_s3.py: -------------------------------------------------------------------------------- 1 | from io import BytesIO 2 | 3 | import pytest 4 | 5 | from pandas import read_csv 6 | 7 | from pandas.io.common import is_s3_url 8 | 9 | 10 | class TestS3URL: 11 | def test_is_s3_url(self): 12 | assert is_s3_url("s3://pandas/somethingelse.com") 13 | assert not is_s3_url("s4://pandas/somethingelse.com") 14 | 15 | 16 | def test_streaming_s3_objects(): 17 | # GH17135 18 | # botocore gained iteration support in 1.10.47, can now be used in read_* 19 | pytest.importorskip("botocore", minversion="1.10.47") 20 | from botocore.response import StreamingBody 21 | 22 | data = [b"foo,bar,baz\n1,2,3\n4,5,6\n", b"just,the,header\n"] 23 | for el in data: 24 | body = StreamingBody(BytesIO(el), content_length=len(el)) 25 | read_csv(body) 26 | -------------------------------------------------------------------------------- /pandas/_libs/src/inline_helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, PyData Development Team 3 | All rights reserved. 4 | 5 | Distributed under the terms of the BSD Simplified License. 6 | 7 | The full license is in the LICENSE file, distributed with this software. 8 | */ 9 | 10 | #ifndef PANDAS__LIBS_SRC_INLINE_HELPER_H_ 11 | #define PANDAS__LIBS_SRC_INLINE_HELPER_H_ 12 | 13 | #ifndef PANDAS_INLINE 14 | #if defined(__GNUC__) 15 | #define PANDAS_INLINE static __inline__ 16 | #elif defined(_MSC_VER) 17 | #define PANDAS_INLINE static __inline 18 | #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 19 | #define PANDAS_INLINE static inline 20 | #else 21 | #define PANDAS_INLINE 22 | #endif // __GNUC__ 23 | #endif // PANDAS_INLINE 24 | 25 | #endif // PANDAS__LIBS_SRC_INLINE_HELPER_H_ 26 | -------------------------------------------------------------------------------- /asv_bench/benchmarks/io/sas.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from pandas import read_sas 4 | 5 | 6 | class SAS: 7 | 8 | params = ["sas7bdat", "xport"] 9 | param_names = ["format"] 10 | 11 | def setup(self, format): 12 | # Read files that are located in 'pandas/io/tests/sas/data' 13 | files = {"sas7bdat": "test1.sas7bdat", "xport": "paxraw_d_short.xpt"} 14 | file = files[format] 15 | paths = [ 16 | os.path.dirname(__file__), 17 | "..", 18 | "..", 19 | "..", 20 | "pandas", 21 | "tests", 22 | "io", 23 | "sas", 24 | "data", 25 | file, 26 | ] 27 | self.f = os.path.join(*paths) 28 | 29 | def time_read_msgpack(self, format): 30 | read_sas(self.f, format=format) 31 | -------------------------------------------------------------------------------- /pandas/tests/io/sas/test_sas.py: -------------------------------------------------------------------------------- 1 | from io import StringIO 2 | 3 | import pytest 4 | 5 | from pandas import read_sas 6 | import pandas.util.testing as tm 7 | 8 | 9 | class TestSas: 10 | def test_sas_buffer_format(self): 11 | # see gh-14947 12 | b = StringIO("") 13 | 14 | msg = ( 15 | "If this is a buffer object rather than a string " 16 | "name, you must specify a format string" 17 | ) 18 | with pytest.raises(ValueError, match=msg): 19 | read_sas(b) 20 | 21 | def test_sas_read_no_format_or_extension(self): 22 | # see gh-24548 23 | msg = "unable to infer format of SAS file" 24 | with tm.ensure_clean("test_file_no_extension") as path: 25 | with pytest.raises(ValueError, match=msg): 26 | read_sas(path) 27 | -------------------------------------------------------------------------------- /doc/sphinxext/README.rst: -------------------------------------------------------------------------------- 1 | sphinxext 2 | ========= 3 | 4 | This directory contains copies of different sphinx extensions in use in the 5 | pandas documentation. These copies originate from other projects: 6 | 7 | - ``numpydoc`` - Numpy's Sphinx extensions: this can be found at its own 8 | repository: https://github.com/numpy/numpydoc 9 | - ``ipython_directive`` and ``ipython_console_highlighting`` in the folder 10 | `ipython_sphinxext` - Sphinx extensions from IPython: these are included 11 | in IPython: https://github.com/ipython/ipython/tree/master/IPython/sphinxext 12 | 13 | .. note:: 14 | 15 | These copies are maintained at the respective projects, so fixes should, 16 | to the extent possible, be pushed upstream instead of only adapting our 17 | local copy to avoid divergence between the local and upstream version. 18 | -------------------------------------------------------------------------------- /pandas/_libs/indexing.pyx: -------------------------------------------------------------------------------- 1 | cdef class _NDFrameIndexerBase: 2 | """ 3 | A base class for _NDFrameIndexer for fast instantiation and attribute 4 | access. 5 | """ 6 | cdef public object obj, name, _ndim 7 | 8 | def __init__(self, name, obj): 9 | self.obj = obj 10 | self.name = name 11 | self._ndim = None 12 | 13 | @property 14 | def ndim(self): 15 | # Delay `ndim` instantiation until required as reading it 16 | # from `obj` isn't entirely cheap. 17 | ndim = self._ndim 18 | if ndim is None: 19 | ndim = self._ndim = self.obj.ndim 20 | if ndim > 2: 21 | msg = ("NDFrameIndexer does not support NDFrame objects with" 22 | " ndim > 2") 23 | raise ValueError(msg) 24 | return ndim 25 | -------------------------------------------------------------------------------- /pandas/io/api.py: -------------------------------------------------------------------------------- 1 | """ 2 | Data IO api 3 | """ 4 | 5 | # flake8: noqa 6 | 7 | from pandas.io.clipboards import read_clipboard 8 | from pandas.io.excel import ExcelFile, ExcelWriter, read_excel 9 | from pandas.io.feather_format import read_feather 10 | from pandas.io.gbq import read_gbq 11 | from pandas.io.html import read_html 12 | from pandas.io.json import read_json 13 | from pandas.io.packers import read_msgpack, to_msgpack 14 | from pandas.io.parquet import read_parquet 15 | from pandas.io.parsers import read_csv, read_fwf, read_table 16 | from pandas.io.pickle import read_pickle, to_pickle 17 | from pandas.io.pytables import HDFStore, read_hdf 18 | from pandas.io.sas import read_sas 19 | from pandas.io.spss import read_spss 20 | from pandas.io.sql import read_sql, read_sql_query, read_sql_table 21 | from pandas.io.stata import read_stata 22 | -------------------------------------------------------------------------------- /pandas/tests/dtypes/cast/test_construct_from_scalar.py: -------------------------------------------------------------------------------- 1 | from pandas.core.dtypes.cast import construct_1d_arraylike_from_scalar 2 | from pandas.core.dtypes.dtypes import CategoricalDtype 3 | 4 | from pandas import Categorical 5 | from pandas.util import testing as tm 6 | 7 | 8 | def test_cast_1d_array_like_from_scalar_categorical(): 9 | # see gh-19565 10 | # 11 | # Categorical result from scalar did not maintain 12 | # categories and ordering of the passed dtype. 13 | cats = ["a", "b", "c"] 14 | cat_type = CategoricalDtype(categories=cats, ordered=False) 15 | expected = Categorical(["a", "a"], categories=cats) 16 | 17 | result = construct_1d_arraylike_from_scalar("a", len(expected), cat_type) 18 | tm.assert_categorical_equal( 19 | result, expected, check_category_order=True, check_dtype=True 20 | ) 21 | -------------------------------------------------------------------------------- /pandas/tests/dtypes/cast/test_construct_ndarray.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | from pandas.core.dtypes.cast import construct_1d_ndarray_preserving_na 5 | 6 | from pandas.util import testing as tm 7 | 8 | 9 | @pytest.mark.parametrize( 10 | "values, dtype, expected", 11 | [ 12 | ([1, 2, 3], None, np.array([1, 2, 3])), 13 | (np.array([1, 2, 3]), None, np.array([1, 2, 3])), 14 | (["1", "2", None], None, np.array(["1", "2", None])), 15 | (["1", "2", None], np.dtype("str"), np.array(["1", "2", None])), 16 | ([1, 2, None], np.dtype("str"), np.array(["1", "2", None])), 17 | ], 18 | ) 19 | def test_construct_1d_ndarray_preserving_na(values, dtype, expected): 20 | result = construct_1d_ndarray_preserving_na(values, dtype=dtype) 21 | tm.assert_numpy_array_equal(result, expected) 22 | -------------------------------------------------------------------------------- /pandas/tests/dtypes/cast/test_construct_object_arr.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike 4 | 5 | 6 | @pytest.mark.parametrize("datum1", [1, 2.0, "3", (4, 5), [6, 7], None]) 7 | @pytest.mark.parametrize("datum2", [8, 9.0, "10", (11, 12), [13, 14], None]) 8 | def test_cast_1d_array(datum1, datum2): 9 | data = [datum1, datum2] 10 | result = construct_1d_object_array_from_listlike(data) 11 | 12 | # Direct comparison fails: https://github.com/numpy/numpy/issues/10218 13 | assert result.dtype == "object" 14 | assert list(result) == data 15 | 16 | 17 | @pytest.mark.parametrize("val", [1, 2.0, None]) 18 | def test_cast_1d_array_invalid_scalar(val): 19 | with pytest.raises(TypeError, match="has no len()"): 20 | construct_1d_object_array_from_listlike(val) 21 | -------------------------------------------------------------------------------- /pandas/tests/extension/base/casting.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | from pandas.core.internals import ObjectBlock 3 | 4 | from .base import BaseExtensionTests 5 | 6 | 7 | class BaseCastingTests(BaseExtensionTests): 8 | """Casting to and from ExtensionDtypes""" 9 | 10 | def test_astype_object_series(self, all_data): 11 | ser = pd.Series({"A": all_data}) 12 | result = ser.astype(object) 13 | assert isinstance(result._data.blocks[0], ObjectBlock) 14 | 15 | def test_tolist(self, data): 16 | result = pd.Series(data).tolist() 17 | expected = list(data) 18 | assert result == expected 19 | 20 | def test_astype_str(self, data): 21 | result = pd.Series(data[:5]).astype(str) 22 | expected = pd.Series(data[:5].astype(str)) 23 | self.assert_series_equal(result, expected) 24 | -------------------------------------------------------------------------------- /web/pandas/donate.md: -------------------------------------------------------------------------------- 1 | # Donate to pandas 2 | 3 |
4 |
5 | 8 | 9 | _pandas_ is a Sponsored Project of [NumFOCUS](https://numfocus.org/), a 501(c)(3) nonprofit charity in the United States. 10 | NumFOCUS provides _pandas_ with fiscal, legal, and administrative support to help ensure the 11 | health and sustainability of the project. Visit numfocus.org for more information. 12 | 13 | Donations to _pandas_ are managed by NumFOCUS. For donors in the United States, your gift is tax-deductible 14 | to the extent provided by law. As with any donation, you should consult with your tax adviser about your particular tax situation. 15 | -------------------------------------------------------------------------------- /ci/deps/travis-36-locale.yaml: -------------------------------------------------------------------------------- 1 | name: pandas-dev 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - beautifulsoup4 7 | - blosc=1.14.3 8 | - python-blosc 9 | - cython>=0.29.13 10 | - fastparquet=0.2.1 11 | - gcsfs=0.2.2 12 | - html5lib 13 | - ipython 14 | - jinja2 15 | - lxml=3.8.0 16 | - matplotlib=3.0.* 17 | - moto 18 | - nomkl 19 | - numexpr 20 | - numpy 21 | - openpyxl 22 | - pandas-gbq=0.8.0 23 | - psycopg2=2.6.2 24 | - pymysql=0.7.11 25 | - pytables 26 | - python-dateutil 27 | - python=3.6.* 28 | - pytz 29 | - s3fs=0.0.8 30 | - scipy 31 | - sqlalchemy=1.1.4 32 | - xarray=0.10 33 | - xlrd 34 | - xlsxwriter 35 | - xlwt 36 | # universal 37 | - pytest>=5.0.1 38 | - pytest-xdist>=1.29.0 39 | - pytest-mock 40 | - pip 41 | - pip: 42 | - hypothesis>=3.58.0 43 | -------------------------------------------------------------------------------- /pandas/core/internals/__init__.py: -------------------------------------------------------------------------------- 1 | from .blocks import ( # noqa: F401 2 | Block, 3 | BoolBlock, 4 | CategoricalBlock, 5 | ComplexBlock, 6 | DatetimeBlock, 7 | DatetimeTZBlock, 8 | ExtensionBlock, 9 | FloatBlock, 10 | IntBlock, 11 | ObjectBlock, 12 | TimeDeltaBlock, 13 | ) 14 | from .managers import ( # noqa: F401 15 | BlockManager, 16 | SingleBlockManager, 17 | create_block_manager_from_arrays, 18 | create_block_manager_from_blocks, 19 | ) 20 | 21 | from .blocks import _safe_reshape # noqa: F401; io.packers 22 | from .blocks import make_block # noqa: F401; io.pytables, io.packers 23 | from .managers import ( # noqa: F401; reshape.concat, reshape.merge 24 | _transform_index, 25 | concatenate_block_managers, 26 | ) 27 | 28 | from .blocks import _block_shape # noqa:F401; io.pytables 29 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/trunc_df_index_none_columns_none.html: -------------------------------------------------------------------------------- 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 |
01...67
89...1415
...............
4849...5455
5657...6263
40 | -------------------------------------------------------------------------------- /pandas/util/_tester.py: -------------------------------------------------------------------------------- 1 | """ 2 | Entrypoint for testing from the top-level namespace 3 | """ 4 | import os 5 | import sys 6 | 7 | PKG = os.path.dirname(os.path.dirname(__file__)) 8 | 9 | 10 | def test(extra_args=None): 11 | try: 12 | import pytest 13 | except ImportError: 14 | raise ImportError("Need pytest>=4.0.2 to run tests") 15 | try: 16 | import hypothesis # noqa 17 | except ImportError: 18 | raise ImportError("Need hypothesis>=3.58 to run tests") 19 | cmd = ["--skip-slow", "--skip-network", "--skip-db"] 20 | if extra_args: 21 | if not isinstance(extra_args, list): 22 | extra_args = [extra_args] 23 | cmd = extra_args 24 | cmd += [PKG] 25 | print("running: pytest {}".format(" ".join(cmd))) 26 | sys.exit(pytest.main(cmd)) 27 | 28 | 29 | __all__ = ["test"] 30 | -------------------------------------------------------------------------------- /pandas/tests/indexes/period/test_scalar_compat.py: -------------------------------------------------------------------------------- 1 | """Tests for PeriodIndex behaving like a vectorized Period scalar""" 2 | 3 | from pandas import Timedelta, date_range, period_range 4 | import pandas.util.testing as tm 5 | 6 | 7 | class TestPeriodIndexOps: 8 | def test_start_time(self): 9 | index = period_range(freq="M", start="2016-01-01", end="2016-05-31") 10 | expected_index = date_range("2016-01-01", end="2016-05-31", freq="MS") 11 | tm.assert_index_equal(index.start_time, expected_index) 12 | 13 | def test_end_time(self): 14 | index = period_range(freq="M", start="2016-01-01", end="2016-05-31") 15 | expected_index = date_range("2016-01-01", end="2016-05-31", freq="M") 16 | expected_index += Timedelta(1, "D") - Timedelta(1, "ns") 17 | tm.assert_index_equal(index.end_time, expected_index) 18 | -------------------------------------------------------------------------------- /pandas/tests/tslibs/test_ccalendar.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | 3 | import numpy as np 4 | import pytest 5 | 6 | from pandas._libs.tslibs import ccalendar 7 | 8 | 9 | @pytest.mark.parametrize( 10 | "date_tuple,expected", 11 | [ 12 | ((2001, 3, 1), 60), 13 | ((2004, 3, 1), 61), 14 | ((1907, 12, 31), 365), # End-of-year, non-leap year. 15 | ((2004, 12, 31), 366), # End-of-year, leap year. 16 | ], 17 | ) 18 | def test_get_day_of_year_numeric(date_tuple, expected): 19 | assert ccalendar.get_day_of_year(*date_tuple) == expected 20 | 21 | 22 | def test_get_day_of_year_dt(): 23 | dt = datetime.fromordinal(1 + np.random.randint(365 * 4000)) 24 | result = ccalendar.get_day_of_year(dt.year, dt.month, dt.day) 25 | 26 | expected = (dt - dt.replace(month=1, day=1)).days + 1 27 | assert result == expected 28 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/multiindex_sparsify_1.html: -------------------------------------------------------------------------------- 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 |
01
foo
0001
123
1045
167
41 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/index_5.html: -------------------------------------------------------------------------------- 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 |
ABC
idx1idx2
foocar11.2one
bike23.4two
barcar35.6NaN
41 | -------------------------------------------------------------------------------- /asv_bench/benchmarks/io/pickle.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from pandas import DataFrame, date_range, read_pickle 4 | import pandas.util.testing as tm 5 | 6 | from ..pandas_vb_common import BaseIO 7 | 8 | 9 | class Pickle(BaseIO): 10 | def setup(self): 11 | self.fname = "__test__.pkl" 12 | N = 100000 13 | C = 5 14 | self.df = DataFrame( 15 | np.random.randn(N, C), 16 | columns=["float{}".format(i) for i in range(C)], 17 | index=date_range("20000101", periods=N, freq="H"), 18 | ) 19 | self.df["object"] = tm.makeStringIndex(N) 20 | self.df.to_pickle(self.fname) 21 | 22 | def time_read_pickle(self): 23 | read_pickle(self.fname) 24 | 25 | def time_write_pickle(self): 26 | self.df.to_pickle(self.fname) 27 | 28 | 29 | from ..pandas_vb_common import setup # noqa: F401 isort:skip 30 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/multiindex_sparsify_false_multi_sparse_1.html: -------------------------------------------------------------------------------- 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 |
01
foo
0001
0123
1045
1167
43 | -------------------------------------------------------------------------------- /ci/check_cache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # currently not used 4 | # script to make sure that cache is clean 5 | # Travis CI now handles this 6 | 7 | if [ "$TRAVIS_PULL_REQUEST" == "false" ] 8 | then 9 | echo "Not a PR: checking for changes in ci/ from last 2 commits" 10 | git diff HEAD~2 --numstat | grep -E "ci/" 11 | ci_changes=$(git diff HEAD~2 --numstat | grep -E "ci/"| wc -l) 12 | else 13 | echo "PR: checking for changes in ci/ from last 2 commits" 14 | git fetch origin pull/${TRAVIS_PULL_REQUEST}/head:PR_HEAD 15 | git diff PR_HEAD~2 --numstat | grep -E "ci/" 16 | ci_changes=$(git diff PR_HEAD~2 --numstat | grep -E "ci/"| wc -l) 17 | fi 18 | 19 | CACHE_DIR="$HOME/.cache/" 20 | CCACHE_DIR="$HOME/.ccache/" 21 | 22 | if [ $ci_changes -ne 0 ] 23 | then 24 | echo "Files have changed in ci/ deleting all caches" 25 | rm -rf "$CACHE_DIR" 26 | rm -rf "$CCACHE_DIR" 27 | fi 28 | -------------------------------------------------------------------------------- /pandas/tests/io/data/gbq_fake_job.txt: -------------------------------------------------------------------------------- 1 | {'status': {'state': 'DONE'}, 'kind': 'bigquery#job', 'statistics': {'query': {'cacheHit': True, 'totalBytesProcessed': '0'}, 'endTime': '1377668744674', 'totalBytesProcessed': '0', 'startTime': '1377668744466'}, 'jobReference': {'projectId': '57288129629', 'jobId': 'bqjob_r5f956972f0190bdf_00000140c374bf42_2'}, 'etag': '"4PTsVxg68bQkQs1RJ1Ndewqkgg4/oO4VmgFrAku4N6FWci9s7iFIftc"', 'configuration': {'query': {'createDisposition': 'CREATE_IF_NEEDED', 'query': 'SELECT * FROM [publicdata:samples.shakespeare]', 'writeDisposition': 'WRITE_TRUNCATE', 'destinationTable': {'projectId': '57288129629', 'tableId': 'anonb5ec450da88eeeb78a27784ea482ee75a146d442', 'datasetId': '_d0b4f5f0d50dc68a3eb0fa6cba66a9a8687d9253'}}}, 'id': '57288129629:bqjob_r5f956972f0190bdf_00000140c374bf42_2', 'selfLink': 'https://www.googleapis.com/bigquery/v2/projects/57288129629/jobs/bqjob_r5f956972f0190bdf_00000140c374bf42_2'} -------------------------------------------------------------------------------- /asv_bench/benchmarks/attrs_caching.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from pandas import DataFrame 4 | 5 | try: 6 | from pandas.util import cache_readonly 7 | except ImportError: 8 | from pandas.util.decorators import cache_readonly 9 | 10 | 11 | class DataFrameAttributes: 12 | def setup(self): 13 | self.df = DataFrame(np.random.randn(10, 6)) 14 | self.cur_index = self.df.index 15 | 16 | def time_get_index(self): 17 | self.foo = self.df.index 18 | 19 | def time_set_index(self): 20 | self.df.index = self.cur_index 21 | 22 | 23 | class CacheReadonly: 24 | def setup(self): 25 | class Foo: 26 | @cache_readonly 27 | def prop(self): 28 | return 5 29 | 30 | self.obj = Foo() 31 | 32 | def time_cache_readonly(self): 33 | self.obj.prop 34 | 35 | 36 | from .pandas_vb_common import setup # noqa: F401 isort:skip 37 | -------------------------------------------------------------------------------- /ci/check_git_tags.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | if [[ ! $(git tag) ]]; then 4 | echo "No git tags in clone, please sync your git tags with upstream using:" 5 | echo " git fetch --tags upstream" 6 | echo " git push --tags origin" 7 | echo "" 8 | echo "If the issue persists, the clone depth needs to be increased in .travis.yml" 9 | exit 1 10 | fi 11 | 12 | # This will error if there are no tags and we omit --always 13 | DESCRIPTION=$(git describe --long --tags) 14 | echo "$DESCRIPTION" 15 | 16 | if [[ "$DESCRIPTION" == *"untagged"* ]]; then 17 | echo "Unable to determine most recent tag, aborting build" 18 | exit 1 19 | else 20 | if [[ "$DESCRIPTION" != *"g"* ]]; then 21 | # A good description will have the hash prefixed by g, a bad one will be 22 | # just the hash 23 | echo "Unable to determine most recent tag, aborting build" 24 | exit 1 25 | else 26 | echo "$(git tag)" 27 | fi 28 | fi 29 | -------------------------------------------------------------------------------- /web/pandas/contribute.md: -------------------------------------------------------------------------------- 1 | # Contribute to pandas 2 | 3 | _pandas_ is and always will be **free**. To make the development sustainable, we need _pandas_ users, corporate 4 | or individual, to support the development by providing their time and money. 5 | 6 | You can find more information about current developers in the [team page](about/team.html), 7 | and about current sponsors in the [sponsors page](about/sponsors.html). 8 | Financial contributions will mainly be used to advance in the [pandas roadmap](about/roadmap.html). 9 | 10 | - If your **company or organization** is interested in helping make pandas better, please contact us at [info@numfocus.org](mailto:info@numfocus.org) 11 | - If you want to contribute to _pandas_ with your **time**, please visit the [contributing page]({{ base_url }}/docs/development/index.html) 12 | - If you want to support _pandas_ with a **donation**, please use the [donations page](donate.html). 13 | -------------------------------------------------------------------------------- /asv_bench/benchmarks/package.py: -------------------------------------------------------------------------------- 1 | """ 2 | Benchmarks for pandas at the package-level. 3 | """ 4 | import subprocess 5 | import sys 6 | 7 | from pandas.compat import PY37 8 | 9 | 10 | class TimeImport: 11 | def time_import(self): 12 | if PY37: 13 | # on py37+ we the "-X importtime" usage gives us a more precise 14 | # measurement of the import time we actually care about, 15 | # without the subprocess or interpreter overhead 16 | cmd = [sys.executable, "-X", "importtime", "-c", "import pandas as pd"] 17 | p = subprocess.run(cmd, stderr=subprocess.PIPE) 18 | 19 | line = p.stderr.splitlines()[-1] 20 | field = line.split(b"|")[-2].strip() 21 | total = int(field) # microseconds 22 | return total 23 | 24 | cmd = [sys.executable, "-c", "import pandas as pd"] 25 | subprocess.run(cmd, stderr=subprocess.PIPE) 26 | -------------------------------------------------------------------------------- /pandas/tests/series/indexing/test_iloc.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from pandas import Series 4 | from pandas.util.testing import assert_almost_equal, assert_series_equal 5 | 6 | 7 | def test_iloc(): 8 | s = Series(np.random.randn(10), index=list(range(0, 20, 2))) 9 | 10 | for i in range(len(s)): 11 | result = s.iloc[i] 12 | exp = s[s.index[i]] 13 | assert_almost_equal(result, exp) 14 | 15 | # pass a slice 16 | result = s.iloc[slice(1, 3)] 17 | expected = s.loc[2:4] 18 | assert_series_equal(result, expected) 19 | 20 | # test slice is a view 21 | result[:] = 0 22 | assert (s[1:3] == 0).all() 23 | 24 | # list of integers 25 | result = s.iloc[[0, 2, 3, 4, 5]] 26 | expected = s.reindex(s.index[[0, 2, 3, 4, 5]]) 27 | assert_series_equal(result, expected) 28 | 29 | 30 | def test_iloc_nonunique(): 31 | s = Series([0, 1, 2], index=[0, 1, 0]) 32 | assert s.iloc[2] == 2 33 | -------------------------------------------------------------------------------- /pandas/tests/tslibs/test_timedeltas.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | from pandas._libs.tslibs.timedeltas import delta_to_nanoseconds 5 | 6 | import pandas as pd 7 | from pandas import Timedelta 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "obj,expected", 12 | [ 13 | (np.timedelta64(14, "D"), 14 * 24 * 3600 * 1e9), 14 | (Timedelta(minutes=-7), -7 * 60 * 1e9), 15 | (Timedelta(minutes=-7).to_pytimedelta(), -7 * 60 * 1e9), 16 | (pd.offsets.Nano(125), 125), 17 | (1, 1), 18 | (np.int64(2), 2), 19 | (np.int32(3), 3), 20 | ], 21 | ) 22 | def test_delta_to_nanoseconds(obj, expected): 23 | result = delta_to_nanoseconds(obj) 24 | assert result == expected 25 | 26 | 27 | def test_delta_to_nanoseconds_error(): 28 | obj = np.array([123456789], dtype="m8[ns]") 29 | 30 | with pytest.raises(TypeError, match=""): 31 | delta_to_nanoseconds(obj) 32 | -------------------------------------------------------------------------------- /pandas/tests/io/msgpack/test_unpack_raw.py: -------------------------------------------------------------------------------- 1 | """Tests for cases where the user seeks to obtain packed msgpack objects""" 2 | 3 | import io 4 | 5 | from pandas.io.msgpack import Unpacker, packb 6 | 7 | 8 | def test_write_bytes(): 9 | unpacker = Unpacker() 10 | unpacker.feed(b"abc") 11 | f = io.BytesIO() 12 | assert unpacker.unpack(f.write) == ord("a") 13 | assert f.getvalue() == b"a" 14 | f = io.BytesIO() 15 | assert unpacker.skip(f.write) is None 16 | assert f.getvalue() == b"b" 17 | f = io.BytesIO() 18 | assert unpacker.skip() is None 19 | assert f.getvalue() == b"" 20 | 21 | 22 | def test_write_bytes_multi_buffer(): 23 | long_val = (5) * 100 24 | expected = packb(long_val) 25 | unpacker = Unpacker(io.BytesIO(expected), read_size=3, max_buffer_size=3) 26 | 27 | f = io.BytesIO() 28 | unpacked = unpacker.unpack(f.write) 29 | assert unpacked == long_val 30 | assert f.getvalue() == expected 31 | -------------------------------------------------------------------------------- /pandas/tests/io/parser/data/salaries.csv: -------------------------------------------------------------------------------- 1 | S X E M 2 | 13876 1 1 1 3 | 11608 1 3 0 4 | 18701 1 3 1 5 | 11283 1 2 0 6 | 11767 1 3 0 7 | 20872 2 2 1 8 | 11772 2 2 0 9 | 10535 2 1 0 10 | 12195 2 3 0 11 | 12313 3 2 0 12 | 14975 3 1 1 13 | 21371 3 2 1 14 | 19800 3 3 1 15 | 11417 4 1 0 16 | 20263 4 3 1 17 | 13231 4 3 0 18 | 12884 4 2 0 19 | 13245 5 2 0 20 | 13677 5 3 0 21 | 15965 5 1 1 22 | 12336 6 1 0 23 | 21352 6 3 1 24 | 13839 6 2 0 25 | 22884 6 2 1 26 | 16978 7 1 1 27 | 14803 8 2 0 28 | 17404 8 1 1 29 | 22184 8 3 1 30 | 13548 8 1 0 31 | 14467 10 1 0 32 | 15942 10 2 0 33 | 23174 10 3 1 34 | 23780 10 2 1 35 | 25410 11 2 1 36 | 14861 11 1 0 37 | 16882 12 2 0 38 | 24170 12 3 1 39 | 15990 13 1 0 40 | 26330 13 2 1 41 | 17949 14 2 0 42 | 25685 15 3 1 43 | 27837 16 2 1 44 | 18838 16 2 0 45 | 17483 16 1 0 46 | 19207 17 2 0 47 | 19346 20 1 0 48 | -------------------------------------------------------------------------------- /pandas/tests/io/json/data/tsframe_iso_v012.json: -------------------------------------------------------------------------------- 1 | {"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-07T00:00:00":-2.69652057},"C":{"2000-01-03T00:00:00":1.81021139,"2000-01-04T00:00:00":-0.03202878,"2000-01-05T00:00:00":1.629455,"2000-01-06T00:00:00":0.33192641,"2000-01-07T00:00:00":1.28163262},"D":{"2000-01-03T00:00:00":-0.17251653,"2000-01-04T00:00:00":-0.17581665,"2000-01-05T00:00:00":-1.31506612,"2000-01-06T00:00:00":-0.27885413,"2000-01-07T00:00:00":0.34703478},"date":{"2000-01-03T00:00:00":"1992-01-06T18:21:32.120000","2000-01-04T00:00:00":"1992-01-06T18:21:32.120000","2000-01-05T00:00:00":"1992-01-06T18:21:32.120000","2000-01-06T00:00:00":"2013-01-01T00:00:00","2000-01-07T00:00:00":"1992-01-06T18:21:32.120000"}} -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/multiindex_sparsify_2.html: -------------------------------------------------------------------------------- 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 |
foo01
00
foo
0001
123
1045
167
47 | -------------------------------------------------------------------------------- /pandas/tests/io/formats/data/html/trunc_df_index_unnamed_standard_columns_none.html: -------------------------------------------------------------------------------- 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 |
001...67
189...1415
..................
64849...5455
75657...6263
45 | -------------------------------------------------------------------------------- /pandas/tests/indexes/datetimes/test_datetimelike.py: -------------------------------------------------------------------------------- 1 | """ generic tests from the Datetimelike class """ 2 | 3 | from pandas import DatetimeIndex, date_range 4 | from pandas.util import testing as tm 5 | 6 | from ..datetimelike import DatetimeLike 7 | 8 | 9 | class TestDatetimeIndex(DatetimeLike): 10 | _holder = DatetimeIndex 11 | 12 | def setup_method(self, method): 13 | self.indices = dict( 14 | index=tm.makeDateIndex(10), 15 | index_dec=date_range("20130110", periods=10, freq="-1D"), 16 | ) 17 | self.setup_indices() 18 | 19 | def create_index(self): 20 | return date_range("20130101", periods=5) 21 | 22 | def test_shift(self): 23 | pass # handled in test_ops 24 | 25 | def test_pickle_compat_construction(self): 26 | pass 27 | 28 | def test_intersection(self): 29 | pass # handled in test_setops 30 | 31 | def test_union(self): 32 | pass # handled in test_setops 33 | --------------------------------------------------------------------------------