Question

MY code is as follows for spyder import numpy as np price=np.genfromtxt("stocks.csv",delimiter=",") I am getting this...

MY code is as follows for spyder

import numpy as np

price=np.genfromtxt("stocks.csv",delimiter=",")

I am getting this error

raise IOError("%s not found." % path)

OSError: stocks.csv not found.

How can I fix this

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Make sure you have the file present in the working directory with name "stocks.csv".
The file which you are trying to read is NOT PRESENT.

If You dont have the file, You need to create one in the same working directory as your python program.

Create a csv file using microsoft excel and name it as stocks.csv. Add the data accordigly.


PLEASE COMMENT if there is any concern. I will respond to comments

Add a comment
Know the answer?
Add Answer to:
MY code is as follows for spyder import numpy as np price=np.genfromtxt("stocks.csv",delimiter=",") I am getting this...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This is my code: import numpy as np import pandas as pd import sys from keras.models...

    This is my code: import numpy as np import pandas as pd import sys from keras.models import Sequential from keras.layers import Dense from sklearn.preprocessing import StandardScaler from keras.layers.normalization import BatchNormalization from keras.layers import Dropout file_full=pd.read_csv("/Users/anwer/Desktop/copy/FULL.csv") file_bottom=pd.read_csv("/Users/anwer/Desktop/copy/bottom.csv") train=[] train_targets=[] test=[] test_targets=[] p=[] q=[]    # We will generate train data using 50% of full data and 50% of bottom data. #is train target for labeling ? yes for train data train_df = file_full[:len(file_full)//2] labels=[ 0 for i in range(len(file_full)//2)] train_df=train_df.append(file_bottom[:len(file_bottom)//2]) for...

  • Python...I don't know what is wrong with my code: import numpy as np from mpi4py import...

    Python...I don't know what is wrong with my code: import numpy as np from mpi4py import MPI array= [14,175, 15,055, 16,616, 17,495, 18,072, 19,390] array1,array2= array[ : :2], array[1: :2] print (array1) print (array2) /////it should print array1 = [1,4175, 16,616,18,072] array2= [15,055, 17,495, 19,390]

  • IN PYTHON 3 GIVING THIS CODE %matplotlib inline import numpy as np import matplotlib.pyplot as plt...

    IN PYTHON 3 GIVING THIS CODE %matplotlib inline import numpy as np import matplotlib.pyplot as plt from sklearn import datasets N_samples = 2000 X = np.array(datasets.make_circles(n_samples=N_samples, noise=0.05, factor=0.3)[0]) plt.scatter(X[:,0], X[:,1], alpha=0.8, s=64, edgecolors='white'); Use Spectral Clustering to cluster the points and visualize your result

  • I am currently doing homework for my java class and i am getting an error in...

    I am currently doing homework for my java class and i am getting an error in my code. import java.util.Scanner; import java.util.Random; public class contact {       public static void main(String[] args) {        Random Rand = new Random();        Scanner sc = new Scanner(System.in);        System.out.println("welcome to the contact application");        System.out.println();               int die1;        int die2;        int Total;               String choice = "y";...

  • I am getting this Error can you please fix my Java code. import java.awt.Dialog; import java.awt.Label;...

    I am getting this Error can you please fix my Java code. import java.awt.Dialog; import java.awt.Label; import java.awt.TextArea; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class Fall_2017 {    public TextArea courseInput;    public Label textAreaLabel;    public JButton addData;    public Dialog confirmDialog;    HashMap<Integer, ArrayList<String>> students;    public Fall_2017(){    courseInput = new TextArea(20, 40);    textAreaLabel = new Label("Student's data:");    addData = new JButton("Add...

  • Need Help ASAP!! Below is my code and i am getting error in (public interface stack)...

    Need Help ASAP!! Below is my code and i am getting error in (public interface stack) and in StackImplementation class. Please help me fix it. Please provide a solution so i can fix the error. thank you.... package mazeGame; import java.io.*; import java.util.*; public class mazeGame {    static String[][]maze;    public static void main(String[] args)    {    maze=new String[30][30];    maze=fillArray("mazefile.txt");    }    public static String[][]fillArray(String file)    {    maze = new String[30][30];       try{...

  • I am getting an error from eclipse stating that: Exception in thread "main" java.lang.Error: Unresolved compilation...

    I am getting an error from eclipse stating that: Exception in thread "main" java.lang.Error: Unresolved compilation problem: at EvenOdd.main(EvenOdd.java:10) I am unable to find what I can do to fix this issue. Can you please assist? My code is below: import java.util.InputMismatchException; import java.util.Scanner; public class EvenOdd {    public static void main(String[] args) {        Scanner input = new Scanner(System.in);        System.out.println("Welcome to this Odd program!");        int userInput1 = input.nextInt();    }       public...

  • How can I change my code so that it prints its results in descending order using numpy?

    How can I change my code so that it prints its results in descending order using numpy? def life_sat_by_cntry(bli): ""Given bli df, return average of Life sat. by country sorted in descending "ャ鲆ワ mask- bli['Indicator'] return bli[mask].groupby('Countryl')I'value'].mean() to_frame() raise NotImplementedror) -'Life Satisfaction def life_sat_by_cntry(bli): ""Given bli df, return average of Life sat. by country sorted in descending "ャ鲆ワ mask- bli['Indicator'] return bli[mask].groupby('Countryl')I'value'].mean() to_frame() raise NotImplementedror) -'Life Satisfaction

  • I have the attached code and keep getting an unexpected indent error on the last line,...

    I have the attached code and keep getting an unexpected indent error on the last line, how can I fix this? 1 import urllib 2 import re 3 url raw_input('Enter the URL:') 4 req request (url) 5 while True: 6 try: counts dict() fhandurllib.urlopen (req) for line in fhand: words line.split) for word in words: 10 counts[word] counts.get(word,0) 1 12 13 14 15 16 17 print(counts) data - count.getlength(512) if(len (data) < 1): break print data

  • I am creating a program where a user will enter in a price amount. And then...

    I am creating a program where a user will enter in a price amount. And then the program will determine how many 20, 10, 5, 1, etc.. they get back. I keep getting "error: unexpected type" in my findValue method. Not too sure why I am getting this. There also might be more bugs in there that I am not aware of because it wont compile. Any help is appreciated. Here is my code: import java.util.Scanner; public class prac1 {...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT