“CSV file does not exist” for a filename with embedded quotes

前端 未结 18 764
萌比男神i
萌比男神i 2020-12-15 23:16

I am currently learning Pandas for data analysis and having some issues reading a csv file in Atom editor.

When I am running the following code:

imp         


        
18条回答
  •  攒了一身酷
    2020-12-15 23:47

    Adnane's answer helped me.

    Here's my full code on mac, hope this helps someone. All my csv files are saved in /Users/lionelyu/Documents/Python/Python Projects/

    import numpy as np
    import pandas as pd
    import matplotlib.pyplot as plt
    plt.style.use('ggplot')
    
    path = '/Users/lionelyu/Documents/Python/Python Projects/'
    
    aapl = pd.read_csv(path + 'AAPL_CLOSE.csv',index_col='Date',parse_dates=True)
    cisco = pd.read_csv(path + 'CISCO_CLOSE.csv',index_col='Date',parse_dates=True)
    ibm = pd.read_csv(path + 'IBM_CLOSE.csv',index_col='Date',parse_dates=True)
    amzn = pd.read_csv(path + 'AMZN_CLOSE.csv',index_col='Date',parse_dates=True)
    

提交回复
热议问题