๋ ์ด์ python 3.5๋ฅผ ์ง์ํ์ง ์์ผ๋ฏ๋ก ์ด์ ์ด์ .format()
๋์ ์ f-๋ฌธ์์ด์ ์ฌ์ฉํ ์ ์์ต๋๋ค(๋ฌผ๋ก %
ํ์ ์ง์ ).
ํ ๋ฆฌํ์คํธ์ ๋ณธ๋ฌธ ๋ฉ์์ง์ ์ด ๋ฌธ์ ๋ฅผ ์ฐ๊ฒฐํ๋ ๊ฒ์ ์์ง ๋ง์ธ์. ์ด https://github.com/pandas-dev/pandas/issues/29547
๋ฅผ ํ ๋ฆฌํ์คํธ์ ๋ณธ๋ฌธ ๋ฉ์์ง์ ๋ถ์ฌ๋ฃ๊ธฐ๋ง ํ๋ฉด ๋ฉ๋๋ค.
๋ณ๊ฒฝ๋ ํ์ผ์ด #29886 ๊ณผ ๊ด๋ จ๋ ๊ฒฝ์ฐ ํด๋น ๋ฌธ์ ์๋ pull ์์ฒญ์ ์ฐ๊ฒฐํ๊ณ ์ด https://github.com/pandas-dev/pandas/issues/29886
๋ฅผ pull ์์ฒญ์ ๋ณธ๋ฌธ ๋ฉ์์ง์๋ ๋ถ์ฌ๋ฃ๊ธฐ๋ง ํ๋ฉด ๋ฉ๋๋ค.
์ด์ค ์์ ์ ํ์ง ์๋๋ก ์ด๋ค ์์ ์ ๊ณํํ๊ณ ์๋์ง ๋๊ธ๋ก ์๋ ค์ฃผ์ธ์.
์๋ฃ๋ก ํ์๋์ด์ผ ํ๋ ํ์ผ์ด ํ์๋์ง ์์ ๊ฒฝ์ฐ ๋๊ธ๋ก ์๋ ค์ฃผ์ธ์.
pandas
๋๋ ํ ๋ฆฌ์์ ์์ง ์์ ํด์ผ ํ ํ์ผ์ ํ์ธํ๋ ค๋ฉด:
grep -l -R '%s' --include=*.{py,pyx} pandas/
grep -l -R '%d' --include=*.{py,pyx} pandas/
grep -l -R '\.format(' --include=*.{py,pyx} pandas/
์์ ๋ชจ๋ ๊ฒ์ ํ๋์ ๋ผ์ด๋๋ก ์ฌ์ฉํ ์๋ ์์ต๋๋ค.
grep -l -R -e '%s' -e '%d' -e '\.format(' --include=*.{py,pyx} pandas/
๋ฐ์์ ์ค ๋ฒํธ๋ฅผ ๋ณด๋ ค๋ฉด -l
๋ฅผ -n
๋ฐ๊พธ์ญ์์ค.
์๋ฅผ ๋ค์ด:
grep -n -R '%s' --include=*.{py,pyx} pandas/
[ ] pandas/compat/pickle_compat.py
[ ] ํฌ๋/_config/config.py
[ ] ํฌ๋/์ฝ์ด/๋ฐฐ์ด/datetimelike.py
[ ] ํฌ๋/์ฝ์ด/๋ฐฐ์ด/datetimes.py
[ ] ํฌ๋/์ฝ์ด/๋ฐฐ์ด/integer.py
[ ] ํฌ๋/์ฝ์ด/๋ฐฐ์ด/period.py
[ ] pandas/core/computation/pytables.py
[ ] ํฌ๋/์ฝ์ด/config_init.py
[ ] ํฌ๋/์ฝ์ด/frame.py
[ ] ํฌ๋/์ฝ์ด/generic.py
[ ] pandas/core/groupby/generic.py
[ ] ํฌ๋/์ฝ์ด/๊ทธ๋ฃน๋น/๊ทธ๋ฃน๋น.py
[ ] ํฌ๋/์ฝ์ด/์ธ๋ฑ์ค/base.py
[ ] ํฌ๋/์ฝ์ด/์ธ๋ฑ์ค/multi.py
[ ] ํฌ๋/์ฝ์ด/์ธ๋ฑ์ค/range.py
[ ] ํฌ๋/์ฝ์ด/์ต์ค/docstrings.py
[ ] pandas/core/ops/__init__.py
[ ] pandas/core/reshape/merge.py
[ ] pandas/core/tools/datetimes.py
[ ] ํฌ๋/io/formats/css.py
[ ] ํฌ๋/io/formats/excel.py
[ ] ํฌ๋/io/formats/format.py
[ ] ํฌ๋/io/formats/html.py
[ ] ํฌ๋/io/formats/info.py
[ ] ํฌ๋/io/formats/latex.py
[ ] ํฌ๋/io/formats/printing.py
[ ] ํฌ๋/io/formats/style.py
[ ] ํฌ๋/io/parsers.py
[ ] ํฌ๋/io/pytables.py
[ ] ํฌ๋/io/sas/sas_xport.py
[ ] ํฌ๋/io/stata.py
[ ] ํฌ๋/_libs/tslibs/c_timestamp.pyx
[ ] ํฌ๋/_libs/tslibs/frequency.pyx
[ ] ํฌ๋/_libs/tslibs/parsing.pyx
[ ] ํฌ๋/_libs/tslibs/period.pyx
[ ] ํฌ๋/_libs/tslibs/strptime.pyx
[ ] ํฌ๋/_libs/tslibs/timedeltas.pyx
[ ] ํฌ๋/ํ๋กํ /_matplotlib/converter.py
[ ] ํฌ๋/ํ ์คํธ/๋ฐฐ์ด/์นดํ ๊ณ ๋ฆฌ/test_operators.py
[ ] ํฌ๋/ํ ์คํธ/๋ฐฐ์ด/test_datetimelike.py
[ ] ํฌ๋/ํ ์คํธ/dtypes/test_dtypes.py
[ ] ํฌ๋/ํ ์คํธ/ํ์ฅ/๋ฒ ์ด์ค/setitem.py
[ ] ํฌ๋/tests/frame/test_constructors.py
[ ] ํฌ๋/ํ ์คํธ/ํ๋ ์/test_missing.py
[ ] ํฌ๋/ํ ์คํธ/ํ๋ ์/test_to_csv.py
[ ] pandas/tests/groupby/aggregate/test_other.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ค/datetimes/test_date_range.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ค/datetimes/test_datetime.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ค/datetimes/test_formats.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ค/datetimes/test_partial_slicing.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ค/๊ฐ๊ฒฉ/test_constructors.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ค/๊ฐ๊ฒฉ/ํ ์คํธ_๊ฐ๊ฒฉ.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ค/๋ฉํฐ/ํ ์คํธ_ํฌ๋งท.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ค/๊ธฐ๊ฐ/test_formats.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ค/test_base.py
[ ] pandas/tests/indexes/timedeltas/test_timedelta.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ฑ/test_categorical.py
[ ] ํฌ๋/ํ ์คํธ/์ธ๋ฑ์ฑ/test_coercion.py
[ ] ํฌ๋/ํ ์คํธ/io/excel/test_openpyxl.py
[ ] ํฌ๋/ํ ์คํธ/io/excel/test_writers.py
[ ] ํฌ๋/ํ ์คํธ/io/formats/test_format.py
[ ] ํฌ๋/ํ ์คํธ/io/formats/test_printing.py
[ ] ํฌ๋/ํ ์คํธ/io/formats/test_style.py
[ ] ํฌ๋/ํ ์คํธ/io/formats/test_to_csv.py
[ ] ํฌ๋/tests/io/formats/test_to_html.py
[ ] ํฌ๋/tests/io/formats/test_to_latex.py
[ ] ํฌ๋/ํ ์คํธ/io/parser/test_compression.py
[ ] ํฌ๋/ํ ์คํธ/io/parser/test_encoding.py
[ ] ํฌ๋/ํ ์คํธ/io/parser/test_header.py
[ ] ํฌ๋/ํ ์คํธ/io/parser/test_parse_dates.py
[ ] ํฌ๋/ํ ์คํธ/io/parser/test_usecols.py
[ ] ํฌ๋/ํ ์คํธ/io/test_html.py
[ ] ํฌ๋/ํ ์คํธ/io/test_sql.py
[ ] ํฌ๋/ํ ์คํธ/io/test_stata.py
[ ] ํฌ๋/ํ ์คํธ/๊ฐ์/test_reductions.py
[ ] ํฌ๋/tests/reshape/test_concat.py
[ ] pandas/tests/reshape/test_melt.py
[ ] ํฌ๋/ํ ์คํธ/์ค์นผ๋ผ/๊ธฐ๊ฐ/test_period.py
[ ] pandas/tests/scalar/timedelta/test_timedelta.py
[ ] ํฌ๋/ํ ์คํธ/์ค์นผ๋ผ/ํ์์คํฌํ/test_constructors.py
[ ] ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/์ธ๋ฑ์ฑ/test_numeric.py
[ ] ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/์ธ๋ฑ์ฑ/test_take.py
[ ] ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/์ธ๋ฑ์ฑ/test_where.py
[ ] ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/๋ฉ์๋/test_rename.py
[ ] ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/test_api.py
[ ] ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/test_constructors.py
[ ] ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/test_datetime_values.py
[ ] ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/test_repr.py
[ ] ํฌ๋/ํ ์คํธ/test_strings.py
[ ] ํฌ๋/ํ ์คํธ/๋๊ตฌ/test_to_datetime.py
[ ] ํฌ๋/ํ ์คํธ/tseries/holiday/test_calendar.py
[ ] pandas/tests/tseries/holiday/test_holiday.py
[ ] ํฌ๋/ํ ์คํธ/tslibs/test_parsing.py
[ ] ํฌ๋/ํ ์คํธ/์ ํธ/ํ ์คํธ_assert_frame_equal.py
[ ] ํฌ๋/tseries/frequencies.py
[ ] ํฌ๋/util/_decorators.py
[ ] ํฌ๋/์ ํธ/_test_decorators.py
[ ] ํฌ๋/์ ํธ/_validators.py
[ ] ํฌ๋/_version.py
ํ์ผ์ด ์ง์์ ์ผ๋ก ์ด๋/์ด๋ฆ ๋ณ๊ฒฝ๋จ์ ๋ฐ๋ผ ๋ชฉ๋ก์ด ๋ณ๊ฒฝ๋ ์ ์์ต๋๋ค.
์ด PR ์์ ์์๋ ํ์ผ ๋ฐ ๋ช ๋ น.
๋ด๊ฐ ์ฑ๊ธธ๊ฑฐ๋ค:
[x] ํฌ๋/_libs/groupby.pyx
[x] ํฌ๋/_libs/hashing.pyx
[x] ํฌ๋/_libs/index.pyx
[x] ํฌ๋/_libs/internals.pyx
[x] ํฌ๋/_libs/interval.pyx
[x] ํฌ๋/_libs/lib.pyx
[x] ํฌ๋/_libs/ops.pyx
[x] ํฌ๋/_libs/parsers.pyx
[x] ํฌ๋/_libs/reduction.pyx
[x] ํฌ๋/_libs/sparse.pyx
[x] ํฌ๋/_libs/testing.pyx
[x] ํฌ๋/_libs/tslib.pyx
[x] ํฌ๋/_libs/window.pyx
๋ด๊ฐ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
์์ํ๋ ค๋ฉด ๊ด์ฐฎ์ต๋๋ค!
์๋ ํ์ธ์ @MomIsBestFriend ์ด ๋ณํ์ ์ํ ๋๊ตฌ๋ฅผ ์ถ์ฒํ ์ ์์ต๋๊น? ๋น ๋ฅธ ๋ณด๊ธฐ๋ ๋ค์๊ณผ ๊ฐ์ ์ ๋ณด๋ฅผ ์ ๊ณตํ์ต๋๋ค.
๋๋ ๊ทธ๋ค ์ค ํ๋์ ๋ํ ๊ฒฝํ์ด ์์ง๋ง ์ฌ๊ธฐ์ ๋งค์ฐ ๋์์ด ๋ ์ ์์ต๋๋ค.
@SaturnFromTitan๋ , ์ ๋ ๊ฐ์ธ์ ์ผ๋ก ๊ฐ๋ pyupgrade๋ฅผ ์ฌ์ฉํ์ง๋ง ํ์ผ์ ๋ช ๊ฐ์ง ์ค๋๋ ๋ฌธ์์ด ํ์๋ง ํฌํจ๋์ด ์๋ ๊ฒฝ์ฐ์๋ง ์ฌ์ฉํฉ๋๋ค. ๊ทธ๋ฐ ๋ค์ ๋ณ๊ฒฝ ์ฌํญ์ ์ดํด๋ณด๊ณ pyupgrade์ ๋ฌธ์ ๊ฐ ์์ผ๋ฉด ์์ ํฉ๋๋ค.
ํ์ผ์ด ๋ง์ด ๋ฐ์ํ๋ ํ์ผ์ผ ๋ "๋ณต์กํ" ํ์ผ์ ์๋์ผ๋ก ์ฐพ์(์: '%.2f' % my_float
) ์ผ๋ฐ์ ์ธ ํ์ผ์ ์ฒ๋ฆฌํ๋๋ก ํ๋ฉด ์ผ๋ฐ์ ์ผ๋ก ์ ๋๋ก ๋ฉ๋๋ค.
๋ํ ์ผ๋ถ ๋ณ๊ฒฝ ์ฌํญ์ผ๋ก ์ธํด ๋ณ๊ฒฝ๋ ํ์ผ์ด pep8๊ณผ ํธํ๋์ง ์์ผ๋ฏ๋ก ์ด๋ฅผ ์์ ํด์ผ ํฉ๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ํ ์คํธ๋ฅผ ํต๊ณผํ์ง ๋ชปํฉ๋๋ค.
๋ค์์ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
[x] pandas/compat/__init__.py
[x] pandas/compat/numpy/function.py
[x] pandas/compat/numpy/__init__.py
[x] pandas/compat/_optional.py
๋ด๊ฐ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
์ด๊ฒ์ good first issue
๋ก ํ๊ทธํ๋ ๊ฒ์ ๋ํ ๋ชจ๋ ์ฌ๋๋ค์ ์๊ฐ์ ๋ฌด์์
๋๊น? ์ฌ๊ธฐ์ ์๋ ๋๋ถ๋ถ์ ํ์ผ์ ์ ์ฉํด์ผ ํฉ๋๋ค. ๋ณ๊ฒฝํด์ผ ํ๋ ๋ณ๊ฒฝ์ ์ผ๋ฐ์ ์ผ๋ก ํ์ผ๋น ๋ช ์ค ์ ๋์ด๋ฉฐ ๋ณ๊ฒฝ์ ์ํํ๋ ์ฌ๋์ ์ฝ๋์ ๋ค๋ฅธ ๋ถ๋ถ์ ์ํฅ์ ๋ฏธ์น๋ ๊ฒ์ ๋ํด ๋๋ฌด ๊ฑฑ์ ํ ํ์๊ฐ ์์ต๋๋ค(์ํ๋๋ ์ต์ข
๊ธฐ๋ฅ์ด ๋์ผํ๊ธฐ ๋๋ฌธ์).
#28926๊ณผ ์ ์ฌํ ์ค์ ์ ์์ํ๊ณ ์์ต๋๋ค.
f-๋ฌธ์์ด ๊ต์ฒด ์์น:
์ฐธ์กฐ #29701
๋ค์์ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
[x] ํฌ๋/_libs/tslibs/conversion.pyx
[x] ํฌ๋/_libs/tslibs/c_timestamp.pyx
[x] ํฌ๋/_libs/tslibs/fields.pyx
[x] ํฌ๋/_libs/tslibs/nattype.pyx
[x] ํฌ๋/_libs/tslibs/np_datetime.pyx
[x] ํฌ๋/_libs/tslibs/offsets.pyx
[x] ํฌ๋/_libs/tslibs/parsing.pyx
[x] ํฌ๋/_libs/tslibs/timestamps.pyx
[x] ํฌ๋/_libs/tslibs/timezones.pyx
[x] ํฌ๋/_libs/tslibs/tzconversion.pyx
๋ด๊ฐ ๊ฑธ๋ฆด๊ฑฐ์ผ
์ฐธ์กฐ #29781
๋ด๊ฐ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
- [x] pandas/core/reshape/concat.py
- [x] pandas/core/reshape/melt.py
- [ ] pandas/core/reshape/merge.py
- [x] pandas/core/reshape/pivot.py
- [x] ํฌ๋/์ฝ์ด/reshape/reshape.py
- [ ] pandas/core/reshape/tile.py
์ด๊ฒ์
good first issue
๋ก ํ๊ทธํ๋ ๊ฒ์ ๋ํ ๋ชจ๋ ์ฌ๋๋ค์ ์๊ฐ์ ๋ฌด์์ ๋๊น? ์ฌ๊ธฐ์ ์๋ ๋๋ถ๋ถ์ ํ์ผ์ ์ ์ฉํด์ผ ํฉ๋๋ค. ๋ณ๊ฒฝํด์ผ ํ๋ ๋ณ๊ฒฝ์ ์ผ๋ฐ์ ์ผ๋ก ํ์ผ๋น ๋ช ์ค ์ ๋์ด๋ฉฐ ๋ณ๊ฒฝ์ ์ํํ๋ ์ฌ๋์ ์ฝ๋์ ๋ค๋ฅธ ๋ถ๋ถ์ ์ํฅ์ ๋ฏธ์น๋ ๊ฒ์ ๋ํด ๋๋ฌด ๊ฑฑ์ ํ ํ์๊ฐ ์์ต๋๋ค(์ํ๋๋ ์ต์ข ๊ธฐ๋ฅ์ด ๋์ผํ๊ธฐ ๋๋ฌธ์).#28926๊ณผ ์ ์ฌํ ์ค์ ์ ์์ํ๊ณ ์์ต๋๋ค.
๋ฌผ๋ก ๊ทธ์ ๋ฐ๋ผ ๋ ์ด๋ธ์ด ์ง์ ๋์์ต๋๋ค. ๊ฐ์ฌ ํด์
๋ค์ ๋ณต์ฉ:
[x] ํฌ๋ / io / msgpack / _packer.pyx
[x] ํฌ๋ / io / msgpack / _unpacker.pyx
[x] ํฌ๋ / io / sas / sas.pyx
์ฃ์กํฉ๋๋ค. ์์ ํ ํ์ผ์ ์ง์ ํ๋๋ก ์์ฒญํ์ ๊ฒ์ ๋ฐฉ๊ธ ํ์ธํ์ต๋๋ค. ๋๋ ๋ฐฉ๊ธ ์ฌ์ฉํ๊ณ ์๋ค
grep -n -R -e '%s' -e '%d' -e '.format(' --include=*.{py,pyx} ํฌ๋/
์ค๋๋ ํ์์ ์ฐพ์ผ๋ ค๋ฉด. ์ฌ๊ณผํ๋ค
์ฃ์กํฉ๋๋ค. ์์ ํ ํ์ผ์ ์ง์ ํ๋๋ก ์์ฒญํ์ ๊ฒ์ ๋ฐฉ๊ธ ํ์ธํ์ต๋๋ค. ๋๋ ๋ฐฉ๊ธ ์ฌ์ฉํ๊ณ ์๋ค
@ForTimeBeing ๊ทธ๋์ ์ ๊ฐ ํฌ์คํธ๋ฅผ ์์ ํ์ต๋๋ค.
์์ ํ ๊ฒ์ ๊ฒ์ํ ์ ์์ต๋๊น? ๋๊ตฐ๊ฐ๊ฐ ๋๊ธ์ ๊ฒ์ํ๋ ๊ฒฝ์ฐ๋ฅผ ๋๋นํ์ฌ.
๋ฌผ๋ก ์ ๋๋ค.
๊ทธ๋ฆฌ๊ณ ์๋
.format์ ์ฌ์ ํ โโ์กด์ฌํ๊ณ grep ๊ฒ์์ ํ์๋์ง๋ง fstring์ผ๋ก ๋ณ๊ฒฝํ ๋ฆฌํฐ๋ด์ ์์ต๋๋ค. ๊ทธ๊ฒ์ ์ํํ๊ฑฐ๋ ๊ทธ๋๋ก ์ ์งํ๋ ๋ค๋ฅธ ๋ฐฉ๋ฒ์ด ์๋์ง ํ์คํ์ง ์์ง๋ง ๋ชจ๋ ๋ฆฌํฐ๋ด์ ์ด์ ํด๋น ํ์ผ์์ fstring์ผ๋ก ์ค์๋ฉ๋๋ค.
.format์ ์ฌ์ ํ โโ์กด์ฌํ๊ณ grep ๊ฒ์์ ํ์๋์ง๋ง fstring์ผ๋ก ๋ณ๊ฒฝํ ๋ฆฌํฐ๋ด์ ์์ต๋๋ค. ๊ทธ๊ฒ์ ์ํํ๊ฑฐ๋ ๊ทธ๋๋ก ์ ์งํ๋ ๋ค๋ฅธ ๋ฐฉ๋ฒ์ด ์๋์ง ํ์คํ์ง ์์ง๋ง ๋ชจ๋ ๋ฆฌํฐ๋ด์ ์ด์ ํด๋น ํ์ผ์์ fstring์ผ๋ก ์ค์๋ฉ๋๋ค.
@ForTimeBeing
์๋ฌด ๋ฌธ์ ์์ต๋๋ค:)
ํ๋ณด ๊ฐ์ฌํฉ๋๋ค :)
๋ด๊ฐ ๊ฐ์ ธ
์ฐธ์กฐ #29952
๋ด๊ฐ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
[x] ci/print_skip.py
[x] ๋ฌธ์/make.py
[x] ๋ฌธ์/sphinxext/announce.py
[x] ๋ฌธ์/sphinxext/contributors.py
์์ ์ค: 'pandas/core/dtypes/dtypes.py'
๊ฐ์ง๊ณ ๊ฐ๋ค:
์ฐธ์กฐ: #30116, #30135, #30363
๋ด๊ฐ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
๋ฏธ๋ฆฌ ์ ์๋ ๋ฌธ์์ด์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ํด๊ฒฐ์ฑ
์ ์ฐพ์์ง๋ง ์ฌ๋ฐ๋ฅธ ๊ฒ์ธ์ง ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
๋ค์๊ณผ ๊ฐ์ด ๋ฏธ๋ฆฌ ์ ์๋ ๋ฌธ์์ด์ด ์๋ ์ํฉ์ ์์ํด ๋ณด์ญ์์ค.
THE_MESSAGE = "์ธ์๊ฐ ์๋ ๋ฉ์์ง. Arg1: {arg1}, Arg2: {arg2}."
๋ค์๊ณผ ๊ฐ์ด .format() ์ผ๋ก ํธ์ถ๋ฉ๋๋ค.
THE_MESSAGE.format(arg1_str, arg2_str).
์๋์ ์ค๋ช
๋ ๋ฐฉ์์ผ๋ก ๋๋ค ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์ด๊ฒ์ ๋ค์ ์์ฑํ ์ ์์ต๋๊น?
THE_MESSAGE = ๋๋ค arg1, arg2: f"์ธ์๊ฐ ์๋ ๋ฉ์์ง์
๋๋ค. Arg1: {arg1}, Arg2: {arg2}."
๊ทธ๋ฆฌ๊ณ ๊ทธ๊ฒ์ ํธ์ถ
THE_MESSAGE(arg1_str, arg2_str)?
๋๋ ๊ทธ๊ฒ์ด์ด ๋ฌธ์ ์ ์ ๊ทผํ๋ ๊ฐ์ฅ ์ข์ ๋ฐฉ๋ฒ์ธ์ง ํ์คํ์ง ์์ต๋๋ค.
๋ฏธ๋ฆฌ ์ ์๋ ๋ฌธ์์ด์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
๋๋ ์์ ํ ์ดํดํฉ๋๋ค. pep 498์ ๋ค์๊ณผ ๊ฐ์ด ์ค๋ช ํฉ๋๋ค.
์ผ๋ฐ ๋ฌธ์์ด์ ์ปดํ์ผ ์๊ฐ์ ์ฐ๊ฒฐ๋๊ณ f-๋ฌธ์์ด์ ๋ฐํ์์ ์ฐ๊ฒฐ๋ฉ๋๋ค.
.format()
์ ์ฌ์ฉ์ ์ ๊ฑฐํ๊ณ ๋ค๋ฅธ ๋ฌธ์์ด ํ
ํ๋ฆฟ์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ์๊ฐํด์ผ ํฉ๋๋ค.
ํ์ฌ ๋ด๊ฐ ์๊ฐํ ์ ์๋ ๊ฒ์ stdlib์ string.Template
๋ฟ์ด์ง๋ง ์ค์ ๋ก๋ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
@jbrockmendel ๋์์ฃผ์ค ์ ์๋์?
@MomIsBestFriend ๋๋ค ํจ์๊ฐ ์ด๊ฒ์ ๋ํด ๊ณผ๋ํ๋ค๊ณ ์๊ฐํ์ญ๋๊น?
@MomIsBestFriend .format
๋ช ๊ฐ๋ก ์ฌ๋ ๊ฒ์ด
@MomIsBestFriend ๋๋ค ํจ์๊ฐ ์ด๊ฒ์ ๋ํด ๊ณผ๋ํ๋ค๊ณ ์๊ฐํ์ญ๋๊น?
๋๋ ์ ๋ฌธ๊ฐ์ ๊ฐ๊น์ง ์์ต๋๋ค. ๊ฐ๋ฐ์ ์ค ํ ๋ช ์๊ฒ ๋ฌธ์ํ์ญ์์ค.
๊ฐ์ง๊ณ ๊ฐ๋ค
์ฐธ์กฐ #30120
๊ฐ์ง๊ณ ๊ฐ๋ค
์ฐธ์กฐ #30121
๊ฐ์ง๊ณ ๊ฐ๋ค
์ฐธ์กฐ #30124
๋ด๊ฐ ๊ฑธ๋ฆด๊ฑฐ์ผ
ํธ์งํ๋ค:
์ทจ๋:
[x] pandas/util/_depr_module.py
[x] ํฌ๋/์ ํธ/_doctools.py
[x] pandas/util/_print_versions.py
[x] pandas/util/_test_decorators.py
[x] pandas/util/_tester.py
[x] ํฌ๋/์ ํธ/testing.py
[x] pandas/util/_validators.py
๋ด๊ฐ ๊ฑธ๋ฆด๊ฑฐ์ผ
๊ฐ์ฌ ํด์!
๋ด๊ฐ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
ํฌ๋/ํ ์คํธ/ํ๋กํ /test_converter.py
ํฌ๋/ํ ์คํธ/ํ๋กํ /test_datetimelike.py
ํฌ๋/ํ ์คํธ/ํ๋กํ /test_series.py
๋ด๊ฐ ๊ฑธ๋ฆด๊ฑฐ์ผ
์๋ ํ์ธ์, @MomIsBestFriend
ํฌ๋/ํ ์คํธ/ํ๋กํ /test_converter.py
ํฌ๋/ํ ์คํธ/ํ๋กํ /test_datetimelike.py
ํฌ๋/ํ ์คํธ/ํ๋กํ /test_series.py
์๋ฃ๋์์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค.
์๋
ํ์ญ๋๊น
๋ด๊ฐ ๊ฐ์ง ์์๋ค
๊ฐ์ฌ ํด์
์๋ , ๋ด๊ฐ ๊ฐ์ ธ๊ฐ๊ฒ
๊ฐ์ฌ ํด์!
๋๋ ๊ฐ์ง๊ณ ๊ฐ๋ค:
pandas/core/missing.py
pandas/core/nanops.py
pandas/tests/indexes/datetimes/test_partial_slicing.py
๋ด ํ๋ณด ๋งํฌ: https://github.com/pandas-dev/pandas/pull/30278
๋๋ ์ผํ ๊ฒ์ด๋ค:
์ฌ๊ธฐ '์ข์ ์ฒซ ๋ฐํ'์ด๋ผ๋ ํ๊ทธ ๋๋ฌธ์
๋ด๊ฐ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
[ ] ํฌ๋/io/sql.py
[ ] ํฌ๋/io/stata.py
๊ฐ์ฌ ํด์!
๋ด๊ฐ ํ ๊ฑฐ์ผ:
๋๋ ์ทจํ๊ณ ์ถ๋ค
๋๋ ์ง๊ธ ๊ทธ๊ฒ์ ๋ํ ํ ๋ฆฌํ์คํธ๋ฅผ ํ๋ค
์ข์, ํญ์ Pandas์ ์นฉ์ ๋ฃ๊ณ ์ถ์์ต๋๋ค. ์์ผ๋ก ๋ช ์ฃผ ์์ ๋ฌด์์ ํ ์ ์๋์ง ์๊ฒ ๋๋ฉด ์ ๋ฐ์ดํธํ๊ฒ ์ต๋๋ค...
๋ด๊ฐ ๊ฐ์ง ์์๋ค
ํฌ๋/_version.py
์ ํ:
pandas/io/formats/csvs.py๋ฅผ ์ฌ์ฉํ๊ฒ ์ต๋๋ค.
๋ด๊ฐ ์ฑ๊ธธ๊ฑฐ๋ค:
์ง๋ฌธ: API ์ฐธ์กฐ์ ๊ตฌ์ ๋ฌธ์์ด ํ์์ ์ ์งํด์ผ ํ๋์ง ์ฌ๋ถ์ ๋ํ ๋ต๋ณ์ด ์์ต๋๊น?
์๋ฅผ ๋ค์ด series.map()
:
It also accepts a function:
>>> s.map('I am a {}'.format)
0 I am a cat
1 I am a dog
2 I am a nan
3 I am a rabbit
dtype: object
์ด๊ฒ์ f-string ์์ ๋ก ๋ฐ๊พธ๋ฉด ๋ค์๊ณผ ๊ฐ์ด ๋ฉ๋๋ค.
>>> s.map(lambda x: f'I am a {x}')
0 I am a cat
1 I am a dog
2 I am a nan
3 I am a rabbit
dtype: object
์ด๊ฒ์ ์ ํํ ๋์ฒด๊ฐ ์๋๋๋ค(f-๋ฌธ์์ด์ ํจ์๊ฐ ์๋๋๋ค. ๋๋ค๋ฅผ ์ฌ์ฉํ์ฌ 'I am a '.format() )์ ์ ํจ๊ณผ๋ฅผ ๋ณต์ ํ๋ ํจ์๋ก ๋ง๋ค๊ณ ์์ต๋๋ค. ๋ฌธ์์ ์ผ๋ถ ๋น ๋ชจ๋ฒ ์ฌ๋ก.
ํ์ฌ๋ก์๋ ์ด์ ๊ฐ์ ์ฌ๋ก๋ฅผ ์ฒ๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์ปค๋ฎค๋ํฐ์ ๊ฒฐ์ ์ด ์์ ๋๊น์ง ๋ฌธ์๋ฅผ ๋ฒ์๋ฅผ ๋ฒ์ด๋๋ ๊ฒ์ผ๋ก ๋ณ๊ฒฝํ๋ ๊ฒ์ ๊ณ ๋ คํ๊ณ ์์ต๋๋ค.
์ด๋ฏธ ์๋ฃ(๋๊ตฌ์ธ์ง ํ์คํ์ง ์์):
ํฌ๋/ํ
์คํธ/๋ฐฐ์ด/๊ฐ๊ฒฉ/test_ops.py
๋๋ ๋ฐ๋ ค๊ฐ๊ฒ
์ง๋ฌธ: API ์ฐธ์กฐ์ ๊ตฌ์ ๋ฌธ์์ด ํ์์ ์ ์งํด์ผ ํ๋์ง ์ฌ๋ถ์ ๋ํ ๋ต๋ณ์ด ์์ต๋๊น?
cc @WillAyd @jreback
๋๋ ๋น์ ์ด "๊ตฌ์ ๋ฌธ์์ด ํ์"์ ๋ฌด์์ด๋ผ๊ณ ์๊ฐํ๋์ง ๋ชจ๋ฅด์ง๋ง .format
์๋ f-๋ฌธ์์ด์ด ๋ค๋ฃจ์ง ์๋ ์ผ๋ถ ์ฌ์ฉ ์ฌ๋ก(์ฆ, ์ง์ฐ๋ ๋งค๊ฐ๋ณ์ํ)๊ฐ ์์ผ๋ฏ๋ก ์ฌ์ ํ ์ฃผ๋ณ์ ์์ ๊ฒ์
๋๋ค. . ๊ทธ๋๋ Py27 ๋ฌธ์์ด ํ์ ๊ตฌ๋ฌธ์ด ์์ด์ผ ํ๋ค๊ณ ์๊ฐํ์ง ์์ต๋๋ค.
๋ด๊ฐ ๊ฐ์ ธ๊ฐ๊ฒ:
๋ด๊ฐ ๊ฑธ๋ฆด๊ฑฐ์ผ
#30601์์ ๋ด๊ฐ ๋งก์์ด
๊ด์ฐฎ์ผ์๋ค๋ฉด ์๋ ๋ ํ์ผ์ ๊ฐ์ ธ์์ ์์ํ๊ฒ ์ต๋๋ค!
์ด๋ฌํ ๋ณ๊ฒฝ ์ฌํญ์ #30604์์ ์ํ๋์์ต๋๋ค.
๋ณต์ฉ:
PR์์ ๊ทธ๋๋ก ๋จ์ ์๋ .format
์ ์ด์ ์๋๋ ์ฉ๋๋ฅผ ๊ธฐ๋กํ๋ ์ ํธํ๋ ๋ฐฉ๋ฒ์ด ์์ต๋๊น? ์ด๋ค ๊ฒ์ด ์ข์ ์ฌ์ฉ ์ฌ๋ก๋ผ๊ณ (์๋ชป) ๊ฐ์ ํ๊ณ PR์์ ๊ฐ๊ณผํ๋ ๊ฒฝ์ฐ
์์
๋ด๊ฐ ๊ฑธ๋ฆด๊ฑฐ์ผ
๋๋ ์๋ํ๊ณ ์ถ์ต๋๋ค:
๋๋ ๊ฐ์ง๊ณ ์ถ๋ค:
@HH-MWB ๊ฐ์ฌํฉ๋๋ค
๋๋ ๊ฑธ๋ฆด ๊ฒ์ด๋ค:
๋๋ ์ฝ๋๋ฅผ ๋ง์ด ๋ฐ๊ฒฌ @Appender()
์ฌ์ฉํ๋ %
ํ์ ๋ฌธ์์ด์. ํด๋น ์ฝ๋๋ _shared_docs
๋ฅผ ํ
ํ๋ฆฟ์ผ๋ก ์ฌ์ฉํ๊ณ ์์ผ๋ฉฐ ๋๋ถ๋ถ /pandas/core/generic.py์ ์ ์๋์ด ์์ผ๋ฉฐ ์ฌ๋ฌ ํ์ผ์ ๊ต์ฐจํ์ฌ ์ฌ์ฉ๋ฉ๋๋ค.
๋ชจ๋ _shared_docs
๊ด๋ จ ์์์ ๋ฐ๊พธ๊ณ ์ถ์ต๋๋ค. ์ด ๋ณ๊ฒฝ ์ฌํญ์ ๋ง์ ํ์ผ์ ์์ ํด์ผ ํ์ง๋ง ํด๋น ํ์ผ์์ ๋ค๋ฅธ ๋ชจ๋ ๋ฌธ์์ด ํ์ ์ง์ ๊ตฌ๋ฌธ์ ํ์ธํ ์๋ ์์ต๋๋ค.
์ข์ ์๋ฆฌ์ ๋๊น? ๋ด๊ฐํด์ผํฉ๋๊น? Replying to @kangminaaaaaa
๋๋ ์ฝ๋๋ฅผ ๋ง์ด ๋ฐ๊ฒฌ
@Appender()
์ฌ์ฉํ๋%
ํ์ ๋ฌธ์์ด์. ํด๋น ์ฝ๋๋_shared_docs
๋ฅผ ํ ํ๋ฆฟ์ผ๋ก ์ฌ์ฉํ๊ณ ์์ผ๋ฉฐ ๋๋ถ๋ถ /pandas/core/generic.py์ ์ ์๋์ด ์์ผ๋ฉฐ ์ฌ๋ฌ ํ์ผ์ ๊ต์ฐจํ์ฌ ์ฌ์ฉ๋ฉ๋๋ค.๋ชจ๋
_shared_docs
๊ด๋ จ ์์์ ๋ฐ๊พธ๊ณ ์ถ์ต๋๋ค. ์ด ๋ณ๊ฒฝ ์ฌํญ์ ๋ง์ ํ์ผ์ ์์ ํด์ผ ํ์ง๋ง ํด๋น ํ์ผ์์ ๋ค๋ฅธ ๋ชจ๋ ๋ฌธ์์ด ํ์ ์ง์ ๊ตฌ๋ฌธ์ ํ์ธํ ์๋ ์์ต๋๋ค.์ข์ ์๋ฆฌ์ ๋๊น? ๋ด๊ฐํด์ผํฉ๋๊น? Replying to
@HH-MWB ๋๋ ์ด๊ฒ์ ๋ํด ์ ๋ง๋ก ๋งํ ์ ์์ต๋๋ค. ์ ์๊ฐ์๋ jreback๊ณผ WillAyd ๋ฐ datapythonista(๊ทธ๋ค์ ๊ท์ฐฎ๊ฒ ํ๊ณ ์ถ์ง ์๊ธฐ ๋๋ฌธ์ ํ๊ทธ๋ฅผ ์ง์ ํ์ง ์์)๊ฐ ์ ๊ฐ ํ ์ ์๋ ๊ฒ๋ณด๋ค ๋น์ ์ ๋ ๋ง์ด ๋์ธ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค :)
Appender๋ก ๋์ฒดํ๋ ค๋ ๊ฒ์ ๋ฌด์์ ๋๊น? ๋๋ f-๋ฌธ์์ด์ด ๋ ์ ์๋ค๊ณ ์๊ฐํ๋ค
.format์ด Py27 ๊ตฌ๋ฌธ์ ๋์ฒดํ๋ฉด ๊ด์ฐฎ์ง๋ง ๋ ผ์ํ ๋ณ๋์ ๋ฌธ์ ๋ฅผ ์ด์ด๋ณผ ๊ฐ์น๊ฐ ์์ ๊ฒ์ ๋๋ค.
Appender๋ก ๋์ฒดํ๋ ค๋ ๊ฒ์ ๋ฌด์์ ๋๊น? ๋๋ f-๋ฌธ์์ด์ด ๋ ์ ์๋ค๊ณ ์๊ฐํ๋ค
.format์ด Py27 ๊ตฌ๋ฌธ์ ๋์ฒดํ๋ฉด ๊ด์ฐฎ์ง๋ง ๋ ผ์ํ ๋ณ๋์ ๋ฌธ์ ๋ฅผ ์ด์ด๋ณผ ๊ฐ์น๊ฐ ์์ ๊ฒ์ ๋๋ค.
@WillAyd stdlib์ string.Template
๊ฐ ์ด์ ๋ํ ์ฌ๋ฐ๋ฅธ ๋ฐฉ๋ฒ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค.
์ด๊ฒฌ์๋ ์ฌ๋?
์๋
ํ์ธ์ @WillAyd , ๋ช
ํํ ํ์ง ๋ชปํด ์ฃ์กํฉ๋๋ค. ์, ์๋ ์์ด๋์ด๋ %
๋ฅผ .format
๋ฐ๊พธ๊ณ %(XXX)s
์ ๊ฐ์ ์ฝ๋๋ฅผ _shared_docs
ํ
ํ๋ฆฟ์์ {XXX}
๋ก ๋ฐ๊พธ๋ ๊ฒ์ด์์ต๋๋ค. @MomIsBestFriend๊ฐ ๋งํ๋ฏ์ด string.Template
๋ ๋ ๋ค๋ฅธ ์ ํ์ด ๋ ๊ฒ์
๋๋ค.
๋ ๋ง์ ํ ๋ก ์ ์ํด ๋ณ๋์ ๋ฌธ์ ๋ฅผ ์ด์์ต๋๋ค. ๊ฐ์ฌ ํด์!
๋ณต์ฉ:
์ฐธ์กฐ #31412
@MomIsBestFriend ์๋
ํ์ธ์! ์ฒ์์ผ๋ก ์คํ ์์ค ๊ธฐ์ฌ์์
๋๋ค! ์ฒซ PR์ด ๋๋ฌด ๊ธฐ๋๋ฉ๋๋ค! ๋ค์ ํ์ผ ์์
์ ์๋ํฉ๋๋ค.
versioneer.py
web/pandas_web.py
๊ฐ์ฌ ํด์!!
@drewseibert versioneer.py๋ @MomIsBestFriend ์ด ํผ๋์ ํผํ๊ธฐ ์ํด ๋ชฉ๋ก์์ ์ด๊ฒ์ ์ ๊ฑฐํ ์ ์์ต๋๊น?
@jbrockmendel ์๋ ค ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ์ด์ ํจ๊ป "web/pandas_web.py"๋ผ๊ณ ์ธ๊ธํ ๋ค๋ฅธ ํ์ผ๋ ์ด๋ฏธ ์์ ํ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค. ๋ ๋ค ์์ ๋ชฉ๋ก์์ ์ ๊ฑฐํ ์ ์์ต๋๋ค.
๋ํ ์ปค๋ฐ์ ํธ์ํ๋ ค๊ณ ํ ๋ 403 ๊ถํ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค. SSH ํค๋ฅผ ์ถ๊ฐํ๊ณ ์๊ฒฉ URL์ ์ค์ ํด ๋ณด์์ต๋๋ค. SSH ๋๋ HTTPS๋ก ๋ณต์ ํ๋์ง ์ฌ๋ถ์ ๊ด๊ณ์์ด ์๋ํ์ง ์์ต๋๋ค. ๋์์ ์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค! ๊ฐ์ฌ ํด์!
@MomIsBestFriend ์๋ ํ์ธ์! ์ฒ์์ผ๋ก ์คํ ์์ค ๊ธฐ์ฌ์์ ๋๋ค! ์ฒซ PR์ด ๋๋ฌด ๊ธฐ๋๋ฉ๋๋ค! ๋ค์ ํ์ผ ์์ ์ ์๋ํฉ๋๋ค.
versioneer.py
web/pandas_web.py
๊ฐ์ฌ ํด์!!
ํ์ด์ ๋น์ด์ @drewseibert
๋ด๊ฐ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
pandas/core/reshape/concat.py
pandas/core/reshape/melt.py
pandas/core/reshape/merge.py
pandas/core/reshape/pivot.py
ํฌ๋/์ฝ์ด/reshape/reshape.py
์ง๊ธ ์์ ์ค:
ํฌ๋/ํ ์คํธ/io/test_pickle.py
์๋
ํ์ธ์
๋ด๊ฐ ๊ฑธ๋ฆด๊ฑฐ์ผ
ํฌ๋/์ ํธ/_print_versions.py
ํฌ๋/util/_test_decorators.py
https://github.com/pandas-dev/pandas/pull/31628 ๊ด์ฐฎ์ ๊ฒ์ ๋๋ค :)
์ ๋ pandas/tests/frame/test_repr_info.py
๋ฐ์ต๋๋ค.
์ด๋ด, ๋ด๊ฐ ๊ฑธ๋ฆด๊ฑฐ์ผ
๋ชฉ๋ก์์ ๋ค์ ํ์ผ์ ํ์ธํ ์ ์์ต๋๋ค ...
web/pandas_web.py
ํฌ๋/ํ
์คํธ/io/test_pickle.py
๊ฐ์ฌ ํด์!
ํ์ธํด์ผ ํ ๋ ๋ค๋ฅธ ๊ฒ. ํ์ผ์ f-๋ฌธ์์ด์ด ํ์ํ์ง ์์ต๋๋ค.
ํฌ๋/ํ
์คํธ/์๋ฆฌ์ฆ/์ธ๋ฑ์ฑ/test_boolean.py
์ด์ ์ด๊ฑธ๋ก ์์ ํ๊ฒ ์ต๋๋ค...
ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/์ธ๋ฑ์ฑ/test_indexing.py
@drewseibert ๊ฐ์ฌํฉ๋๋ค
์์ง ์์ ์ด ๋จ์ ์์ต๋๊น? ๊ธฐ์ฌํ๊ณ ์ถ๋ค
@3vts ๋ฌผ๋ก ์ด์ฃ :)
๊ฐ์ ธ๊ฐ์ค ์ ์์ ๊ฒ ๊ฐ์์
ํฌ๋/tests/util/test_assert_extension_array_equal.py
๋ ์ํ๋ค๋ฉด LMK.
๋ด๊ฐ ๋์ธ ์ ์๋ ์ผ! ๋ด ์ฒซ ์คํ ์์ค ๊ธฐ์ฌ๊ฐ ๋ ๊ฒ์ด๋ฏ๋ก ๋์์ด ํ์ํ ์ ์์ต๋๋ค. ๋๋ ๊ธฐ์ฌ๋ฅผ ๊ธฐ๊ณ ํ๋ ๋ฐฉ๋ฒ์ ์ฝ์์ง๋ง ์ฌ์ ํ.
๋ด๊ฐ ์ฒ๋ฆฌํ๊ธฐ๋ฅผ ์ํ๋ ๊ฒ์ ๋ฌด์์ ๋๊น?
@MomIsBestFriend ๋ pandas/tests/util/test_assert_extension_array_equal.py
๊ฐ PR #30816 ์์ ์์ ๋ ๊ฒ ๊ฐ
@3vts @GrizzledLabs - ์ ๋ชฉ๋ก์์ ์์ง ์๋ฃ๋์ง ์์ ํ์ผ์ ์์ ๋กญ๊ฒ ๊ฐ์ ธ์ค๊ณ (๋ค๋ฅธ ์ฌ๋์ด ์์ ํ๊ณ ์์ง ์์์ง ํ์ธ) - ์์ ์ค์ธ ์์ ์ ๋ํด ์ฌ๊ธฐ์์ ์๊ฒฌ์ ๋งํ์ญ์์ค! ๊ฐ์ฌ ํด์ !
pandas/core/arrays/boolean.py๊ฐ ์ด๋ฏธ ์๋ฃ๋ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค. ๋๋ ๊ทธ๊ฒ์ ๋์น ๊ฒฝ์ฐ๋ฅผ ์ ์ธํ๊ณ ํ๋์ f'string๊ณผ .format()์ ๋ณด์ง ๋ชปํ์ต๋๋ค.
pandas/core/dtypes/common.py๋ ์ด๋ฏธ ์๋ฃ๋ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค. f'๋ฌธ์์ด์ ์์ง๋ง .format() ์์
์ด๋ฌํ ์์ ์ฌํญ ์ค ์ผ๋ถ๋ ์ฌ๋ฌ ํ์ผ์ ๊ฑธ์ณ ์์ต๋๊น? ์ผ๋ถ๋ ๋จ์ผ .format()์ ํฌํจํ์ง ์์ผ๋ฉฐ ํ์ผ ๊ฐ์ ํธ์ถ๋๋ ํจ์๊ฐ ์๋์ง ๊ถ๊ธํฉ๋๋ค. ๋จ์ผ ์์ ์ ์ฌ๋ฌ ํ์ผ์ ๋ณ๊ฒฝํด์ผ ํฉ๋๊น?
์๋
ํ์ธ์, ์ฒ์์ผ๋ก ๊ธฐ์ฌํ ์ฌ๋์
๋๋ค! ์์ํ๊ฒ ๋์ด ๊ธฐ์ฉ๋๋ค!
์ฒ์์ ๋๋ ์ด๊ฒ๋ค์ ์ทจํ๊ณ ์ถ์์ต๋๋ค.
ํฌ๋/compat/pickle_compat.py
ํฌ๋/_config/config.py
ํ์ง๋ง ์๋ฃ๋๊ณ ๋ณํฉ๋ ๊ฒ์ ๋ณด์์ต๋๋ค. @MomIsBestFriend ์๋จ์ ๋ชฉ๋ก์ ์ ๋ฐ์ดํธํ์ฌ ์๋ฃ๋ก ํ์ํ ์ ์์ต๋๊น?
๋๋ ์ด๊ฒ๋ค์ ์ทจํ ๊ฒ์ด๋ค:
[ ] ํฌ๋/ํ ์คํธ/io/parser/test_usecols.py
[ ] ํฌ๋/ํ ์คํธ/io/pytables/conftest.py
[ ] ํฌ๋/ํ ์คํธ/io/pytables/test_store.py
[ ] ํฌ๋/ํ ์คํธ/io/pytables/test_timezones.py
@MomIsBestFriend ์ค๋ ๋๋ฅผ ๊ฒํ ํ๋ ์ค ๋ฏธ๋ฆฌ ์ ์๋ ๋ฌธ์์ด์ ๋ํ ์์ธ๊ฐ ์์์ ๋ฐ๊ฒฌํ์ต๋๋ค. ์ฌ์ ํ ์ ์ฉ๋๋์? ๋๋ ์ฐ๋ฆฌ๋ ์ง๊ธ ๊ฐ์ง๊ณ ์์ต๋๋ค. ํด๊ฒฐ ๋ฐฉ๋ฒ?
๋ฏธ๋ฆฌ ์ ์๋ ๋ฌธ์์ด์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
๋๋ ์์ ํ ์ดํดํฉ๋๋ค. pep 498์ ๋ค์๊ณผ ๊ฐ์ด ์ค๋ช ํฉ๋๋ค.
์ผ๋ฐ ๋ฌธ์์ด์ ์ปดํ์ผ ์๊ฐ์ ์ฐ๊ฒฐ๋๊ณ f-๋ฌธ์์ด์ ๋ฐํ์์ ์ฐ๊ฒฐ๋ฉ๋๋ค.
.format()
์ ์ฌ์ฉ์ ์ ๊ฑฐํ๊ณ ๋ค๋ฅธ ๋ฌธ์์ด ํ ํ๋ฆฟ์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ์๊ฐํด์ผ ํฉ๋๋ค.ํ์ฌ ๋ด๊ฐ ์๊ฐํ ์ ์๋ ๊ฒ์ stdlib์
string.Template
๋ฟ์ด์ง๋ง ์ค์ ๋ก๋ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.@jbrockmendel ๋์์ฃผ์ค ์ ์๋์?
์๋ ํ์ธ์ ๐ . ๋ด๊ฐ ๊ฑธ๋ฆด ๊ฒ์ ๋๋ค:
@monicaw218 , ํ์ผ ํ๋๋ง์ผ๋ก ์์ํ๊ณ ํ ์์ฒญ์ด ๋ณํฉ๋๋ฉด ๋๋จธ์ง๋ฅผ ๊ณ์ํ ์ ์์ต๋๋ค. ์ฒซ ๋ฒ์งธ ๊ธฐ์ฌ๋ ์ผ๋ฐ์ ์ผ๋ก ์์๋ณด๋ค ๊น๋ค๋ก์ฐ๋ฉฐ ์ฐ๋ฆฌ(๊ฒํ ์)์๊ฒ๋ ํ ์์ฒญ์ด ์์ ๊ฒฝ์ฐ์๋ ๋์์ด ๋ฉ๋๋ค. ํนํ ๋ ๋ง์ ํผ๋๋ฐฑ์ด ํ์ํ ์ ์๋ ์ ๊ท ๊ธฐ์ฌ์์๊ฒ ์ ํฉํฉ๋๋ค.
์ด ๋ ํ์ผ์ ๋ชฉ๋ก์์ ํ์ธํ ์ ์์ต๋๋ค.
๐
ํฌ๋/io/parsers.py
ํฌ๋/io/pytables.py
๋ค์๋ ์ข์ต๋๋ค.
ํฌ๋/tests/groupby/test_apply.py
ํฌ๋/tests/groupby/test_bin_groupby.py
#31914์ ์ค๋น๋์ด ์์ต๋๋ค.
"pandas/tests/extension/decimal/test_decimal.py"
"ํ๋ค/ํ
์คํธ/ํ๋ ์/์ธ๋ฑ์ฑ/test_categorical.py"
"ํ๋ค/ํ
์คํธ/ํ๋ ์/๋ฉ์๋/test_describe.py"
"ํฌ๋/ํ
์คํธ/ํ๋ ์/๋ฉ์๋/test_duplicated.py"
"ํ๋ค/ํ
์คํธ/ํ๋ ์/๋ฉ์๋/test_to_dict.py"
"ํ๋ค/ํ
์คํธ/ํ๋ ์/test_alter_axes.py"
"ํฌ๋/ํ
์คํธ/ํ๋ ์/test_api.py"
"ํ๋ค/ํ
์คํธ/ํ๋ ์/test_constructors.py"
"ํ๋ค/ํ
์คํธ/ํ๋ ์/ํ
์คํธ_dtypes.py"
"ํ๋ค/ํ
์คํธ/ํ๋ ์/test_join.py"
"pandas/io/sas/sas_xport.py"๋ฅผ ์ฌ์ฉํ๊ฒ ์ต๋๋ค.
#31933์ ์ค๋น๋์ด ์์ต๋๋ค.
"ํฌ๋/ํ
์คํธ/ํ๋ ์/test_operators.py"
"ํ๋ค/ํ
์คํธ/ํ๋ ์/test_reshape.py"
"ํ๋ค/ํ
์คํธ/ํ๋ ์/test_timeseries.py"
"pandas/tests/indexes/datetimes/test_scalar_compat.py"
"pandas/tests/indexes/datetimes/test_tools.py"
"pandas/tests/indexes/interval/test_indexing.py"
"ํฌ๋/ํ
์คํธ/์ธ๋ฑ์ค/๊ฐ๊ฒฉ/ํ
์คํธ_๊ฐ๊ฒฉ.py"
์ด๋ค์ #31945์ ํฌํจ๋์ด ์์ต๋๋ค.
"pandas/tests/indexes/interval/test_setops.py"
"pandas/tests/indexes/multi/test_compat.py"
"pandas/tests/indexes/period/test_constructors.py"
"pandas/tests/indexes/timedeltas/test_constructors.py"
"ํ๋ค/ํ
์คํธ/์ธ๋ฑ์ฑ/test_floats.py"
์ด๋ค์ #31963์ ํฌํจ๋์ด ์์ต๋๋ค.
"ํฌ๋/ํ
์คํธ/๋ด๋ถ/test_internals.py"
"ํฌ๋/ํ
์คํธ/io/excel/test_readers.py"
"ํ๋ค/ํ
์คํธ/io/excel/test_style.py"
"ํ๋ค/ํ
์คํธ/io/excel/test_writers.py"
"ํฌ๋/ํ
์คํธ/io/excel/test_xlrd.py"
"ํฌ๋/ํ
์คํธ/io/formats/test_console.py"
"pandas/tests/io/formats/test_to_html.py"
"pandas/tests/io/formats/test_to_latex.py"
"ํฌ๋/ํ
์คํธ/io/generate_legacy_storage_files.py"
์ด๋ค์ #31967์ ํฌํจ๋์ด ์์ต๋๋ค.
"pandas/tests/io/parser/test_c_parser_only.py"
"ํ๋ค/ํ
์คํธ/io/ํ์/test_common.py"
"ํฌ๋/ํ
์คํธ/io/parser/test_compression.py"
"pandas/tests/io/parser/test_encoding.py"
"ํฌ๋/ํ
์คํธ/io/parser/test_multi_thread.py"
"pandas/tests/io/parser/test_na_values.py"
"pandas/test/io/parser/test_parse_dates.py"
"pandas/tests/io/parser/test_read_fwf.py"
"ํ๋ค/ํ
์คํธ/io/pytables/conftest.py"
"ํ๋ค/ํ
์คํธ/io/pytables/test_store.py"
์ด๋ค์ #31980์ ํฌํจ๋์ด ์์ต๋๋ค.
"ํ๋ค/ํ
์คํธ/io/pytables/test_timezones.py"
"ํ๋ค/ํ
์คํธ/io/test_html.py"
"ํฌ๋/ํ
์คํธ/io/test_stata.py"
"pandas/tests/resample/test_period_index.py"
"pandas/tests/reshape/merge/test_join.py"
"pandas/tests/reshape/merge/test_merge.py"
"pandas/tests/reshape/merge/test_merge_asof.py"
"pandas/tests/reshape/test_melt.py"
"pandas/tests/reshape/test_pivot.py"
"ํฌ๋/ํ
์คํธ/์ค์นผ๋ผ/timedelta/test_constructors.py"
์ด๋ค์ #31986์ ํฌํจ๋์ด ์์ต๋๋ค.
"pandas/tests/scalar/timestamp/test_constructors.py"
"ํ๋ค/ํ
์คํธ/์ค์นผ๋ผ/ํ์์คํฌํ/test_rendering.py"
"ํฌ๋/ํ
์คํธ/์ค์นผ๋ผ/ํ์์คํฌํ/test_unary_ops.py"
"ํ๋ค/ํ
์คํธ/์๋ฆฌ์ฆ/๋ฉ์๋/test_nlargest.py"
"pandas/tests/series/test_analytics.py"
"ํฌ๋/ํ
์คํธ/์๋ฆฌ์ฆ/test_api.py"
"ํ๋ค/ํ
์คํธ/์๋ฆฌ์ฆ/test_dtypes.py"
"ํ๋ค/ํ
์คํธ/์๋ฆฌ์ฆ/test_ufunc.py"
์ด https://github.com/pandas-dev/pandas/pull/32007๋ก ๋ด ์ฒซ ๋ฒ์งธ pull ์์ฒญ์ ์ถ๊ฐํ์ต๋๋ค.
ํฌ๋/ํ
์คํธ/ํ๋ ์/test_to_csv.py
์ด๋ค์ #32032์ ํฌํจ๋์ด ์์ต๋๋ค.
"ํ๋ค/ํ
์คํธ/test_downstream.py"
"ํ๋ค/ํ
์คํธ/test_multilevel.py"
"ํฌ๋/ํ
์คํธ/๋๊ตฌ/test_numeric.py"
"pandas/tests/tseries/frequencies/test_inference.py"
"ํฌ๋/ํ
์คํธ/tslibs/test_parse_iso8601.py"
"ํฌ๋/ํ
์คํธ/์ฐฝ/๋ชจ๋ฉํธ/test_moments_rolling.py"
์ด ํ์ผ์ #32029์ ํฌํจ๋์ด ์์ต๋๋ค.
https://github.com/pandas-dev/pandas/pull/32044์ ํฌํจ๋ ํ์ผ
์ด๋ค์ #32034์ ํฌํจ๋์ด ์์ต๋๋ค.
"ํฌ๋/์ฝ์ด/๋ฐฐ์ด/interval.py"
"ํฌ๋/์ฝ์ด/์ ํธ/ํด์ฑ.py"
"ํฌ๋/io/formats/format.py"
"ํฌ๋/io/formats/html.py"
"pandas/io/formats/latex.py"
"pandas/io/formats/printing.py"
"pandas/io/parsers.py"
"ํ๋ค/ํ
์คํธ/๋ฐฐ์ด/์นดํ
๊ณ ๋ฆฌ/test_dtypes.py"
"pandas/tests/arrays/categorical/test_operators.py"
์ด๊ฒ๋ค์ ๋๋ฌ์ด...
ํฌ๋/์ฝ์ด/์ต์ค/invalid.py
pandas/core/ops/methods.py
pandas/core/ops/roperator.py
#32063์ ํฌํจ๋ ํ์ผ:
์๋ ํ์ธ์, scripts/validate_docstrings.py๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ต๋๋ค.
pull ์์ฒญ์ ํฌํจ๋ ํ์ผ #32189
์ด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๊น? ์ด ์ค๋ ๋ ์๋จ์ ๋ชฉ๋ก์ ํ์๋์ง ์์ ํ์ผ์๋ณด๊ณ ์์๋๋ฐ .format() ๋ฌธ์์ด์ด ๋ณํ ๋ ๊ฒ ๊ฐ์ต๋๋ค.
pandas//util/_decorators.py๊ฐ ์๋ฃ๋์์ต๋๋ค(์คํจํ ์ค์ ์ฃผ์์ ๋๋ค)
pandas//core/indexes/base.py๋ฅผ ํ์ ํด์ ํด์ผ ํฉ๋๋ค(์คํจ๋ ๋ค์ ์ฃผ์์์ ๋ฐ์ํจ).
์๋
, ๋๋ ๋นจ๋ฆฌ ๋ฌธ์์ด์์ ๋ฌธ์์ด ํ
ํ๋ฆฟ์ ๋ณ๊ฒฝํ๋ฉด ํจ๊ป ๋ณด๊ฐ ๊ฒ์ ๊นจ๋ฌ์๋ค ํฌ๋ / ์ฝ์ด / generic.py๋ณด๊ณ ์์ %
์ string.Template
๋ง์ ์ฅ์์ ๋ณํ๋ฅผ ์๊ตฌํ๋ ๊ณณ Substitute
+ Appender
๋ฐ์ฝ๋ ์ดํฐ๊ฐ ์ฌ์ฉ๋ฉ๋๋ค.
%
๋ฌธ์์ด ๋ณด๊ฐ๋ฒ์ ๋ชจ๋ ์ฌ์ฉ์ ์ ๊ฑฐํ๋ ๊ฒ์ ๋ชฉํ๋ก ํ๊ณ ์์ต๋๊น? ์ด ๊ฒฝ์ฐ ์ด ์์
์ด ํ์ํฉ๋๋ค. ์๋๋ฉด %
๋ณด๊ฐ๋ฒ์ ์ฌ์ฉํด๋ ๊ด์ฐฎ์ต๋๊น?
@smartvinnetou Appender
๋ฐ Substitute
๊ดํด์๋ ์ด์ doc
๋ฐ์ฝ๋ ์ดํฐ๋ก ๊ต์ฒดํ๋ ค๊ณ ํฉ๋๋ค. https://github.com/pandas-dev/pandas/issues/31942 ์ฐธ์กฐ
@smartvinnetou
Appender
๋ฐSubstitute
๊ดํด์๋ ์ด์ doc
๋ฐ์ฝ๋ ์ดํฐ๋ก ๊ต์ฒดํ๋ ค๊ณ ํฉ๋๋ค. #31942 ์ฐธ์กฐ
@MomIsBestFriend ์ด ํฐ์ผ์์ pandas/core/generic.py
์
๊ทธ๋ ์ด๋๋ฅผ ๊ฑด๋๋ฐ๊ณ #31942์์ ํ์๊ฒ ์ต๋๊น? ์๋๋ฉด ์ด์ %
๋ณด๊ฐ์ ์ ๊ฑฐํ๊ธฐ ์ํด generic.py
Appender
๋ฐ Subtitute
๋ฐ์ฝ๋ ์ดํฐ๋ฅผ ์ด ํฐ์ผ ์๋์ ์ doc
๋ฐ์ฝ๋ ์ดํฐ๋ก ๊ต์ฒดํด์ผ ํฉ๋๊น?
@smartvinnetou
Appender
๋ฐSubstitute
๊ดํด์๋ ์ด์ doc
๋ฐ์ฝ๋ ์ดํฐ๋ก ๊ต์ฒดํ๋ ค๊ณ ํฉ๋๋ค. #31942 ์ฐธ์กฐ@MomIsBestFriend ์ด ํฐ์ผ์์
pandas/core/generic.py
์ ๊ทธ๋ ์ด๋๋ฅผ ๊ฑด๋๋ฐ๊ณ #31942์์ ํ์๊ฒ ์ต๋๊น? ์๋๋ฉด ์ด์ %
๋ณด๊ฐ์ ์ ๊ฑฐํ๊ธฐ ์ํดgeneric.py
Appender
๋ฐSubtitute
๋ฐ์ฝ๋ ์ดํฐ๋ฅผ ์ด ํฐ์ผ ์๋์ ์doc
๋ฐ์ฝ๋ ์ดํฐ๋ก ๊ต์ฒดํด์ผ ํฉ๋๊น?
@smartvinnetou pandas/core/generic.py
์ ๊ฒฝ์ฐ ์๋ #31942 (๋ด๊ฐ ์ ๋๋ก ์ดํดํ๋ค๋ฉด)
์๋ ํ์ธ์, ์๋ฃ๋์๊ฑฐ๋ ๋ณ๊ฒฝํ ํ์๊ฐ ์์ง๋ง ์๋ฃ๋์ง ์์ ๊ฒ์ผ๋ก ํ์๋ ํ์ผ์ ๋ง์ด ์ฐพ์์ต๋๋ค. ์ด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์๊ณ ์ค์๋ก ํ์๋์ง ์์๋์ง ์๋๋ฉด ์์ง ์์ ์ค์ธ์ง ๋ฌป๊ณ ์ถ์์ต๋๋ค. ํด๊ฒฐ๋์ง ์์ผ๋ฉด ์ ๋ ๊ธฐ์ฌํ๊ณ ์ถ์ต๋๋ค. ์๋ฃ๋์์ง๋ง ํ์๋์ง ์์ ํ์ผ ์ค ์ผ๋ถ์ ๋๋ค.
@sachinh35 ๋ชฉ๋ก์ ์ ๋ฐ์ดํธ ํ์ต๋๋ค :)
์ถ์ ํ๊ธฐ ์ด๋ ค์์ก๋ค
๋ชฉ๋ก์ ์ ๋ฐ์ดํธํด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค! @MomIsBestFriend
pandas/core/ops/
์๋์ ํ์ผ์ ๋ํด #32939๋ก ๊ธฐ์ฌํ๊ณ ์ถ์ต๋๋ค. ์๋ฅผ ๋ค์ด https://github.com/pandas-dev/pandas/blob/master/pandas/core/ops/docstrings.py#L564 ์ ๊ฐ์ด ๋
์คํธ๋ง์ ์ด๋ป๊ฒ ์ฒ๋ฆฌํด์ผ ํฉ๋๊น? ๋๋๋ก ๋ค๋ฅธ ํ์ผ์์๋ ๊ฐ์ ธ์ต๋๋ค. ํจ์์ ๋ํ?
๋๋ ๋ณํ๋ค
๋ ํ์ผ์ด ์์ ๋์์ต๋๋ค.
ํฌ๋/_libs/tslibs/timedeltas.pyx
ํฌ๋/_libs/tslibs/timestamps.pyx
๋ค์ ํญ๋ชฉ์๋ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค. ์๋ฃ๋ก ํ์ํ ์๋ ์์ต๋๋ค.
ํฌ๋/_libs/tslibs/c_timestamp.pyx
ํฌ๋/_libs/tslibs/frequencies.pyx
ํฌ๋/_libs/tslibs/parsing.pyx
ํฌ๋/_libs/tslibs/period.pyx
ํฌ๋/_libs/tslibs/strptime.pyx
์ฐธ๊ณ : ์ด๊ฒ์ ๋ด ์ฒซ PR์ ๋๋ค. ๊ฐ์ ํด์ผ ํ ์ฌํญ์ด ์์ผ๋ฉด ์๋ ค์ฃผ์ญ์์ค.
๋ชฉ๋ก์ ์ ๋ฐ์ดํธํ๊ณ ์ผ๋ถ ํ์ผ์ ํ์ธํ๋ ์ฃผ์ ๋ฅผ ์ดํด๋ณด์์ต๋๋ค.
(์๋ฌด๊ฒ๋ ๋ณ๊ฒฝํ ํ์ ์์):
pandas/util/_validators.py
. ์ด ๋ค๋ฅธ ํ์ผ๋ค ์ค ์๋น์๋ ์ด๋ฏธ ๋์๊ฒ๋ ๊ด์ฐฎ์ ๊ฒ ๊ฐ์ต๋๋ค.
์๋
ํ์ธ์ ๋งํ
์ค
์ด ๋
ธ๋ ฅ์ ๋๋ ๋ฐ ๊ด์ฌ์ด ์์ง๋ง git ๋ฐ
ํ๋ค์ ๊ธฐ์ฌํฉ๋๋ค. ์ ๋ฅผ ์๋ดํด ์ฃผ์ค ์ ์์ผ์ ๊ฐ์?
๋จ๊ณ? ์ด๋ฒ ์ฃผ์ ํ๋ฉด ๊ณต์ ๋ฅผ ์ค์ ํ ์ ์์๊น์?
๊ฐ์ฌ ํด์,
์ค๋๋ฅ
2020๋
5์ 26์ผ ํ์์ผ ์คํ 3:12 Matteo Santamaria [email protected]
์ผ๋ค:
๋๋ pandas/util/_validators.py๋ฅผ ๋๋ณด์๋ค. ์ด๋ฌํ ๋ค๋ฅธ ํ์ผ์ ๋๋ถ๋ถ์
๋์๊ฒ๋ ์ด๋ฏธ ๊ด์ฐฎ์ ๋ณด์ธ๋ค.
- ํฌ๋/util/_test_decorators.py
- ํฌ๋/tseries/frequencies.py
- ํฌ๋/tests/util/test_assert_frame_equal.py
- ํฌ๋/ํ ์คํธ/tslibs/test_parsing.py
- ํฌ๋/ํ ์คํธ/tseries/holiday/test_holiday.py
- ํฌ๋/ํ ์คํธ/tseries/holiday/test_calendar.py
- ํฌ๋/ํ ์คํธ/๋๊ตฌ/test_to_datetime.py
- ํฌ๋/ํ ์คํธ/test_strings.py
- ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/test_repr.py
- ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/test_datetime_values.py
- ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/test_constructors.py
- ํฌ๋/ํ ์คํธ/์๋ฆฌ์ฆ/test_api.py
โ
์ด ์ค๋ ๋์ ๊ฐ์ ํ๊ธฐ ๋๋ฌธ์ ์ด ๋ฉ์์ง๋ฅผ ๋ฐ๊ณ ์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ณ GitHub์์ ํ์ธํ์ธ์.
https://github.com/pandas-dev/pandas/issues/29547#issuecomment-634307953 ,
๋๋ ๊ตฌ๋ ์ทจ์
https://github.com/notifications/unsubscribe-auth/APG73XKAUDLFVVQXUS2SJETRTQ5DDANCNFSM4JLZCU5Q
.
@warden706๋ , ์ ๋ ์ฌ์ค ์๋ค์ . ์ด ๋ฆฌ์์ค๋ ๋ด๊ฐ ์ฐ์ฐํ ๋ฐ๊ฒฌํ์ ๋ ๋งค์ฐ ์ ์ฉํ๋ค๋ ๊ฒ์ ์์์ผ๋ฏ๋ก ํ์ธํด์ผ ํฉ๋๋ค.
์๋
ํ์ธ์,
์ฌ๊ธฐ์ ๊ธฐ์ฌํ๋ ๊ฒ๋ ๊ฝค ์๋กญ์ต๋๋ค. ๋ด๊ฐ ๋๋ณด๊ณ ์์ด
์ด ๋ค๋ฅธ ํ์ผ์ ํ์ธํ๋๋ฐ ๊ด์ฐฎ์ ๊ฒ ๊ฐ์ต๋๋ค.
๋๋ ์ฌ๊ธฐ ์๋กญ๋ค.
๋ด๊ฐ ๊ฐ์ ธ๊ฐ๊ฒ
์ฝ๋ ๋ณ๊ฒฝ์ ๋ํด ์ง๋ฌธ์ด ์์ต๋๋ค.
์๋ฅผ ๋ค์ด, pandas/tests/series/indexing/test_take.py์์ ์ฝ๋ ์ค๋ํซ:
msg = "index {} is out of bounds for( axis 0 with)? size 5"
with pytest.raises(IndexError, match=msg.format(10)):
ser.take([1, 10])
๊ทธ๋์ ๋ด ์ ์์ ๋ค์๊ณผ ๊ฐ์ด ๋ฐ๊พธ๋ ๊ฒ์ ๋๋ค.
msg = lambda x: f"index {x} is out of bounds for( axis 0 with)? size 5"
with pytest.raises(IndexError, match=msg(10)):
ser.take([1, 10])
๊ทธ๊ฒ์ผ๋ก ์ถฉ๋ถํฉ๋๊น?
์๋
ํ์ธ์,
PR์ ํ๊ณ ์ถ์ด์ ํ
์คํธ๋ฅผ ์งํํ๊ณ ์๋๋ฐ ๋ช ๋ฒ์ด๋ ์คํจ๋ฅผ ํ๊ณ ์์ต๋๋ค. ๊ทธ๋์ ๋ง์คํฐ์์๋ ํ
์คํธ๋ฅผ ํด๋ณด์์ต๋๋ค.
ํธ์ง๋์ง ์์ ๋ถ๊ธฐ๋ ๋ง์คํฐ์์ pytest pandas
๋ฅผ ์คํํ๋ฉด ๋ช ๋ฒ์ ์คํจ๊ฐ ๋ฐํ๋๋ ๊ฒ์ด ์ ์์
๋๊น?
๋ง์คํฐ๋ ์ผ๋ฐ์ ์ผ๋ก ํ ์คํธ๋ฅผ ํต๊ณผํด์ผ ํฉ๋๋ค. ์ต์ ์ปค๋ฐ์ ๊ฐ์ ธ์๋์ง ํ์ธํ์ญ์์ค. ์ด๋ค ํ ์คํธ๊ฐ ์คํจํฉ๋๊น?
@matteosantama ๋ง์ง๋ง ์ปค๋ฐ์ ๊ฐ์ ธ pytest pandas
ํ
์คํธ๋ฅผ ๋ค์ ์คํํ์ต๋๋ค. ๊ฒฐ๊ณผ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
================= short test summary info =================
FAILED pandas/tests/io/test_parquet.py::TestParquetFastParquet::test_s3_roundtrip - ValueError: Invalid timestamp "Ven, 29 Mag 2020 07:59:19 GMT": Unknown string format: Ven, 29 Mag 2020 07:59:19 GMT
FAILED pandas/tests/plotting/test_datetimelike.py::TestTSPlot::test_ts_plot_with_tz['UTC'] - AttributeError: 'numpy.datetime64' object has no attribute 'hour'
================= 2 failed, 87804 passed, 1185 skipped, 1005 xfailed, 5637 warnings in 2437.06s (0:40:37) =================
๋จ์ผ ๋๋ ํฐ๋ฆฌ(์: pytest pandas/tests/io
)์์๋ง ํ
์คํธ๋ฅผ ์คํํ๋ฉด ์คํจ๊ฐ ์๋ค๋ ๊ฒ์ ์์์ต๋๋ค.
7273 passed, 344 skipped, 53 xfailed, 5584 warnings in 351.76s (0:05:51)
@OlivierLuG ๋๊ธ ์ดํ ๊ฑฐ์ ๋ชจ๋ ํ์ผ์ด ์์ ๋์๊ฑฐ๋ ์์ ์์ด ์ด๋ฏธ
๊ฒ๋ค๊ฐ ์ด๊ฒ๋ ์ด๋ฏธ ๊ด์ฐฎ๋ค๊ณ ์๊ฐํฉ๋๋ค
@DanBasson ์ ๋ฐ์ดํธ๊ฐ ์์ต๋๊น?
๋๋ ๊ทธ๋ค์ด ๋ฌด์์ ์๋ฏธํ๋์ง ๋ชจ๋ฅด๋ ์ค๋ฅ๊ฐ ๊ณ์ ๋ฐ์ํฉ๋๋ค.
์ด๋ค ๋์์ ์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค
๋ง์คํฐ์์ ์ต์ ์์ ์ฌํญ์ ๊ฐ์ ธ์ค๋ ค๊ณ ํ์ต๋๊น? ์๋ง๋ ๊ทธ๊ฒ์ ์คํจํ ํ ์คํธ ์ค ์ผ๋ถ๋ฅผ ๊ณ ์น ๊ฒ์ ๋๋ค.
๊ทธ๊ฒ์ ๋์์ด๋์ง ์์๋ค.
๋ค๋ฅธ ์ฌ๋์ด ๊ฐ์ ธ๊ฐ ์ ์๋ค๋ฉด
pandas/tests/reshape/test_melt.py
์ ๊ฐ์ ์ํฉ์ด ๋ฐ์ํ์ ๋ ์์ฌ์ด ๋ญ๋๋ค.
msg = "The following '{Var}' are not present in the DataFrame: {Col}"
...
with pytest.raises(KeyError, match=msg.format(Var="value_vars", Col="\\['C'\\]")):
...
with pytest.raises(KeyError, match=msg.format(Var="id_vars", Col="\\['A'\\]")):
...
๋ฑ๋ฑ, msg
๋ฅผ ํจ์๋ก ๋ณํํ๊ณ "Col"์ ๋ค๋ฅธ ๊ฐ์ผ๋ก ํธ์ถํด์ผ ํฉ๋๊น? ์๋๋ฉด ๊ทธ๋๋ก ๋๋ ๊ฒ์ด ์ข์๊น์?
@MatteoFelici ์ ๋ฐ์ดํธ๋ ๋ชฉ๋ก์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. ๊ทํ๊ฐ ํธ์ถํ ๋ง์ง๋ง ๋จ์ ๋ช ๊ฐ์ ๋ชจ๋์ ํ์ธํ๋๋ฐ ๋ฌธ์ ๊ฐ ์์ด ๋ณด์ด๋ฏ๋ก ์ด ๋ฌธ์ ๋ฅผ ์ข ๋ฃํ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด https://github.com/pandas-dev/pandas/pull/32007๋ก ๋ด ์ฒซ ๋ฒ์งธ pull ์์ฒญ์ ์ถ๊ฐํ์ต๋๋ค.
ํฌ๋/ํ ์คํธ/ํ๋ ์/test_to_csv.py