Skip to content

Instantly share code, notes, and snippets.

View ta3113ta's full-sized avatar
🎯
Focusing

Ta ta3113ta

🎯
Focusing
View GitHub Profile
@ksafranski
ksafranski / Common-Currency.json
Last active July 24, 2024 16:40
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@Keiku
Keiku / convert_number_strings_to_numbers.py
Last active January 8, 2023 20:45
Convert number strings with commas in pandas DataFrame to float.
import pandas as pd
import locale
from locale import atof
df = pd.DataFrame([['1,200', '4,200'], ['7,000', '-0.03'], ['5', '0']],
columns=['col1', 'col2'])
# col1 col2
# 0 1,200 4,200
# 1 7,000 -0.03
# 2 5 0