System.FormatException: Input string was not in a correct format. #1194
ArtemHachaturov
started this conversation in
Help and support
Replies: 2 comments 9 replies
-
Let us know if these conversations helps resolve your issue: |
Beta Was this translation helpful? Give feedback.
8 replies
-
I think we're going to need to setup a rather elaborate set of tests using different local settings on a GitHub Actions runner to better understand exactly what's happening. It's difficult to test on a local computer, and I'm not 100% confident I know what's happening. Any one of these can be a problem if they're not aligned on locale for date/time and numerics:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, please help me, I’ve been suffering for two days now, I have a problem with converting data to a decimal fraction, float, and specifically with
import pandas as pd
from stock_indicators import Quote
Read the CSV file
df = pd.read_csv('./quotes.csv', parse_dates=['Time'])
quotes = [
Quote(date, open, high, low, close, volume)
for date, open, high, low, close, volume
in zip(df['Time'],
df['Open'],
df['High'],
df['Low'],
df['Close'],
df['Volume'], strict=True)]
print(quotes)
Traceback (most recent call last):
File "C:\Users\russt\AppData\Local\Programs\Python\Python311\Lib\site-packages\stock_indicators_cstypes\decimal.py", line 22, in new
return CsDecimal.Parse(str(decimal))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
at System.Decimal.Parse(String s)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "e:\Binance Bot\python\13.py", line 8, in
quotes = [
^
File "e:\Binance Bot\python\13.py", line 9, in
Quote(date, open, high, low, close, volume)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\russt\AppData\Local\Programs\Python\Python311\Lib\site-packages\stock_indicators\indicators\common\quote.py", line 61, in init
self.open: Decimal = open if open else 0
^^^^^^^^^
File "C:\Users\russt\AppData\Local\Programs\Python\Python311\Lib\site-packages\stock_indicators\indicators\common\quote.py", line 25, in _set_open
quote.Open = CsDecimal(value)
^^^^^^^^^^^^^^^^
File "C:\Users\russt\AppData\Local\Programs\Python\Python311\Lib\site-packages\stock_indicators_cstypes\decimal.py", line 24, in new
raise ValueError("You may be using numeric data that is incompatible with your locale environment settings.\n"
ValueError: You may be using numeric data that is incompatible with your locale environment settings.
For example, you may be using decimal points instead of commas.
quotes.csv
Beta Was this translation helpful? Give feedback.
All reactions