rename

inconsistent migration history when changing a django app's name

谁都会走 提交于 2021-02-04 18:19:13
问题 I'm trying to rename one of the apps in my django website. There is another app which depends on it and its mysql tables. I went over all the files in both apps and changed the instances of the old name to the new one. However, now I encounter this error message when trying to perform a migration: File "/Users/Limor/anaconda/lib/python2.7/site-packages/Django-1.10a1-py2.7.egg/django/db/migrations/loader.py", line 287, in check_consistent_history migration[0], migration[1], parent[0], parent[1

inconsistent migration history when changing a django app's name

允我心安 提交于 2021-02-04 18:19:06
问题 I'm trying to rename one of the apps in my django website. There is another app which depends on it and its mysql tables. I went over all the files in both apps and changed the instances of the old name to the new one. However, now I encounter this error message when trying to perform a migration: File "/Users/Limor/anaconda/lib/python2.7/site-packages/Django-1.10a1-py2.7.egg/django/db/migrations/loader.py", line 287, in check_consistent_history migration[0], migration[1], parent[0], parent[1

Change values in a column from a list

柔情痞子 提交于 2021-01-30 09:08:50
问题 I've got a dataframe with my index 'Country' I want to change the name of multiple countries, I have the old/new values in a dictionary, like below: I tried splitting the values in a from list and to list, and that wouldn't work either. The code doesn't error, but the values in my dataframe haven't changed. `import pandas as pd import numpy as np energy = (pd.read_excel('Energy Indicators.xls', skiprows=17, skip_footer=38)) energy = (energy.drop(energy.columns[[0, 1]], axis=1)) energy.columns

Change values in a column from a list

旧街凉风 提交于 2021-01-30 09:05:32
问题 I've got a dataframe with my index 'Country' I want to change the name of multiple countries, I have the old/new values in a dictionary, like below: I tried splitting the values in a from list and to list, and that wouldn't work either. The code doesn't error, but the values in my dataframe haven't changed. `import pandas as pd import numpy as np energy = (pd.read_excel('Energy Indicators.xls', skiprows=17, skip_footer=38)) energy = (energy.drop(energy.columns[[0, 1]], axis=1)) energy.columns

Windows Error: 32 when trying to rename file in python

人盡茶涼 提交于 2021-01-29 07:00:54
问题 I'm trying to rename some PDF files using pyPdf and my code it seems to work fine until it reaches the rename sentence. The While/if block of code looks for the page number where string "This string" is located and when found stops. Having the page number the "new name" is created. My issue is that even when the with block it's supposed to close automatically the file, when it's reached the rename sentence I get the error below Traceback (most recent call last): File "<stdin>", line 14, in

Giving a different object name for the content of the returned list of purrr::map2()

◇◆丶佛笑我妖孽 提交于 2021-01-28 07:14:27
问题 I'm trying to conduct a certain a calculation using purrr::map2() taking two different arguments. purrr::map2( .x = c(1, 3), .y = c(10, 20), function(.x, .y)rnorm(1, .x, .y) ) purrr::map2() returns a list, but I want to assign a distinct object name to each content within the list. For example, I want to name the first list [[1]] [1] -5.962716 as model1 and [[2]] [1] -29.58825 as model2 . In other words, I'd like to automate the object naming like model* <- purrr::map2[[*]] . Would anybody

Photoshop rename to layer name

故事扮演 提交于 2021-01-28 07:01:14
问题 I need a script to choose a folder, open the Photoshop files in the folder, then rename the files to the current name of layer plus the file extension. (Each of the layers will be named differently as the images have been created with a data merge. All I have so far is opening one image and getting the layer name, I can't figure out the repeat and the rename of the file: set inputFolder to choose folder tell application "Finder" set filesList to files in inputFolder set myDoc to item 1 of

How can I remove the last n characters of filenames in a certain directory (in Mac terminal)- unix?

流过昼夜 提交于 2021-01-28 05:43:21
问题 I am trying to rename using "mv", because "rename" command doesn't work in my Mac terminal. I have a bunch of files named DTM001_ACGGT-TTAGGC.fq DTM156_GGTTG-ACAGTG.fq ...etc I wish to rename them to DTM001.fq DTM156.fq I suppose the easier way is to remove the last 13 characters before the file extension? I tried these links: mac os x terminal batch rename Rename file by removing last n characters Removing last n characters from Unix Filename before the extension but none have worked for me,

massive rename on terminal and sequentially numbered

旧时模样 提交于 2021-01-27 17:38:50
问题 I want to rename a lot of files (some jpg and a lot of png files) I need them sequentially numbered on each folder have this structure: .../folder01 file.png file.jpg .../folder02 file.png file.png .......... .../folder05 file.png file.png and I want something like this: .../folder01 0001.jpg 0002.png .../folder02 0003.png 0004.png .......... .../folder05 0012.png 0013.png how can I make it using bash? 回答1: Here's one way: find . \( -name '*.jpg' -o -name '*.png' \) -print | (i=0; while read

rename file name (persian/farsi/arabic) in php

我只是一个虾纸丫 提交于 2021-01-27 08:49:07
问题 i want to rename file in php when file name is persian(farsi/arabic). file name: 'ش' and i want to rename 'a' and this code not work: rename("ش", "a"); result: Warning: rename(ش,a): The system cannot find the file specified. (code: 2) in C:\xampp_new\htdocs\vira2\test.php on line 5 PHP Version 5.6.3 on Xampp on Windows 回答1: Edit: <?php setlocale(LC_ALL, 'ar'); mkdir('ش'); rename('ش', 'a'); 回答2: You have to include the path of the file. <?php rename("c\ش", "c\a"); ?> 来源: https://stackoverflow