Skip to content Skip to sidebar Skip to footer

'nonetype' Object Has No Attribute 'fileno'

import pandas as pd import numpy as np import matplotlib.pyplot as plt from datetime import datetime plt.style.use('ggplot') columns = ['user_id','order_dt','order_products','orde

Solution 1:

I am seeing this as well.

>>> type(sys.__stdout__)
<class'NoneType'>

I get NoneType when calling dunder stdout while I am using idle. I assume that pandas wants to determine how much to display in the results and is looking for the sys output information. In the documentation, it mentions what this is, but not how to reset it.

I did this:

sys.__stdout__ = sys.stdout

and it fixed the problem, but I have not idea if I caused problems down the line.

Solution 2:

You may wish to try out the following.

df = pd.read_csv('CDNOW_master.txt',usecols = columns,sep = '\s+')

instead of

df = pd.read_csv('CDNOW_master.txt',names = columns,sep = '\s+')

This solved my problem. Hope it solves yours too.

Post a Comment for "'nonetype' Object Has No Attribute 'fileno'"