技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
skill-019【数据与研究】Techniques for normalizing financial data from various sources for accurate analysis and reporting. This skill focuses on cleaning, transforming, and harmonizing financial datasets to ensure consistency and reliability.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Financial Data Normalization offers methods to standardize and clean financial datasets from different sources. Consistent financial reporting is crucial for accurate analysis, budgeting, and forecasting.
This skill covers:
Use this skill when:
Financial datasets often contain various quality issues that must be addressed:
| Issue Type | Description | Typical Prevalence | Example |
|---|---|---|---|
| Inconsistent Currencies | Values reported in different currencies | 10-20% | Sales reported in USD vs EUR |
| Decimal Formatting | Variation in decimal places used | 15-30% | 1,200.50 vs 1200.50 |
| Leading Zeros | Presence of unnecessary leading zeros | 5-10% | 000123.45 vs 123.45 |
| Whitespace Issues | Extra spaces or tabs in values | 10-15% | 100.00 vs 100.00 |
| Missing Values | Rows with missing financial information | Variable | NaN, -999, blank |
When dealing with multiple currencies, you can use the following Python code to convert financial values:
conversion_rates = {
'USD': 1,
'EUR': 1.1,
'JPY': 0.009
}
def convert_currency(amount, from_currency, to_currency):
return amount * conversion_rates[to_currency] / conversion_rates[from_currency]
# Example Usage
amount_in_usd = convert_currency(100, 'EUR', 'USD')
print(f'100 EUR is equivalent to {amount_in_usd:.2f} USD')
To standardize number formatting, you can use this code to format your monetary values:
import pandas as pd
# Sample financial data
financial_data = {'Revenue': [1000.5, 2000, 3000.75]}
df = pd.DataFrame(financial_data)
df['Formatted Revenue'] = df['Revenue'].map(lambda x: f'{x:,.2f}')
print(df)
Financial Data Normalization is essential for ensuring accuracy and reliability in financial analysis. By applying the techniques discussed, users can effectively clean and standardize financial datasets, allowing for more informed decision-making.