报错‘list‘ object has no attribute ‘DataFrame‘

以下会报错:‘list’ object has no attribute ‘DataFrame’或者是’list’ object has no attribute ‘Series’

import pandas as pd
pd_str = [str(i) for i in pd]
u233breed_dictionary = {'u233':pd.Series(u233breed.u233, index=pd_str), 'double time':pd.Series(u233breed.double_time, index=pd_str)}
u233breed_df = pd.DataFrame(u233breed_dictionary)
print(u233breed_df)

以下不会报错

from pandas import Series,DataFrame
pd_str = [str(i) for i in pd]
u233breed_dictionary = {'u233':Series(u233breed.u233, index=pd_str), 'double time':Series(u233breed.double_time, index=pd_str)}
u233breed_df = DataFrame(u233breed_dictionary)
print(u233breed_df)

你可能感兴趣的:(报错‘list‘ object has no attribute ‘DataFrame‘)