Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: How to extract specific numbers from a matrix?
Post: How to extract specific numbers from a matrix?
Dear Python Users,
I have the following matrix:
a = array([[100. , 100. , 100. ],
[175.24163615, 198.31220183, 32.71406333],
[150.36778472, 82.62453566, 38.51860719],
... |
|
Alberto |
General Coding Help |
0 |
3,356 |
Mar-06-2018, 02:52 PM |
|
|
Thread: A bug in the code
Post: RE: A bug in the code
Thank you for the reply! That is what I get as well. The problem is that "ret_annual" should provide the annual returns instead of "Nan" and I do not see where I make the mistakes |
|
Alberto |
Data Science |
2 |
2,522 |
Feb-11-2018, 11:41 PM |
|
|
Thread: How to extract specific information from json database?
Post: RE: How to extract specific information from json ...
(Feb-06-2018, 07:02 PM)Larz60+ Wrote: Please, if you would, share your solution with other users
I have added this code to the one that we have discussed:
group=[]
food_name=[]
manufacturer=[]
nutr... |
|
Alberto |
Data Science |
13 |
7,877 |
Feb-11-2018, 11:25 PM |
|
|
Thread: A bug in the code
Post: A bug in the code
Dear Python Users,
I am trying to find annual return of S&P500 given monthly prices. I have the following code below. The problem is that I receive empty (Nan) observations. Can you please point ... |
|
Alberto |
Data Science |
2 |
2,522 |
Feb-11-2018, 11:21 PM |
|
|
Thread: How to define two functions run simultaneously within a function?
Post: RE: How to define two functions run simultaneously...
(Feb-06-2018, 08:00 PM)boring_accountant Wrote: Alright, I may not be of help to the general solution, but I can give you some pointers which hopefully will prove useful:Value_2 is not set prior to ... |
|
Alberto |
General Coding Help |
4 |
4,060 |
Feb-06-2018, 10:08 PM |
|
|
Thread: How to define two functions run simultaneously within a function?
Post: RE: How to define two functions run simultaneously...
(Feb-06-2018, 06:37 PM)boring_accountant Wrote: Hello, I am unsure what is the objective you are trying to reach, but it looks like you are performing multiple runs of call valuations using the BSM ... |
|
Alberto |
General Coding Help |
4 |
4,060 |
Feb-06-2018, 06:46 PM |
|
|
Thread: How to define two functions run simultaneously within a function?
Post: How to define two functions run simultaneously wit...
Dear Python Users,
I have the code below. The problem is that two functions are interdependent and should be run simultaneously (line - 8 and 11). How can I run the re-construct the code? The Final o... |
|
Alberto |
General Coding Help |
4 |
4,060 |
Feb-06-2018, 05:35 PM |
|
|
Thread: How to make interations untill a certain value of equation is reached?
Post: RE: How to make interations untill a certain value...
Thanks for the answer. The whole code is provided at the end of the post. "New_FirmValue" is defined in line 15.
Error:Guess_FirmValue = S0*N
def warrant_1unobservable(S0, K, T, r, sigma, k, N, M, I... |
|
Alberto |
Data Science |
3 |
2,934 |
Feb-06-2018, 02:31 PM |
|
|
Thread: How to make interations untill a certain value of equation is reached?
Post: How to make interations untill a certain value of ...
I need to construct a loop (simulation) that will iterate a certain number of times and display a value of warrant once the new firm value is close to the guess firm value. Specifically, the idea is t... |
|
Alberto |
Data Science |
3 |
2,934 |
Feb-06-2018, 02:11 PM |
|
|
Thread: How to extract specific information from json database?
Post: RE: How to extract specific information from json ...
Thank you for your help! You are right, it is USDA nutrition database. However, I already extracted all the needed data observations though the use of pandas dataframe. Again, thank you for the help. |
|
Alberto |
Data Science |
13 |
7,877 |
Feb-06-2018, 01:55 PM |
|
|
Thread: How to extract specific information from json database?
Post: RE: How to extract specific information from json ...
|
Alberto |
Data Science |
13 |
7,877 |
Feb-05-2018, 07:30 PM |
|
|
Thread: How to extract specific information from json database?
Post: RE: How to extract specific information from json ...
I tried and here what it gives me:
Error: raise JSONDecodeError("Extra data", s, end)
JSONDecodeError: Extra data |
|
Alberto |
Data Science |
13 |
7,877 |
Feb-05-2018, 07:16 PM |
|
|
Thread: How to extract specific information from json database?
Post: RE: How to extract specific information from json ...
Yes, you are right. I used the code below to convert it to pandas df (the file is 350MB):
import pandas as pd
# read the entire file into a python array
with open('C:/Users/Alber... |
|
Alberto |
Data Science |
13 |
7,877 |
Feb-05-2018, 06:50 PM |
|
|
Thread: How to extract specific information from json database?
Post: RE: How to extract specific information from json ...
Here I upload the data that is a subsample of pandas df. I saved it as csv. I tried to run the code (skipping the first line as my df is not saved as a separate file on the hard disk) and got the erro... |
|
Alberto |
Data Science |
13 |
7,877 |
Feb-05-2018, 06:31 PM |
|
|
Thread: How to extract specific information from json database?
Post: How to extract specific information from json data...
Dear Python Users,
I have a json database "data_df" [8194 rows x 6 columns]. The sample of the data is uploaded below.
nutrients \
0 [{'code': '203cp1252', 'name': 'Proteincp1252'...
1 ... |
|
Alberto |
Data Science |
13 |
7,877 |
Feb-05-2018, 03:57 PM |
|
|
Thread: Reading json file as pandas data frame?
Post: Reading json file as pandas data frame?
Dear Python Users,
I am using python 3.6 and trying to download json file (350 MB) as pandas dataframe using the code below. However, I get the following error:
Error:data_json_str = "[" + ",".join(... |
|
Alberto |
Data Science |
1 |
8,381 |
Feb-04-2018, 11:57 PM |
|
|
Thread: Issue with error handling
Post: Issue with error handling
Dear Python Users,
Sorry for bothering you with the posts. I am pretty new to programming. What I am trying to do is to promt user to enter 5 countries so that there are 5 indeces associated with tho... |
|
Alberto |
Data Science |
1 |
3,597 |
Jan-29-2018, 04:39 PM |
|
|
Thread: "Use proper inputs to download stock data"
Post: How to change a name of database is a loop?
Dear Python Users,
I am struggling to change a name of database in a loop (lines 47-49). What the program is doing - it prompts a user to enter a country and automatically download the data of a stoc... |
|
Alberto |
Data Science |
15 |
9,313 |
Jan-29-2018, 02:03 PM |
|
|
Thread: "Use proper inputs to download stock data"
Post: RE: "Use proper inputs to download stock data"
I tried to re-write the code. Once, I enter the countries specified in the code (England, USA, etc.) everything works (Except for Hong Kong, the python does not provide any bug). However, once I enter... |
|
Alberto |
Data Science |
15 |
9,313 |
Jan-28-2018, 10:26 PM |
|
|
Thread: "Use proper inputs to download stock data"
Post: RE: "Use proper inputs to download stock data"
Thank you for the answers. However, I am still struggling to get the data for all indeces |
|
Alberto |
Data Science |
15 |
9,313 |
Jan-28-2018, 10:17 PM |