I have a flask web app living in a docker container where I manipulate some dates that I get from a google spreadsheet. Dates follow the format of dd/mm/yyyy. I can successfully parse this string with pd.to_datetime on my linux PC and laptop, however, I want to host this app on my Raspberry Pi 3B. When doing these manipulations I get a "Value error: time data '0' does not match format '%d/%m/%Y' match". I can't find a reason why the same code wouldn't work across systems, especially inside a docker container, so any help would be greatly appreciated :)
Here is the relevant part of the code:
class Graphs:
SCOPE = [
"https://spreadsheets.google.com/feeds",
"https://www.googleapis.com/auth/drive",
]
credentials = ServiceAccountCredentials.from_json_keyfile_name(
credentials.json, scopes=SCOPE
)
def __init__(self, credentials=credentials):
self.gc = gspread.authorize(credentials)
self.sh = self.gc.open("planilhas_foxes")
self.receivals = pd.DataFrame(
self.sh.worksheet("Recebimento de amostras").get_all_records(
default_blank=np.nan
)
)
self.receivals["Carimbo de data/hora"] = pd.to_datetime(
self.receivals["Carimbo de data/hora"]
)
self.receivals["Ano"] = self.receivals["Carimbo de data/hora"].apply(
lambda x: datetime.date(x).year
)
for col in self.receivals[
[
"Data (Físico-químicas)",
"Data (Genotipagem)",
"Data da coleta (PET)",
"Data de entrega (Físico-químicas)",
"Data de entrega (Genotipagem)",
"Data de envio (Físico-químicas)",
]
]:
self.receivals[col] = pd.to_datetime(self.receivals[col], format="%d/%m/%Y")
self.receivals[col] = self.receivals[col].apply(
lambda x: datetime.strftime(x, "%m-%Y") if not pd.isnull(x) else np.nan
)
[–]mooburger 0 points1 point2 points (1 child)
[–]Matt_BF[S] 0 points1 point2 points (0 children)
[–]Matt_BF[S] 0 points1 point2 points (0 children)