I am trying to use applymap to my dataset to create floats into integers. But I get the "'Series' object has no attribute 'applymap'" error.
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.pyplot import pie, axis, show
from pandas import Series,DataFrame
class Dataset():
def __init__(self, input):
self.choice = input
self.file = 0
def read(self):
if self.choice == ("1"):
self.file = pd.read_csv('mycsv.csv')
self.file.plot(kind='bar')
print(df)
self.file['Value'].applymap(float)
def __str__(self):
return str(self.file)
def applymap(self):
return self.file.applymap(float)
i = (input("Pick a DataSet= "))
df = Dataset(i)
df.read()
plt.show()
self.file['Value']
is aSeries
; you are callingappplymap
for it while it is aDataFrame
function.