gbencke / pyastrotrader Goto Github PK
View Code? Open in Web Editor NEWMachine Learning + Financial Markets + Astrology = A Match made in Heaven
Machine Learning + Financial Markets + Astrology = A Match made in Heaven
Hi..
I am getting error in Predict.price.change.ipynb
at following line #9 as below:
StockPrices[column_name] = StockPricesDask.map_partitions(lambda df : df.apply(lambda x : int(get_degree_for_planet(x, current_planet) / 3), axis =1), meta='int').compute(scheduler='processes')
KeyError Traceback (most recent call last)
in
5 column_name="ASTRO_{}_POSITION".format(PLANETS[current_planet]).upper()
6 StockPricesDask = dd.from_pandas(StockPrices, npartitions=NPARTITIONS)
----> 7 StockPrices[column_name] = StockPricesDask.map_partitions(lambda df : df.apply(lambda x : int(get_degree_for_planet(x, current_planet) / 3), axis =1), meta='int').compute(scheduler='processes')
8 StockPrices[column_name] = pd.to_numeric(StockPrices[column_name], downcast='float', errors='coerce')
9 astro_columns.append(column_name)
~/anaconda3/lib/python3.7/site-packages/dask/base.py in compute(self, **kwargs)
164 dask.base.compute
165 """
--> 166 (result,) = compute(self, traverse=False, **kwargs)
167 return result
168
~/anaconda3/lib/python3.7/site-packages/dask/base.py in compute(*args, **kwargs)
442 postcomputes.append(x.dask_postcompute())
443
--> 444 results = schedule(dsk, keys, **kwargs)
445 return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
446
~/anaconda3/lib/python3.7/site-packages/dask/multiprocessing.py in get(dsk, keys, num_workers, func_loads, func_dumps, optimize_graph, pool, **kwargs)
216 pack_exception=pack_exception,
217 raise_exception=reraise,
--> 218 **kwargs
219 )
220 finally:
~/anaconda3/lib/python3.7/site-packages/dask/local.py in get_async(apply_async, num_workers, dsk, result, cache, get_id, rerun_exceptions_locally, pack_exception, raise_exception, callbacks, dumps, loads, **kwargs)
484 _execute_task(task, data) # Re-execute locally
485 else:
--> 486 raise_exception(exc, tb)
487 res, worker_id = loads(res_info)
488 state["cache"][key] = res
~/anaconda3/lib/python3.7/site-packages/dask/local.py in reraise(exc, tb)
314 if exc.traceback is not tb:
315 raise exc.with_traceback(tb)
--> 316 raise exc
317
318
~/anaconda3/lib/python3.7/site-packages/dask/local.py in execute_task()
220 try:
221 task, data = loads(task_info)
--> 222 result = _execute_task(task, data)
223 id = get_id()
224 result = dumps((result, id))
~/anaconda3/lib/python3.7/site-packages/dask/core.py in _execute_task()
119 # temporaries by their reference count and can execute certain
120 # operations in-place.
--> 121 return func(*(_execute_task(a, cache) for a in args))
122 elif not ishashable(arg):
123 return arg
~/anaconda3/lib/python3.7/site-packages/dask/optimization.py in call()
986 if not len(args) == len(self.inkeys):
987 raise ValueError("Expected %d args, got %d" % (len(self.inkeys), len(args)))
--> 988 return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
989
990 def reduce(self):
~/anaconda3/lib/python3.7/site-packages/dask/core.py in get()
149 for key in toposort(dsk):
150 task = dsk[key]
--> 151 result = _execute_task(task, cache)
152 cache[key] = result
153 result = _execute_task(out, cache)
~/anaconda3/lib/python3.7/site-packages/dask/core.py in _execute_task()
119 # temporaries by their reference count and can execute certain
120 # operations in-place.
--> 121 return func(*(_execute_task(a, cache) for a in args))
122 elif not ishashable(arg):
123 return arg
~/anaconda3/lib/python3.7/site-packages/dask/utils.py in apply()
28 def apply(func, args, kwargs=None):
29 if kwargs:
---> 30 return func(*args, **kwargs)
31 else:
32 return func(*args)
~/anaconda3/lib/python3.7/site-packages/dask/dataframe/core.py in apply_and_enforce()
5129 func = kwargs.pop("_func")
5130 meta = kwargs.pop("_meta")
-> 5131 df = func(*args, **kwargs)
5132 if is_dataframe_like(df) or is_series_like(df) or is_index_like(df):
5133 if not len(df):
in ()
5 column_name="ASTRO_{}_POSITION".format(PLANETS[current_planet]).upper()
6 StockPricesDask = dd.from_pandas(StockPrices, npartitions=NPARTITIONS)
----> 7 StockPrices[column_name] = StockPricesDask.map_partitions(lambda df : df.apply(lambda x : int(get_degree_for_planet(x, current_planet) / 3), axis =1), meta='int').compute(scheduler='processes')
8 StockPrices[column_name] = pd.to_numeric(StockPrices[column_name], downcast='float', errors='coerce')
9 astro_columns.append(column_name)
~/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py in apply()
6876 kwds=kwds,
6877 )
-> 6878 return op.get_result()
6879
6880 def applymap(self, func) -> "DataFrame":
~/anaconda3/lib/python3.7/site-packages/pandas/core/apply.py in get_result()
184 return self.apply_raw()
185
--> 186 return self.apply_standard()
187
188 def apply_empty_result(self):
~/anaconda3/lib/python3.7/site-packages/pandas/core/apply.py in apply_standard()
294 try:
295 result = libreduction.compute_reduction(
--> 296 values, self.f, axis=self.axis, dummy=dummy, labels=labels
297 )
298 except ValueError as err:
pandas/_libs/reduction.pyx in pandas._libs.reduction.compute_reduction()
pandas/_libs/reduction.pyx in pandas._libs.reduction.Reducer.get_result()
in ()
5 column_name="ASTRO_{}_POSITION".format(PLANETS[current_planet]).upper()
6 StockPricesDask = dd.from_pandas(StockPrices, npartitions=NPARTITIONS)
----> 7 StockPrices[column_name] = StockPricesDask.map_partitions(lambda df : df.apply(lambda x : int(get_degree_for_planet(x, current_planet) / 3), axis =1), meta='int').compute(scheduler='processes')
8 StockPrices[column_name] = pd.to_numeric(StockPrices[column_name], downcast='float', errors='coerce')
9 astro_columns.append(column_name)
~/Downloads/pyAstroTrader/notebooks/helpers.py in get_degree_for_planet()
195
196 def get_degree_for_planet(row, planet):
--> 197 c_chart = charts[row['CorrectedDate']]
198 return get_degree(c_chart, planet)
199
KeyError: '2020-05-19'
What is the accuracy achieved with the current model? It would be very interesting to delve deep and motivating factor if you have found some correlation with astrological data.
This link is incorrect:
Line 12 in 80f5c7b
It's supposed to be https://www.amazon.com/Bull-Bear-Planets-Financial-Astrology/dp/1475980027
Hi,
I am quite interested in this project. When can I see the charts?
Regards
Trying to get this succesfully deployed and running into issues with calculate.py where ret_flag is being used as a comparison operator but is a tuple, and not sure which of the 5 values is the relevant one
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-9-f6ffd9385682> in <module>
4 DEFAULT_CONFIG)
5
----> 6 asset_natal_chart = calculate_chart(asset_natal_chart_input)
7 dates_to_generate = list(StockPrices['CorrectedDate'])
/home/daniel/pyAstroTrader/pyastrotrader/__init__.py in calculate_chart(input_json)
14 input_data = check_input(input_json)
15 config = load_config(input_data)
---> 16 output = generate_chart(config, input_data)
17 return output
18
/home/daniel/pyAstroTrader/pyastrotrader/calculate/calculate.py in generate_chart(config, input_data)
137 output['input'] = input_data
138 output['intermediate'] = intermediate
--> 139 output = calculate_planets(input_data, intermediate, output, config)
140 output = calculate_main_chart(input_data, intermediate, output)
141 output = calculate_planets_in_houses(output)
/home/daniel/pyAstroTrader/pyastrotrader/calculate/calculate.py in calculate_planets(input_data, intermediate, output, config)
85 'zodiac'][x] + ":" + str(x)
86 output['planets']['planets_degree'][
---> 87 i] = ret_flag[0] - deg_low
88 output['planets']['planets_degree_ut'][i] = ret_flag[0]
89 if ret_flag[3] < 0:
TypeError: unsupported operand type(s) for -: 'tuple' and 'float'
Great project would love to take a deeper look. wrote in c++ perl and php for 25 years. do you happen to have quick install cheat sheet? (never used notebooks.) sorry if that sounded lame. thanks Jim Brown
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.