给一个文本数据集，要求使用Python编写程序，将其中的所有单词转为小写，并统计每个单词出现的次数。


文本数据集：
\"It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way - in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only.\"
可以使用Python中的字符串函数和字典数据结构完成该任务。可以先读取文本数据集，使用split()函数将文本分割成单词，再使用lower()函数将单词转换为小写形式，最后使用字典记录每个单词出现的次数。代码示例：

```python
with open('data.txt', 'r') as f:
    text = f.read()

words = text.split()
word_counts = {}

for word in words:
    # 将单词转换为小写形式
    word = word.lower()

    if word in word_counts:
        word_counts[word] += 1
    else:
        word_counts[word] = 1

print(word_counts)
```