본문 바로가기
반응형

분류 전체보기430

Python html 파일 불러와서 csv파일로 저장하기 import pandas as pdurl = "https://ko.wikipedia.org/wiki/%EC%84%9C%EC%9A%B8%ED%8A%B9%EB%B3%84%EC%8B%9C%EC%9D%98_%ED%96%89%EC%A0%95_%EA%B5%AC%EC%97%AD"# df_htmltable = pd.read_html(url)len(table)table[0]table[1]df_html = table[1]df_html.shapedf_html.head()df_html.tail()file_path = "data/seoul-gu.csv"df_html.to_csv(file_path) pd.read_csv(file_path)file_path = "data/seoul-gu.csv"df_html.to_csv(file_.. 2025. 6. 25.
엑셀 월별시트분리 통합 python pandas code 월별시트분리 # 엑셀 데이터 파일 경로file_path = "data/card-use-monthly.xlsx"# 엑셀 데이터 읽기df = pd.read_excel(file_path)# 날짜 형식 보장 및 월 정보 생성df['승인일자'] = pd.to_datetime(df['승인일자'], errors='coerce')df['승인월'] = df['승인일자'].dt.month# 계정과목 분류를 위한 키워드 사전category_dict = { '여비교통비': ['주유소', '고속', '철도', '버스', '택시', '교통', 'KTX'], '복리후생비': ['마트', '편의점', '카페', '백화점', '음식점'], '접대비': ['한우', '한정식', '횟집', '회식', '호텔'], '.. 2025. 6. 25.
법인카드 관리 pandas prompt { "cells": [ { "cell_type": "markdown", "id": "132b3b06-1be9-4b90-a535-ad239e32ba51", "metadata": {}, "source": [ "### 연말정산과 비용처리를 위해 법인카드 사용내역을 정리해야 한다면?\n", "\n", "```\n", "카드 사용내역 월별 저장 : 회사는 직원들이 법인카드를 사용하여 다양한 비용(여행비, 식비, 장비 구입 등)을 지출합니다.\n", "연말이 다가오면서 재무팀은 모든 법인카드 사용내역을 정리하고,\n", "각 비용을 적절한 카테고리에 분류하여 연말정산 및 비용처리를 진행해야 합니다.\n", "```\n", "* pandas 공식 문서 : h.. 2025. 6. 25.
pandas 강의록 카드정보 정리하기 Selection deleteddf.info()RangeIndex: 12000 entries, 0 to 11999Data columns (total 4 columns):# Column Non-Null Count Dtype--- ------ -------------- -----0 승인일자 12000 non-null object1 카드사 12000 non-null object2 가맹점명 12000 non-null object3 결제금액 12000 non-null int64dtypes: int64(1), object(3)memory usage: 375.1+ KB0 이마트 박1 가평군 마트2 쿠팡3 고양시 일산서구 마트4 쿠팡...11995 조전 주유소11996 부여군 마트11997 김포시 마트11998 미영 .. 2025. 6. 25.
반응형