array

目录

@(Leetcode)

Array

Easy

219. Contains Duplicate II

Question: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k.

Idea: Using hashmap, array value save as key and index save as values in the map, then judge whether the map contain key = nums[i], and get value through the key, judge the distance between index i and map values.

Time and space complex:
Time complex: O(N)
Space complex: O(N)

public class Solution {
    public boolean containsNearbyDuplicate(int[] nums, int k) {
        HashMap<Integer, Integer> map = new HashMap<>();
        for(int i = 0; i < nums.length; i++) {
            if(map.containsKey(nums[i]) && (i - map.get(nums[i])) <= k ) {
                return true;
            }
            map.put(nums[i], i);
        }
        return false;
    }
}
No bug free: erro to judge the distance between i and map value is less than k, (i - map.get(nums[i]) <= k) write into (i - map.get(nums[i]) == k)

217. Contains Duplicate

Question: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.

Idea: Using hash set to save the array values, if the set has already cantains the value, return true, else return false.

Other idea: O(N^2) : two loop, judge nums[i] == nums[j]
O(N log (N)): sort array first, then O(N) loop to judge whether the previous value equal to its following values nums[i] == nums[i+ 1]

Time and space complex: O(N) : Using hash set

public class Solution {
    public boolean containsDuplicate(int[] nums) {
        HashSet set = new HashSet();
        for(int i = 0; i < nums.length; i++) {
            if(set.contains(nums[i])) {
                return true;
            }
            set.add(nums[i]);
        }
        return false;
    }
}
Not bug free : Error using set method set.put(value), right method is set.add(value)

66. Plus One

Question: Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list.

Idea: Carefull about the problem and it said the most significant digit is at the head of the list, so Array digits[0] is the must the significant number. What we need to do is check the lowest digit of the number, which means that from the digits[digits.length - 1] to check whether there is a digit less than 9, if there is, let this digit plus one and return, else means the number is all 9, increase the array one bit and let the highest bit of the number(digits[0]) set to 1.

Time complex: O(N)
Space complex: O(1)

public class Solution {
    public int[] plusOne(int[] digits) {
        // 1 2 3 4 5 find a number less than 9 can let it plus one and return
        for(int i = digits.length - 1; i >= 0; i--) {
            if(digits[i] < 9) {
                digits[i]++;
                return digits;
            }
            digits[i] = 0;
        }
        int[] newDigits = new int[digits.length + 1];
        newDigits[0] = 1;
        return newDigits;
    }
}
Not bug free: 1) Wrong understand the digit position, significant bit is digits[0], 2) using undefined variable name n, n is the length of digits, remember to define variable first.

67. Add Binary

Question: Given two binary strings, return their sum (also a binary string).

For example,
a = "11"
b = "1"
Return "100".

Idea: Using a StringBuilder to maintain the result bit by bit, add the bit from the highest bit, and using a tag carry to save the carry result. pluse ASCII values of a and b in the corresponding position. Then add the sum result to StringBuilder , Finally, update the carry value and sum utill all the bits have been added. Finished while loop, check carry bit, if it is not 0, append it to the result, the reverse the result and save it to String.

Time complex: O(N)

public class Solution {
    public String addBinary(String a, String b) {
        StringBuilder bf = new StringBuilder();
        int aLength = a.length() - 1;
        int bLength = b.length() - 1;
        int carry = 0;
        while(aLength >= 0 || bLength >= 0) {
            int sum = 0;
            if(aLength >= 0) {
                sum += a.charAt(aLength--) - '0';
            }
            if(bLength >= 0) {
                sum += b.charAt(bLength--) - '0';
            }
            sum += carry;
            carry = sum / 2;   // remember the sequence
            sum = sum % 2;
            bf.append(sum);
        }
        if(carry != 0) bf.append(carry);
        return bf.reverse().toString();
    }
}
Not bug free : 1) Index of a and b String, remember to check the length - 1, and while loop check condition is aLength >= 0 or bLength >= 0 2) finally update sum and carry, first update carry then update sum, because the sum will be cover. 3) Out of while loop, remember to check carry again.

228. Summary Ranges

Question: Given a sorted integer array without duplicates, return the summary of its ranges.

For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].

Idea: Using a ArrayList save the result, Force brute traverse the array, save the first value of each loop, check the current value whether equals to its previous value plus one, if it is, increase the index. Finally, check current value with the saved first value. if they are the same, save the value as this range values, otherwise. save the first value + "->" + current values.

Time complex: O(N)

public class Solution {
    public List<String> summaryRanges(int[] nums) {
        ArrayList<String> result = new ArrayList<>();
        for(int i = 0; i < nums.length; i++) {
            int start = nums[i];
            while(i < nums.length - 1 && nums[i+1] - nums[i] == 1) {
                i++;
            }
            if(start == nums[i]) {
                result.add(start + "");
            } else {
                result.add(start + "->" + nums[i]);
            }
        }
        return result;
    }
}
Not bug free: 1) Do not consider to complex. traversal the array from index 0 and the boundary condition is nums.length -1 2) finally check save previous value with current array value whether is the same start == nums[i], where the nums[i] is not continuous with it previous.

189. Rotate Array

Question: Rotate an array of n elements to the right by k steps.

For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]

Idea: 1) Using extra space to save the result and then copy the result back to nums 2) reverse the array three times. First reverse the whole array, and according k divide the array into two parts, reverse the two part separately.
// extra space
public void rotate(int[] nums, int k) {
        int[] result = new int[nums.length];
        for(int i = 0; i < nums.length; i++) {
            result[(i + k) % nums.length] = nums[i];
        }
        for(int i = 0; i < nums.length; i++) {
            nums[i] = result[i];
        }
    }
// O(1) space and O(n) time complex
public void rotate(int[] nums, int k) {
        k = k % nums.length;
        reverse(nums, 0, nums.length - 1);
        reverse(nums, 0, k - 1);
        reverse(nums, k, nums.length - 1);
    }
    public void reverse(int[] nums, int start, int end) {
        while(start <= end) {
            int temp = nums[start];
            nums[start] = nums[end];
            nums[end] = temp;
            start++;
            end--;
        }
    }
Not bug free: 1) reverse verstion: k can be more than nums.length, remember to mod nums.length; 2) reverse two part, one part have k number element, so the index remember to be k - 1; 3) extra space version: know how to copy a array, result[(i + k) % nums.length] = nums[i] finding the relationship between nums and results.

27. Remove Element

Question: Given an array and a value, remove all instances of that value in place and return the new length.

The order of elements can be changed. It doesn't matter what you leave beyond the new length.

Idea: Finding the given value, and just cover the value with the following values in the array. So copy all the non-given values into the array from 0 one by one. eg: 0 1 2 0 4 5 6(0) -> 1 2 3 4 5 6

Time complex: O(N)

public int removeElement(int[] nums, int val) {
        int index = 0;
        for(int i = 0; i < nums.length; i++) {
            if(nums[i] != val) {
                nums[index] = nums[i];
                index++;
            }
        }
        return index;
    }
Bug free for this idea. But the tag show two pointer did not figure out, My idea is move all the given value into behand the array using two pointer. !!! (Should figure out)

26. Remove Duplicates from Sorted Array

Question: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.

Do not allocate extra space for another array, you must do this in place with constant memory.

For example,
Given input array nums = [1,1,2],

Your function should return length = 2, with the first two elements of nums being 1 and 2 respectively. It doesn't matter what you leave beyond the new length.

Idea: (Two pointer) one pointer i indicate the result save position in the array and show the current appeared values, the other pointer to find the difference value and save it to nums[i + 1]

Time complex: O(n)

public class Solution {
    public int removeDuplicates(int[] nums) {
        if(nums == null || nums.length == 0){
            return 0;
        }
        int i = 0;
        int j = 0;
        int index = 0;
        while(j < nums.length) {
            j++;
            while(j < nums.length && nums[i] == nums[j]) {
                j++;   // break means nums[j] is a new value
            }
            nums[index++] = nums[i];
            i = j;
        }
        return index;
    }
}
Not bug free: 1) if(nums == null || nums.length == 0) remember to consider the inference of position || consider the condition on left or on right, put the more strict condition on left. 2) The same as (j < nums.length && nums[i] == nums[j] 3) Always considers i++. use first and then plus one

1. Two Sum

Question: Given an array of integers, return indices of the two numbers such that they add up to a specific target.

You may assume that each input would have exactly one solution.

Example:
Given nums = [2, 7, 11, 15], target = 9,

Because nums[0] + nums[1] = 2 + 7 = 9,
return [0, 1].

Idea: 1) force brute search, two for loop to find whether two values sum is target or not. Time complex: O(N2), space complex is O(1)
2) Using hashMap to save index and value in pairs. keep value as key and index as values. Time complex: O(N) and space complex: O(N)
public int[] twoSum(int[] nums, int target) {
        // force brute research (n2)
        for(int i = 0; i < nums.length; i++) {
            for(int j = i + 1; j < nums.length; j++) {
                if(nums[i] + nums[j] == target) {
                    return new int[]{i, j};
                }
            }
        }
        return null;
    }
Bug free !!!! Good job.
public int[] twoSum(int[] nums, int target) {
    // hashTable O(N)
        HashMap<Integer, Integer> map = new HashMap<>();
        for(int i = 0; i < nums.length; i++) {
            if(map.get(target - nums[i]) != null ) {
                return new int[]{map.get(target - nums[i]), i};
            }
            map.put(nums[i], i);
        }
        return null;
}
Not bug free: when defince hashMap remember to indicate the Type of its key and value. HashMap<Integer, Integer> map = new HashMap<>(); I forgot indicate HashMap<Integer, Integer>.

118. Pascal's Triangle My Submissions Question

Question: Given numRows, generate the first numRows of Pascal's triangle.

For example, given numRows = 5,
Return

[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]]

Idea 1: Using extra space, use a prev arrayList to save the previous line, and a level represents current live of pascal's triangle, using the prev line to update the level line, then add level line into result.

Time complex: O(N2)
Space complex: O(N)

// extra space
public class Solution {
    public List<List<Integer>> generate(int numRows) {
        List<List<Integer>> result = new ArrayList<List<Integer>>();
        if(numRows == 0) return result;
        ArrayList<Integer> prev = new ArrayList<Integer>();
        prev.add(1);
        result.add(prev);
        for(int i = 2; i <= numRows; i++) {
            ArrayList<Integer> level = new ArrayList<Integer>();
            for(int j = 0; j < i; j++) {
                if(j == 0 || (j == i - 1)) {
                    level.add(1);
                } else {
                    level.add(prev.get(j) + prev.get(j - 1));
                }
            }
            result.add(level);
            prev = level;
        }
        return result;
    }
}
Not bug free : 1) using level.set(j, 1), right: level.add(1);, know the difference between set() and add(), when the arrayList exists, then use set(index, value) to replace the original position values. But add() means to append a value in the arrayList, the original position have no values.
Idea 2: Using a arrayList to update each row, and then add the row into result two dimension array.

Time complex: O(N2)
Space complex: O(N)

    public List<List<Integer>> generate(int numRows){
        List<List<Integer>> result = new ArrayList<List<Integer>>();
        ArrayList<Integer> row = new ArrayList<Integer>();
        for(int i = 0; i < numRows; i++) {
            row.add(0, 1);  // from row beginning insert a 1, row has numRows 1
            for(int j = 1; j < row.size() - 1; j++) {
                row.set(j, row.get(j) + row.get(j + 1));   //update j position values
            }
            result.add(new ArrayList<Integer>(row));    // row do not been erased
        }
        return result;
     }

119. Pascal's Triangle II

Question: Given an index k, return the kth row of the Pascal's triangle.

For example, given k = 3,
Return [1,3,3,1].Given an index k, return the kth row of the Pascal's triangle.

For example, given k = 3,
Return [1,3,3,1].

Idea 1: Using extra space to save the temp arrayList values, then update the result according the previous line (temp arryLsit)

Time complex: O(N2)
Space complex: O(N)

public class Solution {
    public List<Integer> getRow(int rowIndex) {
        ArrayList<Integer> result = new ArrayList<Integer>();
        result.add(1);
        for(int i = 1; i <= rowIndex; i++) {
            ArrayList temp = new ArrayList<Integer>();
             for(int j = 0; j <= i; j++) {
                 if(j == 0 || j == i) {
                     temp.add(1);
                 } else {
                     temp.add(result.get(j) + result.get(j - 1));
                 }
             }
             result = temp;
        }
        return result;
    }
}
Idea 2: No extra space, just using a arrayList to update the element in the array from index 1 to a.size() - 1, each time, insert a 1 at the beginning, then replace the following values one by one.

Time complex: O(N2)
Space complex: O(N)

public class Solution {
    public List<Integer> getRow(int rowIndex) {
        ArrayList<Integer> row = new ArrayList<Integer>();
        for(int i = 0; i <= rowIndex; i++) {
            row.add(0,1);
            for(int j = 1; j < row.size() - 1; j++) {
                row.set(j, row.get(j) + row.get(j+1));
            }
        }
        return row;
    }
}
Bug: The same with pascal's triangle | , discriminate add() and set()

283. Move Zeroes

Question: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.

For example, given nums = [0, 1, 0, 3, 12], after calling your function, nums should be [1, 3, 12, 0, 0].

Note:
You must do this in-place without making a copy of the array.
Minimize the total number of operations.

Idea 1: moving non-zero value to the beginning of the array, and then insert the result of the array with zero 0.

Time complex: O(N)

public class Solution {
    public void moveZeroes(int[] nums) {
        int index = 0;
        for(int i = 0; i < nums.length; i++) {
            if(nums[i] != 0) {
                nums[index++] = nums[i];
            }
        }
        while(index < nums.length) {
            nums[index++] = 0;
        }
    }
}
Bug free! Good job.
Idea 2: swap 0 with following non-zero value
public void moveZeroes(int[] nums) {
        int zeroPosition = 0;
        for(int i = 0; i < nums.length; i++) {
            if(nums[i] == 0) {
                zeroPosition++;
                continue;   // ignore the following exchange
            }
            int temp = nums[i - zeroPosition];
            nums[i - zeroPosition] = nums[i];
            nums[i] = temp;
        }
    }
Bug free! Good job.

88. Merge Sorted Array

Question: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.

Note:
You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional elements from nums2. The number of elements initialized in nums1 and nums2 are m and n respectively.

Idea: Compare two array values from the end of array, move the bigger one into nums1 for m + n - 1 to fill with the big value. Unitl all the element in the two array have been move to nums1. If m > n, the left m in nums1 need not to move, they are already in the right position. If left n, move all left n values from nums2 into nums1.

Time complex: O(N)
Space complex: O(1)

public class Solution {
    public void merge(int[] nums1, int m, int[] nums2, int n) {
        while(m > 0 && n > 0) {
            if(nums1[m - 1] > nums2[n - 1]) {
                nums1[m + n - 1] = nums1[m - 1];
                m--;
            } else {
                nums1[m + n - 1] = nums2[n - 1];
                n--;
            }
        }
        while(n > 0) {
            nums1[m + n - 1] = nums2[n - 1];
            n--;
        }
    }
}
Not bug free: 1) Notice the index of nums1 and nums2, the last element in nums1 is nums1[m - 1] and the last element of nums2[n - 1]. 2) when move one element. remember to update the cooperate index.

169. Majority Element

Question: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.

You may assume that the array is non-empty and the majority element always exist in the array.

Idea: using a count to indicate the major, save the first one value as major, then if it is the same value, increase count. if it is different value. decrease the count, when count decrease to 0, update mojor value. Finally return the major value. This problem do not consider the test case do not have the majority element. This algorithm, when count bigger than 0 means than major element have appeared more than n/2 times.
public class Solution {
    public int majorityElement(int[] nums) {
        int count = 0;
        int major = 0;
        for(int i = 0; i < nums.length; i++) {
            if(count == 0) {
                count++;
                major = nums[i];
            } else if(nums[i] == major){
                count++;
            } else {
                count--;
            }
        }
        // System.out.println(count);
        return major;                    // once count bigger then 0, means that the major appear more than n/2 times
        // if(count > 0) {
        //     return major;
        // } else {
        //     return 0;
        // }
    }
}
Not bug free: 1) if count == 0, update major value, when nums[i] is major, increase count, otherwise, when nums[i] is not equals to major, decrease count. Finally when count bigger than 0, major is the result, otherwise, there is no majority elements exsits.

Medium

220. Contains Duplicate III

Question: Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j] is at most t and the difference between i and j is at most k.

补充知识点:Binary search tree:
functionArray(unsorted)LinkedListArray(sorted)BST
search(x)O(N)O(N)O(log(n))O(log(n))
insert(x)0(1)O(1)O(N)O(log(n))
remove(x)O(N)O(N)O(N)O(log(n))

Binary search tree is a binary tree in which for each node, value of all the nodes in left subtree is lesser or equal and value of all the nodes in right subtree is greater. (balance and unbalance, if unbalance, it is the woset case, O(N(log(n))))
Alt text

TreeSet : have two method, foor() and ceiling();
Alt text

Idea : finding the boundary nums[i] - t and nums[i] + t, save the values in the boundary into a set, maintain the index distance is k, then maintain the index distance k, traverse the the set to find nums[i] whether is within the boundary.

Time complex: N log (K) K is the sub set size, N is length of the array.

public class Solution {
    public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {
        TreeSet<Integer> set = new TreeSet<>();
        for(int i = 0; i < nums.length; i++) {
            Integer floor = set.floor(nums[i] + t);
            Integer ceil = set.ceiling(nums[i] - t);
            if((floor != null && floor >= nums[i]) || (ceil != null && ceil <= nums[i])) {
                return true;
            }
            set.add(nums[i]);
            if(i >= k) {
                set.remove(nums[i - k]);
            }
        }
        return false;
    }
}
Not bug free: 1) Missing punctuation 2) Miss s for nums 3) Missing return statement out of for loop, at the end of code !!!! 4) Remember use of TreeSet

转载于:https://www.cnblogs.com/auspicious1123/p/5319264.html

处理股票 SZsz300755 失败: input array type is not double 处理股票 SZsz300756 失败: input array type is not double 处理股票 SZsz300757 失败: input array type is not double 处理股票 SZsz300758 失败: input array type is not double 处理股票 SZsz300759 失败: input array type is not double 处理股票 SZsz300760 失败: input array type is not double 处理股票 SZsz300761 失败: input array type is not double 处理股票 SZsz300762 失败: input array type is not double 处理股票 SZsz300763 失败: input array type is not double 处理股票 SZsz300765 失败: input array type is not double 处理股票 SZsz300766 失败: input array type is not double 处理股票 SZsz300767 失败: input array type is not double 处理股票 SZsz300768 失败: input array type is not double 处理股票 SZsz300769 失败: input array type is not double 处理股票 SZsz300770 失败: input array type is not double 处理股票 SZsz300771 失败: input array type is not double 处理股票 SZsz300772 失败: input array type is not double 处理股票 SZsz300773 失败: input array type is not double 处理股票 SZsz300775 失败: input array type is not double 处理股票 SZsz300776 失败: input array type is not double 处理股票 SZsz300777 失败: input array type is not double 处理股票 SZsz300778 失败: input array type is not double 处理股票 SZsz300779 失败: input array type is not double 处理股票 SZsz300780 失败: input array type is not double 处理股票 SZsz300781 失败: input array type is not double 处理股票 SZsz300782 失败: input array type is not double 处理股票 SZsz300783 失败: input array type is not double 处理股票 SZsz300785 失败: input array type is not double 处理股票 SZsz300786 失败: input array type is not double 处理股票 SZsz300787 失败: input array type is not double 处理股票 SZsz300788 失败: input array type is not double 处理股票 SZsz300789 失败: input array type is not double 处理股票 SZsz300790 失败: input array type is not double 处理股票数据: 95%|█████████▍| 6371/6720 [00:15<00:00, 437.00it/s]处理股票 SZsz300791 失败: input array type is not double 处理股票 SZsz300792 失败: input array type is not double 处理股票 SZsz300793 失败: input array type is not double 处理股票 SZsz300795 失败: input array type is not double 处理股票 SZsz300796 失败: input array type is not double 处理股票 SZsz300797 失败: input array type is not double 处理股票 SZsz300798 失败: input array type is not double 处理股票 SZsz300799 失败: input array type is not double 处理股票 SZsz300800 失败: input array type is not double 处理股票 SZsz300801 失败: input array type is not double 处理股票 SZsz300802 失败: input array type is not double 处理股票 SZsz300803 失败: input array type is not double 处理股票 SZsz300805 失败: input array type is not double 处理股票 SZsz300806 失败: input array type is not double 处理股票 SZsz300807 失败: input array type is not double 处理股票 SZsz300808 失败: input array type is not double 处理股票 SZsz300809 失败: input array type is not double 处理股票 SZsz300810 失败: input array type is not double 处理股票 SZsz300811 失败: input array type is not double 处理股票 SZsz300812 失败: input array type is not double 处理股票 SZsz300813 失败: input array type is not double 处理股票 SZsz300815 失败: input array type is not double 处理股票 SZsz300816 失败: input array type is not double 处理股票 SZsz300817 失败: input array type is not double 处理股票 SZsz300818 失败: input array type is not double 处理股票 SZsz300819 失败: input array type is not double 处理股票 SZsz300820 失败: input array type is not double 处理股票 SZsz300821 失败: input array type is not double 处理股票 SZsz300822 失败: input array type is not double 处理股票 SZsz300823 失败: input array type is not double 处理股票 SZsz300824 失败: input array type is not double 处理股票 SZsz300825 失败: input array type is not double 处理股票 SZsz300826 失败: input array type is not double 处理股票 SZsz300827 失败: input array type is not double 处理股票 SZsz300828 失败: input array type is not double 处理股票 SZsz300829 失败: input array type is not double 处理股票 SZsz300830 失败: input array type is not double 处理股票 SZsz300831 失败: input array type is not double 处理股票 SZsz300832 失败: input array type is not double 处理股票 SZsz300833 失败: input array type is not double 处理股票 SZsz300835 失败: input array type is not double 处理股票 SZsz300836 失败: input array type is not double 处理股票 SZsz300837 失败: input array type is not double 处理股票 SZsz300838 失败: input array type is not double 处理股票 SZsz300839 失败: input array type is not double 处理股票 SZsz300840 失败: input array type is not double 处理股票 SZsz300841 失败: input array type is not double 处理股票 SZsz300842 失败: input array type is not double 处理股票 SZsz300843 失败: input array type is not double 处理股票 SZsz300845 失败: input array type is not double 处理股票 SZsz300846 失败: input array type is not double 处理股票 SZsz300847 失败: input array type is not double 处理股票 SZsz300848 失败: input array type is not double 处理股票 SZsz300849 失败: input array type is not double 处理股票 SZsz300850 失败: input array type is not double 处理股票 SZsz300851 失败: input array type is not double 处理股票 SZsz300852 失败: input array type is not double 处理股票 SZsz300853 失败: input array type is not double 处理股票 SZsz300855 失败: input array type is not double 处理股票 SZsz300856 失败: input array type is not double 处理股票 SZsz300857 失败: input array type is not double 处理股票 SZsz300858 失败: input array type is not double 处理股票 SZsz302132 失败: input array type is not double 处理股票 SZsz399001 失败: input array type is not double 处理股票 SZsz399002 失败: input array type is not double 处理股票 SZsz399003 失败: input array type is not double 处理股票 SZsz399004 失败: input array type is not double 处理股票 SZsz399005 失败: input array type is not double 处理股票 SZsz399006 失败: input array type is not double 处理股票 SZsz399007 失败: input array type is not double 处理股票 SZsz399008 失败: input array type is not double 处理股票 SZsz399009 失败: input array type is not double 处理股票 SZsz399010 失败: input array type is not double 处理股票 SZsz399011 失败: input array type is not double 处理股票 SZsz399012 失败: input array type is not double 处理股票 SZsz399013 失败: input array type is not double 处理股票 SZsz399015 失败: input array type is not double 处理股票 SZsz399016 失败: input array type is not double 处理股票 SZsz399017 失败: input array type is not double 处理股票 SZsz399018 失败: input array type is not double 处理股票 SZsz399019 失败: input array type is not double 处理股票 SZsz399020 失败: input array type is not double 处理股票 SZsz399050 失败: input array type is not double 处理股票 SZsz399088 失败: input array type is not double 处理股票 SZsz399100 失败: input array type is not double 处理股票 SZsz399101 失败: input array type is not double 处理股票 SZsz399102 失败: input array type is not double 处理股票 SZsz399103 失败: input array type is not double 处理股票 SZsz399106 失败: input array type is not double 处理股票 SZsz399107 失败: input array type is not double 处理股票数据: 96%|█████████▌| 6459/6720 [00:15<00:00, 431.42it/s]处理股票 SZsz399108 失败: input array type is not double 处理股票 SZsz399231 失败: input array type is not double 处理股票 SZsz399232 失败: input array type is not double 处理股票 SZsz399233 失败: input array type is not double 处理股票 SZsz399234 失败: input array type is not double 处理股票 SZsz399235 失败: input array type is not double 处理股票 SZsz399236 失败: input array type is not double 处理股票 SZsz399237 失败: input array type is not double 处理股票 SZsz399238 失败: input array type is not double 处理股票 SZsz399239 失败: input array type is not double 处理股票 SZsz399240 失败: input array type is not double 处理股票 SZsz399241 失败: input array type is not double 处理股票 SZsz399242 失败: input array type is not double 处理股票 SZsz399243 失败: input array type is not double 处理股票 SZsz399244 失败: input array type is not double 处理股票 SZsz399248 失败: input array type is not double 处理股票 SZsz399249 失败: input array type is not double 处理股票 SZsz399262 失败: input array type is not double 处理股票 SZsz399263 失败: input array type is not double 处理股票 SZsz399264 失败: input array type is not double 处理股票 SZsz399265 失败: input array type is not double 处理股票 SZsz399266 失败: input array type is not double 处理股票 SZsz399275 失败: input array type is not double 处理股票 SZsz399276 失败: input array type is not double 处理股票 SZsz399277 失败: input array type is not double 处理股票 SZsz399278 失败: input array type is not double 处理股票 SZsz399279 失败: input array type is not double 处理股票 SZsz399280 失败: input array type is not double 处理股票 SZsz399281 失败: input array type is not double 处理股票 SZsz399282 失败: input array type is not double 处理股票 SZsz399283 失败: input array type is not double 处理股票 SZsz399284 失败: input array type is not double 处理股票 SZsz399285 失败: input array type is not double 处理股票 SZsz399286 失败: input array type is not double 处理股票 SZsz399290 失败: input array type is not double 处理股票 SZsz399291 失败: input array type is not double 处理股票 SZsz399292 失败: input array type is not double 处理股票 SZsz399293 失败: input array type is not double 处理股票 SZsz399294 失败: input array type is not double 处理股票 SZsz399295 失败: input array type is not double 处理股票 SZsz399296 失败: input array type is not double 处理股票 SZsz399297 失败: input array type is not double 处理股票 SZsz399298 失败: input array type is not double 处理股票 SZsz399299 失败: input array type is not double 处理股票 SZsz399300 失败: input array type is not double 处理股票 SZsz399301 失败: input array type is not double 处理股票 SZsz399302 失败: input array type is not double 处理股票 SZsz399303 失败: input array type is not double 处理股票 SZsz399306 失败: input array type is not double 处理股票 SZsz399307 失败: input array type is not double 处理股票 SZsz399310 失败: input array type is not double 处理股票 SZsz399311 失败: input array type is not double 处理股票 SZsz399312 失败: input array type is not double 处理股票 SZsz399313 失败: input array type is not double 处理股票 SZsz399314 失败: input array type is not double 处理股票 SZsz399315 失败: input array type is not double 处理股票 SZsz399316 失败: input array type is not double 处理股票 SZsz399317 失败: input array type is not double 处理股票 SZsz399318 失败: input array type is not double 处理股票 SZsz399319 失败: input array type is not double 处理股票 SZsz399320 失败: input array type is not double 处理股票 SZsz399321 失败: input array type is not double 处理股票 SZsz399322 失败: input array type is not double 处理股票 SZsz399324 失败: input array type is not double 处理股票 SZsz399326 失败: input array type is not double 处理股票 SZsz399328 失败: input array type is not double 处理股票 SZsz399330 失败: input array type is not double 处理股票 SZsz399333 失败: input array type is not double 处理股票 SZsz399335 失败: input array type is not double 处理股票 SZsz399337 失败: input array type is not double 处理股票 SZsz399339 失败: input array type is not double 处理股票 SZsz399341 失败: input array type is not double 处理股票 SZsz399344 失败: input array type is not double 处理股票 SZsz399346 失败: input array type is not double 处理股票 SZsz399348 失败: input array type is not double 处理股票 SZsz399350 失败: input array type is not double 处理股票 SZsz399351 失败: input array type is not double 处理股票 SZsz399352 失败: input array type is not double 处理股票 SZsz399353 失败: input array type is not double 处理股票 SZsz399354 失败: input array type is not double 处理股票 SZsz399355 失败: input array type is not double 处理股票 SZsz399356 失败: input array type is not double 处理股票 SZsz399357 失败: input array type is not double 处理股票 SZsz399358 失败: input array type is not double 处理股票 SZsz399359 失败: input array type is not double 处理股票 SZsz399360 失败: input array type is not double 处理股票 SZsz399361 失败: input array type is not double 处理股票 SZsz399362 失败: input array type is not double 处理股票数据: 97%|█████████▋| 6547/6720 [00:15<00:00, 430.39it/s]处理股票 SZsz399363 失败: input array type is not double 处理股票 SZsz399364 失败: input array type is not double 处理股票 SZsz399365 失败: input array type is not double 处理股票 SZsz399366 失败: input array type is not double 处理股票 SZsz399367 失败: input array type is not double 处理股票 SZsz399368 失败: input array type is not double 处理股票 SZsz399369 失败: input array type is not double 处理股票 SZsz399370 失败: input array type is not double 处理股票 SZsz399371 失败: input array type is not double 处理股票 SZsz399372 失败: input array type is not double 处理股票 SZsz399373 失败: input array type is not double 处理股票 SZsz399374 失败: input array type is not double 处理股票 SZsz399375 失败: input array type is not double 处理股票 SZsz399376 失败: input array type is not double 处理股票 SZsz399377 失败: input array type is not double 处理股票 SZsz399378 失败: input array type is not double 处理股票 SZsz399379 失败: input array type is not double 处理股票 SZsz399380 失败: input array type is not double 处理股票 SZsz399381 失败: input array type is not double 处理股票 SZsz399382 失败: input array type is not double 处理股票 SZsz399383 失败: input array type is not double 处理股票 SZsz399384 失败: input array type is not double 处理股票 SZsz399385 失败: input array type is not double 处理股票 SZsz399386 失败: input array type is not double 处理股票 SZsz399387 失败: input array type is not double 处理股票 SZsz399388 失败: input array type is not double 处理股票 SZsz399389 失败: input array type is not double 处理股票 SZsz399390 失败: input array type is not double 处理股票 SZsz399391 失败: input array type is not double 处理股票 SZsz399392 失败: input array type is not double 处理股票 SZsz399393 失败: input array type is not double 处理股票 SZsz399394 失败: input array type is not double 处理股票 SZsz399395 失败: input array type is not double 处理股票 SZsz399396 失败: input array type is not double 处理股票 SZsz399397 失败: input array type is not double 处理股票 SZsz399398 失败: input array type is not double 处理股票 SZsz399399 失败: input array type is not double 处理股票 SZsz399400 失败: input array type is not double 处理股票 SZsz399401 失败: input array type is not double 处理股票 SZsz399402 失败: input array type is not double 处理股票 SZsz399403 失败: input array type is not double 处理股票 SZsz399404 失败: input array type is not double 处理股票 SZsz399405 失败: input array type is not double 处理股票 SZsz399406 失败: input array type is not double 处理股票 SZsz399407 失败: input array type is not double 处理股票 SZsz399408 失败: input array type is not double 处理股票 SZsz399409 失败: input array type is not double 处理股票 SZsz399410 失败: input array type is not double 处理股票 SZsz399411 失败: input array type is not double 处理股票 SZsz399412 失败: input array type is not double 处理股票 SZsz399413 失败: input array type is not double 处理股票 SZsz399415 失败: input array type is not double 处理股票 SZsz399416 失败: input array type is not double 处理股票 SZsz399417 失败: input array type is not double 处理股票 SZsz399418 失败: input array type is not double 处理股票 SZsz399419 失败: input array type is not double 处理股票 SZsz399420 失败: input array type is not double 处理股票 SZsz399422 失败: input array type is not double 处理股票 SZsz399423 失败: input array type is not double 处理股票 SZsz399427 失败: input array type is not double 处理股票 SZsz399428 失败: input array type is not double 处理股票 SZsz399429 失败: input array type is not double 处理股票 SZsz399431 失败: input array type is not double 处理股票 SZsz399432 失败: input array type is not double 处理股票 SZsz399433 失败: input array type is not double 处理股票 SZsz399434 失败: input array type is not double 处理股票 SZsz399435 失败: input array type is not double 处理股票 SZsz399436 失败: input array type is not double 处理股票 SZsz399437 失败: input array type is not double 处理股票 SZsz399438 失败: input array type is not double 处理股票 SZsz399439 失败: input array type is not double 处理股票 SZsz399440 失败: input array type is not double 处理股票 SZsz399441 失败: input array type is not double 处理股票 SZsz399481 失败: input array type is not double 处理股票 SZsz399550 失败: input array type is not double 处理股票 SZsz399551 失败: input array type is not double 处理股票 SZsz399552 失败: input array type is not double 处理股票 SZsz399553 失败: input array type is not double 处理股票 SZsz399554 失败: input array type is not double 处理股票 SZsz399555 失败: input array type is not double 处理股票 SZsz399556 失败: input array type is not double 处理股票 SZsz399557 失败: input array type is not double 处理股票 SZsz399602 失败: input array type is not double 处理股票 SZsz399604 失败: input array type is not double 处理股票 SZsz399606 失败: input array type is not double 处理股票 SZsz399608 失败: input array type is not double 处理股票 SZsz399610 失败: input array type is not double 处理股票 SZsz399611 失败: input array type is not double 处理股票数据: 99%|█████████▊| 6635/6720 [00:15<00:00, 431.38it/s]处理股票 SZsz399612 失败: input array type is not double 处理股票 SZsz399613 失败: input array type is not double 处理股票 SZsz399614 失败: input array type is not double 处理股票 SZsz399615 失败: input array type is not double 处理股票 SZsz399616 失败: input array type is not double 处理股票 SZsz399617 失败: input array type is not double 处理股票 SZsz399618 失败: input array type is not double 处理股票 SZsz399619 失败: input array type is not double 处理股票 SZsz399620 失败: input array type is not double 处理股票 SZsz399621 失败: input array type is not double 处理股票 SZsz399622 失败: input array type is not double 处理股票 SZsz399623 失败: input array type is not double 处理股票 SZsz399624 失败: input array type is not double 处理股票 SZsz399625 失败: input array type is not double 处理股票 SZsz399626 失败: input array type is not double 处理股票 SZsz399627 失败: input array type is not double 处理股票 SZsz399628 失败: input array type is not double 处理股票 SZsz399629 失败: input array type is not double 处理股票 SZsz399630 失败: input array type is not double 处理股票 SZsz399631 失败: input array type is not double 处理股票 SZsz399632 失败: input array type is not double 处理股票 SZsz399633 失败: input array type is not double 处理股票 SZsz399634 失败: input array type is not double 处理股票 SZsz399635 失败: input array type is not double 处理股票 SZsz399636 失败: input array type is not double 处理股票 SZsz399637 失败: input array type is not double 处理股票 SZsz399638 失败: input array type is not double 处理股票 SZsz399639 失败: input array type is not double 处理股票 SZsz399640 失败: input array type is not double 处理股票 SZsz399641 失败: input array type is not double 处理股票 SZsz399642 失败: input array type is not double 处理股票 SZsz399643 失败: input array type is not double 处理股票 SZsz399644 失败: input array type is not double 处理股票 SZsz399645 失败: input array type is not double 处理股票 SZsz399646 失败: input array type is not double 处理股票 SZsz399647 失败: input array type is not double 处理股票 SZsz399648 失败: input array type is not double 处理股票 SZsz399649 失败: input array type is not double 处理股票 SZsz399650 失败: input array type is not double 处理股票 SZsz399651 失败: input array type is not double 处理股票 SZsz399652 失败: input array type is not double 处理股票 SZsz399653 失败: input array type is not double 处理股票 SZsz399654 失败: input array type is not double 处理股票 SZsz399655 失败: input array type is not double 处理股票 SZsz399656 失败: input array type is not double 处理股票 SZsz399657 失败: input array type is not double 处理股票 SZsz399658 失败: input array type is not double 处理股票 SZsz399659 失败: input array type is not double 处理股票 SZsz399660 失败: input array type is not double 处理股票 SZsz399661 失败: input array type is not double 处理股票 SZsz399662 失败: input array type is not double 处理股票 SZsz399663 失败: input array type is not double 处理股票 SZsz399664 失败: input array type is not double 处理股票 SZsz399665 失败: input array type is not double 处理股票 SZsz399666 失败: input array type is not double 处理股票 SZsz399667 失败: input array type is not double 处理股票 SZsz399668 失败: input array type is not double 处理股票 SZsz399669 失败: input array type is not double 处理股票 SZsz399670 失败: input array type is not double 处理股票 SZsz399671 失败: input array type is not double 处理股票 SZsz399672 失败: input array type is not double 处理股票 SZsz399673 失败: input array type is not double 处理股票 SZsz399674 失败: input array type is not double 处理股票 SZsz399675 失败: input array type is not double 处理股票 SZsz399676 失败: input array type is not double 处理股票 SZsz399677 失败: input array type is not double 处理股票 SZsz399678 失败: input array type is not double 处理股票 SZsz399679 失败: input array type is not double 处理股票 SZsz399680 失败: input array type is not double 处理股票 SZsz399681 失败: input array type is not double 处理股票 SZsz399682 失败: input array type is not double 处理股票 SZsz399683 失败: input array type is not double 处理股票 SZsz399684 失败: input array type is not double 处理股票 SZsz399685 失败: input array type is not double 处理股票 SZsz399686 失败: input array type is not double 处理股票 SZsz399687 失败: input array type is not double 处理股票 SZsz399688 失败: input array type is not double 处理股票 SZsz399689 失败: input array type is not double 处理股票 SZsz399690 失败: input array type is not double 处理股票 SZsz399691 失败: input array type is not double 处理股票 SZsz399692 失败: input array type is not double 处理股票 SZsz399693 失败: input array type is not double 处理股票 SZsz399694 失败: input array type is not double 处理股票 SZsz399695 失败: input array type is not double 处理股票 SZsz399696 失败: input array type is not double 处理股票 SZsz399697 失败: input array type is not double 处理股票 SZsz399698 失败: input array type is not double 处理股票 SZsz399699 失败: input array type is not double 处理股票数据: 100%|██████████| 6720/6720 [00:15<00:00, 424.22it/s] 处理股票 SZsz399701 失败: input array type is not double 处理股票 SZsz399702 失败: input array type is not double 处理股票 SZsz399703 失败: input array type is not double 处理股票 SZsz399704 失败: input array type is not double 处理股票 SZsz399705 失败: input array type is not double 处理股票 SZsz399706 失败: input array type is not double 处理股票 SZsz399707 失败: input array type is not double 处理股票 SZsz399750 失败: input array type is not double 处理股票 SZsz399802 失败: input array type is not double 处理股票 SZsz399803 失败: input array type is not double 处理股票 SZsz399804 失败: input array type is not double 处理股票 SZsz399805 失败: input array type is not double 处理股票 SZsz399806 失败: input array type is not double 处理股票 SZsz399807 失败: input array type is not double 处理股票 SZsz399808 失败: input array type is not double 处理股票 SZsz399809 失败: input array type is not double 处理股票 SZsz399810 失败: input array type is not double 处理股票 SZsz399811 失败: input array type is not double 处理股票 SZsz399812 失败: input array type is not double 处理股票 SZsz399813 失败: input array type is not double 处理股票 SZsz399814 失败: input array type is not double 处理股票 SZsz399817 失败: input array type is not double 处理股票 SZsz399850 失败: input array type is not double 处理股票 SZsz399852 失败: input array type is not double 处理股票 SZsz399901 失败: input array type is not double 处理股票 SZsz399903 失败: input array type is not double 处理股票 SZsz399904 失败: input array type is not double 处理股票 SZsz399905 失败: input array type is not double 处理股票 SZsz399908 失败: input array type is not double 处理股票 SZsz399909 失败: input array type is not double 处理股票 SZsz399910 失败: input array type is not double 处理股票 SZsz399911 失败: input array type is not double 处理股票 SZsz399912 失败: input array type is not double 处理股票 SZsz399913 失败: input array type is not double 处理股票 SZsz399914 失败: input array type is not double 处理股票 SZsz399917 失败: input array type is not double 处理股票 SZsz399918 失败: input array type is not double 处理股票 SZsz399919 失败: input array type is not double 处理股票 SZsz399922 失败: input array type is not double 处理股票 SZsz399925 失败: input array type is not double 处理股票 SZsz399928 失败: input array type is not double 处理股票 SZsz399931 失败: input array type is not double 处理股票 SZsz399932 失败: input array type is not double 处理股票 SZsz399933 失败: input array type is not double 处理股票 SZsz399934 失败: input array type is not double 处理股票 SZsz399935 失败: input array type is not double 处理股票 SZsz399939 失败: input array type is not double 处理股票 SZsz399944 失败: input array type is not double 处理股票 SZsz399950 失败: input array type is not double 处理股票 SZsz399951 失败: input array type is not double 处理股票 SZsz399952 失败: input array type is not double 处理股票 SZsz399957 失败: input array type is not double 处理股票 SZsz399958 失败: input array type is not double 处理股票 SZsz399959 失败: input array type is not double 处理股票 SZsz399961 失败: input array type is not double 处理股票 SZsz399963 失败: input array type is not double 处理股票 SZsz399964 失败: input array type is not double 处理股票 SZsz399965 失败: input array type is not double 处理股票 SZsz399966 失败: input array type is not double 处理股票 SZsz399967 失败: input array type is not double 处理股票 SZsz399969 失败: input array type is not double 处理股票 SZsz399970 失败: input array type is not double 处理股票 SZsz399971 失败: input array type is not double 处理股票 SZsz399972 失败: input array type is not double 处理股票 SZsz399973 失败: input array type is not double 处理股票 SZsz399974 失败: input array type is not double 处理股票 SZsz399975 失败: input array type is not double 处理股票 SZsz399976 失败: input array type is not double 处理股票 SZsz399977 失败: input array type is not double 处理股票 SZsz399978 失败: input array type is not double 处理股票 SZsz399979 失败: input array type is not double 处理股票 SZsz399982 失败: input array type is not double 处理股票 SZsz399983 失败: input array type is not double 处理股票 SZsz399986 失败: input array type is not double 处理股票 SZsz399987 失败: input array type is not double 处理股票 SZsz399989 失败: input array type is not double 处理股票 SZsz399990 失败: input array type is not double 处理股票 SZsz399991 失败: input array type is not double 处理股票 SZsz399992 失败: input array type is not double 处理股票 SZsz399993 失败: input array type is not double 处理股票 SZsz399994 失败: input array type is not double 处理股票 SZsz399995 失败: input array type is not double 处理股票 SZsz399996 失败: input array type is not double 处理股票 SZsz399997 失败: input array type is not double 处理股票 SZsz399998 失败: input array type is not double Traceback (most recent call last): File D:\Anaconda\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals) File d:\股票量化数据库\股票量化数据库\untitled3.py:449 main() File d:\股票量化数据库\股票量化数据库\untitled3.py:426 in main X_train, y_train = trainer.prepare_dataset(train_data, cluster_model, feature_engineer) File d:\股票量化数据库\股票量化数据库\untitled3.py:341 in prepare_dataset X_full = pd.concat(X_list, axis=0) File D:\Anaconda\Lib\site-packages\pandas\core\reshape\concat.py:380 in concat op = _Concatenator( File D:\Anaconda\Lib\site-packages\pandas\core\reshape\concat.py:443 in __init__ objs, keys = self._clean_keys_and_objs(objs, keys) File D:\Anaconda\Lib\site-packages\pandas\core\reshape\concat.py:505 in _clean_keys_and_objs raise ValueError("No objects to concatenate") ValueError: No objects to concatenate
最新发布
07-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值