mori– Author –
-
Python樹林
[Python] Sending POST Requests with Requests: Complete Distinction Between Form Data and JSON
When sending data (such as a new registration) to a Web API or server, you use the HTTP POST method. In Python's requests library, you need to use either the data argument or the json argument properly, depending on the format of the dat... -
Python樹林
【Python】RequestsでPOSTリクエストを送る:フォームデータとJSONの完全な使い分け
Web APIやサーバーに対してデータを送信(新規登録など)する場合、HTTPメソッドの POST を使用します。Pythonの requests ライブラリでは、送信するデータの形式に合わせて data 引数と json 引数を使い分ける必要があります。 ここでは、従来のWebフォー... -
Python樹林
[Python] Avoiding Garbled Text with Requests: Manual Setting and Automatic Detection of Response Encoding
The Python requests library automatically guesses the character encoding based on HTTP response headers. However, if the header lacks information or contains incorrect information (e.g., a Shift_JIS site being detected as ISO-8859-1), ac... -
Python樹林
【Python】Requestsで文字化けを回避する:レスポンスのエンコーディング手動設定と自動判定
Pythonの requests ライブラリは、HTTPレスポンスヘッダーに基づいて文字コード(エンコーディング)を自動的に推測します。しかし、ヘッダーに情報が含まれていない場合や、誤った情報が含まれている場合(例:Shift_JISのサイトがISO-8859-1と判定される... -
Python樹林
[Python] How to Retrieve and Check Detailed Response Information with Requests
The Response object returned by executing methods like requests.get() stores all information regarding the response from the server. In development, understanding the role of each attribute is essential. You need to handle not only the H... -
Python樹林
【Python】Requestsでレスポンスの詳細情報を取得・確認する方法
requests.get() などのメソッドを実行して返される Response オブジェクトには、サーバーからの応答内容に関するあらゆる情報が格納されています。 開発において、単にHTML本文を取得するだけでなく、通信の成否(ステータスコード)やメタデータ(ヘッダ... -
Python樹林
[Python] How to Send GET Requests with Requests: Basics and Parameter Settings
When retrieving data from the web, the GET request is the most frequently used method. By using Python's requests library, you can intuitively write requests in a dictionary (dict) format, not just for accessing a URL but also for adding... -
Python樹林
【Python】RequestsでGETリクエストを送信する方法:基本とパラメータ設定
Web上のデータを取得する際、最も頻繁に使用されるのが GET リクエストです。Pythonの requests ライブラリを使用すれば、単にURLへアクセスするだけでなく、検索条件などのパラメータを付与したリクエストも、辞書(dict)形式で直感的に記述できます。 ... -
Python樹林
[Python] Introduction to Requests: Basics of Website Retrieval and REST API Integration
When using Web scraping or REST APIs in Python, the third-party library requests is the de facto standard. It is overwhelmingly easier to handle than the standard library urllib. It is characterized by being human-readable and allowing y... -
Python樹林
【Python】Requests入門:Webサイト取得とREST API連携の基本
PythonでWebスクレイピングやREST APIを利用する際、標準ライブラリの urllib よりも圧倒的に扱いやすく、デファクトスタンダードとなっているのがサードパーティ製ライブラリの requests です。 人間にとって読みやすく、直感的な記述でHTTP通信を制御で... -
Python樹林
[Python] Basics of PostgreSQL Operations: Connection and Data Retrieval with psycopg2
When manipulating a PostgreSQL database from Python, psycopg2 is the most widely used library. It comprehensively supports PostgreSQL features and is known for being fast and robust. A distinct difference from other drivers like MySQLdb ... -
Python樹林
【Python】PostgreSQL操作の基本:psycopg2での接続とデータ取得
PythonからPostgreSQLデータベースを操作する場合、最も広く利用されているライブラリが psycopg2 です。このライブラリはPostgreSQLの機能を網羅的にサポートしており、高速かつ堅牢です。 特に MySQLdb などの他ドライバと異なる点として、Pythonのタプ... -
Python樹林
[Python] Basics of MySQL Operations: Connection Settings with mysqlclient and Data Retrieval Using the IN Clause
I will explain how to use mysqlclient (import name: MySQLdb), which is the most standard driver when manipulating MySQL databases from Python. I will introduce practical code ranging from managing connection information to advanced SQL e... -
Python樹林
【Python】MySQL操作の基本:mysqlclientでの接続設定とIN句を使ったデータ取得
PythonからMySQLデータベースを操作する際、最も標準的なドライバである mysqlclient(インポート名は MySQLdb)の使用方法を解説します。接続情報の管理から、リスト型のデータを条件に含める高度なSQL実行方法まで、実務で使えるコードを紹介します。 接... -
Python樹林
[Python] Manipulating Various Databases: List of Common DB-API Methods
In Python, when working with different database systems such as SQLite, MySQL, PostgreSQL, or Oracle, we use drivers implemented based on a common specification called DB-API 2.0 (PEP 249). This allows us to unify the Python-side code (p... -
Python樹林
【Python】様々なデータベースを操作する:DB-API共通メソッド一覧
Pythonでは、SQLite、MySQL、PostgreSQL、Oracleなどの異なるデータベースシステムを扱う際、DB-API 2.0 (PEP 249) という共通の仕様に基づいて実装されたドライバを使用します。これにより、データベース製品が変わっても、Python側のコード(接続、実行... -
Excel樹林
[Excel] How to Display “31” Only for Months That Have 31 Days
Environment OS: Windows 10 Pro (Version: 20H2) Excel Version: 2108 Background When creating a calendar in Excel, I wanted to configure settings to display or hide the date "31" depending on the month. Specifically, I wanted to create a c... -
Excel樹林
[Excel] How to Embed Cell Values in the Middle of a Text String | Using the & Operator
Environment OS: Windows 10 Pro (Version: 20H2) Software: Microsoft Excel Background While working in Excel, I wanted to display a cell's value embedded within a text string. For example, I wanted to display text combined with cell data, ... -
Excel樹林
[Excel] How to Fix Size Changes When Converting to PDF: Adjusting Scaling Options
Environment OS: Windows 10 Pro (Version: 20H2) Software: Microsoft Excel (Version: 2108) Background I was struggling with an issue where the print size and layout changed when converting Excel data to PDF. I could not save the document e... -
Excel樹林
Solution for When Typing Decimal Points Is Tedious [Excel Input Aid]
Introduction When you frequently enter numbers with decimal points (e.g., 14.3, 9.8, 3.4) in Excel, it can be surprisingly stressful if "the decimal key is hard to press" or if "you don't have a numeric keypad." I actually handle such ta... -
Excel樹林
How to Automatically Display the Date When a Cell is Entered [Excel Function x IF + TODAY]
Introduction In Excel, there are many situations where you want to automatically show a date when text is entered into a certain cell. I recently had a request to display the current date in column B whenever a name or data was entered i... -
Excel樹林
[Excel] How to Extract Values from Space-Separated Text | Using LEFT, MID, and FIND Functions
Introduction When using Excel, you often encounter situations where you want to extract specific parts from a text string separated by spaces or symbols. I myself wanted to "separate and obtain the last name and first name from a string ... -
Excel樹林
[Power Query] What are “Other Queries”? | Easy Explanation of Uses and Methods
Introduction When using Power Query to shape data in Excel, have you ever noticed the item "Other Queries" displayed in the sidebar of the Query Editor? For those unfamiliar with it, you might wonder, "What is this?" In this article, I w... -
Excel樹林
[Power Query] How to Extract Only the Date from a String and Add it to a Column
Introduction When processing data using Power Query, you often encounter situations where you want to "extract only a specific part of a string and display it in a new column." The data I faced contained strings like the following: Measu... -
Excel樹林
[Power Query] [Expression.Error] The column ‘Column1’ of the table was not found
Background While using the Power Query function in Excel, I encountered the error: "[Expression.Error] The column 'Column1' of the table was not found." In this article, I will introduce how to handle this error. Causes and Solutions The... -
Excel樹林
[Power Query] How to Specify a Folder as a Data Source | Steps to Batch Import Multiple Files
Introduction Using Power Query, you can batch import, transform, and aggregate multiple files located in the same folder. In this article, I have summarized the steps on how to actually specify a folder as a data source in Power Query ba... -
Excel樹林
[[Excel Power Query] How to Import Only Specific Rows from a CSV File | Steps for Data Acquisition and Transformation]
Introduction Using Excel's Power Query feature allows you to efficiently import and transform only the necessary rows from a CSV file. In this article, I will summarize the actual operational steps for individually extracting and shaping... -
Excel樹林
[[Excel] How to Change X-Axis Labels to Vertical Text | Aligning Date Data Vertically]
Introduction When creating a chart in Excel, have you ever encountered a situation where the dates on the X-axis (e.g., "2023/12/14") are displayed horizontally, causing them to overlap or take up too much space? In this article, I will ... -
Excel樹林
[Power Query] How to Calculate Average Time and Add it to a Column | Supporting “mm:ss.0” Format
Introduction I wanted to use Excel's Power Query function to calculate the average of time data and add it as a column, so I learned and implemented the method. This technique is particularly effective when you want to process data in a ... -
Excel樹林
[Power Query x VBA] How to Create a Macro to Auto-Apply “F2” + “Enter” to All Cells
Introduction When importing data using Power Query, have you ever encountered a situation where the cell values are not recognized as the intended data type? For example, numbers or dates might not be recognized correctly, preventing cal...