How can I print a pandas table with converted values in python?

I am having trouble avoiding NAN values in my newest data table after I have converted the data types: Symbol, Exchange, and Date from object data types to float64 data types. If you look at my last printed data table, I only get NAN values and no readable data as I wish to. Does someone know what could be the issue here and how to fix it so that there is readable data showing instead? Thanks in advance!

import requests # For http request to
import pandas as pd # For pandas datatable
import numpy as np

# Api Key
params = {
    'access_key': '****************************'

# Request Api Key Data
api_result = requests.get('************************&symbols=FB&interval=1min&sort=DESC&limit=1000', params)
api_response = api_result.json()

# Sorts the data into a table
df = pd.DataFrame(api_response['data'])

# Exports and then imports csv data
df.to_csv('Test_Sample.csv', index=False)
dataframe = pd.read_csv('Test_Sample.csv', header=0)

#Reverse data table
dataframe2 = dataframe.iloc[::-1]

#Convert string to floats
dataframe2['symbol']=pd.to_numeric(dataframe2['symbol'], errors='coerce')
dataframe2['exchange']=pd.to_numeric(dataframe2['exchange'], errors='coerce')
dataframe2['date']=pd.to_numeric(dataframe2['date'], errors='coerce')

#Display data type and updated table

enter image description here

enter image description here

Read more here:

Content Attribution

This content was originally published by NinjaCoder98 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: