
/in [아이템] [수량], /out [아이템] [수량] 명령어로 재고 증감 구현| 에러 메시지 / 상황 | 원인 | 해결 방법 |
|---|---|---|
AttributeError: module 'pandas' has no attribute 'read' | read_csv를 read.csv로 잘못 기입 | 점(.)을 언더바(_)로 수정 |
ufunc 'add' did not contain a loop... | 숫자와 글자를 더하려고 함 | int(context.args[1])로 숫자 변환 처리 |
| 실행은 되는데 숫자가 안 바뀜 | to_csv 저장 로직이 특정 조건문 안에 갇혀 있음 | 저장 코드를 if-else 문 밖으로 빼서 공통 실행되게 수정 |
/in Milk 5 입력 시 재고가 즉시 반영됨 (파일 데이터 수정 완료!)
/in and /out commands to manage inventory levels in real-time.context.args: Learned how to extract extra information (arguments) provided by users after a command.int): Understood that user input is always a string, and converting it to an integer is essential for calculations..strip() and .capitalize() to ensure user input matches the format in the CSV file regardless of case or spacing.| Error / Situation | Cause | Solution |
|---|---|---|
AttributeError: ... no attribute 'read' | Used read.csv instead of read_csv | Corrected the syntax to read_csv |
ufunc 'add' ... dtype('int64'), dtype('<U1') | Attempted to add a string to an integer | Applied int() to the user input |
| No errors, but no data change | The save function (to_csv) was misplaced | Moved the save logic outside the conditional blocks |
/in および /out コマンドで在庫の増減をリアルタイムで反映させる。.capitalize() や .strip() でデータを整える方法を学習。| エラーメッセージ / 状況 | 原因 | 解決方法 |
|---|---|---|
AttributeError: ... no attribute 'read' | read_csv を read.csv と誤記 | read_csv に修正 |
ufunc 'add' ... (dtype('int64'), dtype('<U1')) | 数値と文字列を加算しようとした | int() を使用して数値に変換 |
| エラーはないが数値が変わらない | 保存処理 (to_csv) の位置ミス | 保存コードを if-else 文の外に出して共通実行に変更 |