读取具有超过5万行的csv文件

时间:2019-07-05 15:30:39

标签: python-3.x pandas csv

如何使用熊猫读取具有超过5万行的csv文件?

在下面的代码中,我试图在列中查找与最大值相关的整行,但是在打印整个文件时,只显示了很少的内容。

# Find the display name and no. of comments done by the user who has got maximum reputation

import pandas as pd

# getting data and required columns
df = pd.read_csv(
    "C:\\Users\\LENOVO\\PycharmProjects\\stack_overflow\\Stack Overflow Project\\Stack Overflow Dataset\\users.csv")

max_reputation = df.loc[df['reputation'].idxmax(axis=2, skipna=True)]  

# giving output

print("\33[32;40m<<<::: DATABASE :::>>>\n", df)

print("\33[31;40m<<<::: USER INFO WITH MAX VIEW COUNT :::>>>\n", max_reputation)

0 个答案:

没有答案