Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6243005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:03:27+00:00 2026-05-24T12:03:27+00:00

Without using matplotlib finance module. I like to get the url data into a

  • 0

Without using matplotlib finance module. I like to get the url data into a numpy array.
where I can to column heading to do math. Like:

prices = r.adj_close

From:
http://matplotlib.sourceforge.net/examples/pylab_examples/finance_work2.html

except I dont want to use the:

fh = finance.fetch_historical_yahoo(ticker, startdate, enddate)
# a numpy record array with fields: date, open, high, low, close, volume, adj_close)

r = mlab.csv2rec(fh); fh.close()
r.sort()

Using manually create the url:

        url = http://ichart.yahoo.com/table.csv?a=2&c=2011&b=30&e=7&d=7&g=d&f=2011&s=msft&ignore=.csv

        f = urllib.urlopen(url)
        fr = f.read()



        hdata = np.asarray(fr, dtype='object')
        prices = hdata.adj_close
        print prices
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:03:28+00:00Added an answer on May 24, 2026 at 12:03 pm

    use numpy.loadtxt() to load csv:

    import numpy as np
    import pylab as pl
    import urllib
    url = "http://ichart.yahoo.com/table.csv?a=2&c=2011&b=30&e=7&d=7&g=d&f=2011&s=msft&ignore=.csv"
    f = urllib.urlopen(url)
    title = f.readline().strip().split(",")
    data = np.loadtxt(f, dtype=np.float, delimiter=",", converters={0: pl.datestr2num}))
    

    the first column is date, so use pylab.datestr2num to convert it to number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Without using VisIt's python library visit-writer.py, how can I import my data into VisIt?
Without using jQuery (can't get into why NOT right now) how do I disable
Without using code, how can I turn this into a Template? I have about
Without using DynaForm and it's kin. I would like to use a POJO data
Without using Boost, how can I write a function like: template<typename T> void myFunc(T
Without using any third-party tools, how can you determine if an ASP.NET application (.NET
Can it be done without using TypeMock Islolator? I've found a few suggestions online
Assigning values without using usual notation like this.<Double>getAnything(int flag) private <T> T getAnything(int flag)
How to do CVS co using Perl without using Cvs module ?
How to create a pure JavaScript (without using any library) plugin which looks like:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.